From 2d326ea3f08321399fa8cbbf1f308bcac5cc5449 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Wed, 25 Jan 2023 14:42:52 +0100 Subject: [PATCH] cli: set placeholder uid for QEMU / MiniConstellation (#1069) --- cli/internal/cmd/minidown.go | 2 +- cli/internal/cmd/miniup.go | 2 +- cli/internal/terraform/terraform/qemu/outputs.tf | 4 ++++ internal/constants/constants.go | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/internal/cmd/minidown.go b/cli/internal/cmd/minidown.go index aa5c798a9..4de3babe0 100644 --- a/cli/internal/cmd/minidown.go +++ b/cli/internal/cmd/minidown.go @@ -52,7 +52,7 @@ func checkForMiniCluster(fileHandler file.Handler) error { if idFile.CloudProvider != cloudprovider.QEMU { return errors.New("cluster is not a QEMU based Constellation") } - if idFile.UID != "mini" { + if idFile.UID != constants.MiniConstellationUID { return errors.New("cluster is not a MiniConstellation cluster") } diff --git a/cli/internal/cmd/miniup.go b/cli/internal/cmd/miniup.go index 96ce8969b..21fddeb4f 100644 --- a/cli/internal/cmd/miniup.go +++ b/cli/internal/cmd/miniup.go @@ -223,7 +223,7 @@ func (m *miniUpCmd) createMiniCluster(ctx context.Context, fileHandler file.Hand return err } - idFile.UID = "mini" // use UID "mini" to identify MiniConstellation clusters. + idFile.UID = constants.MiniConstellationUID // use UID "mini" to identify MiniConstellation clusters. m.log.Debugf("Cluster id file contains %v", idFile) return fileHandler.WriteJSON(constants.ClusterIDsFileName, idFile, file.OptNone) } diff --git a/cli/internal/terraform/terraform/qemu/outputs.tf b/cli/internal/terraform/terraform/qemu/outputs.tf index 7d66b57fc..e662bbf79 100644 --- a/cli/internal/terraform/terraform/qemu/outputs.tf +++ b/cli/internal/terraform/terraform/qemu/outputs.tf @@ -2,6 +2,10 @@ output "ip" { value = module.control_plane.instance_ips[0] } +output "uid" { + value = "qemu" // placeholder +} + output "initSecret" { value = random_password.initSecret.result sensitive = true diff --git a/internal/constants/constants.go b/internal/constants/constants.go index 47b6b1779..01760dc5c 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -141,6 +141,8 @@ const ( // EnvVarAzureClientSecretValue is environment variable to overwrite // provider.azure.clientSecretValue . EnvVarAzureClientSecretValue = EnvVarPrefix + "AZURE_CLIENT_SECRET_VALUE" + // MiniConstellationUID is a sentinel value for the UID of a mini constellation. + MiniConstellationUID = "mini" // // Kubernetes.