From d8e841512d1260858202501eefd88c509df49c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Thu, 16 Nov 2023 16:31:03 +0100 Subject: [PATCH] Deprecate create command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- cli/internal/cmd/applyterraform.go | 21 ++++++++++++++++++--- cli/internal/cmd/create.go | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/cli/internal/cmd/applyterraform.go b/cli/internal/cmd/applyterraform.go index 9151a7c787a..b82a0401593 100644 --- a/cli/internal/cmd/applyterraform.go +++ b/cli/internal/cmd/applyterraform.go @@ -161,10 +161,21 @@ func printCreateInfo(out io.Writer, conf *config.Config, log debugLog) error { if !ok { return fmt.Errorf("default control-plane node group %q not found in configuration", constants.DefaultControlPlaneGroupName) } + controlPlaneType := controlPlaneGroup.InstanceType + workerGroup, ok := conf.NodeGroups[constants.DefaultWorkerGroupName] if !ok { return fmt.Errorf("default worker node group %q not found in configuration", constants.DefaultWorkerGroupName) } + workerGroupType := workerGroup.InstanceType + + var qemuInstanceType string + if conf.GetProvider() == cloudprovider.QEMU { + qemuInstanceType = fmt.Sprintf("%d-vCPUs", conf.Provider.QEMU.VCPUs) + controlPlaneType = qemuInstanceType + workerGroupType = qemuInstanceType + } + otherGroupNames := make([]string, 0, len(conf.NodeGroups)-2) for groupName := range conf.NodeGroups { if groupName != constants.DefaultControlPlaneGroupName && groupName != constants.DefaultWorkerGroupName { @@ -176,11 +187,15 @@ func printCreateInfo(out io.Writer, conf *config.Config, log debugLog) error { } fmt.Fprintf(out, "The following Constellation cluster will be created:\n") - fmt.Fprintf(out, " %d control-plane node%s of type %s will be created.\n", controlPlaneGroup.InitialCount, isPlural(controlPlaneGroup.InitialCount), controlPlaneGroup.InstanceType) - fmt.Fprintf(out, " %d worker node%s of type %s will be created.\n", workerGroup.InitialCount, isPlural(workerGroup.InitialCount), workerGroup.InstanceType) + fmt.Fprintf(out, " %d control-plane node%s of type %s will be created.\n", controlPlaneGroup.InitialCount, isPlural(controlPlaneGroup.InitialCount), controlPlaneType) + fmt.Fprintf(out, " %d worker node%s of type %s will be created.\n", workerGroup.InitialCount, isPlural(workerGroup.InitialCount), workerGroupType) for _, groupName := range otherGroupNames { group := conf.NodeGroups[groupName] - fmt.Fprintf(out, " group %s with %d node%s of type %s will be created.\n", groupName, group.InitialCount, isPlural(group.InitialCount), group.InstanceType) + groupInstanceType := group.InstanceType + if conf.GetProvider() == cloudprovider.QEMU { + groupInstanceType = qemuInstanceType + } + fmt.Fprintf(out, " group %s with %d node%s of type %s will be created.\n", groupName, group.InitialCount, isPlural(group.InitialCount), groupInstanceType) } return nil diff --git a/cli/internal/cmd/create.go b/cli/internal/cmd/create.go index cc87120d66c..83d2c5c54eb 100644 --- a/cli/internal/cmd/create.go +++ b/cli/internal/cmd/create.go @@ -31,6 +31,7 @@ func NewCreateCmd() *cobra.Command { cmd.Flags().StringSlice("skip-phases", allPhases(skipInfrastructurePhase), "") return runApply(cmd, args) }, + Deprecated: "use 'constellation apply' instead.", } cmd.Flags().BoolP("yes", "y", false, "create the cluster without further confirmation") return cmd