From 30725bb0c6435236e29f3a3a790511a3ddddf62a Mon Sep 17 00:00:00 2001 From: Nils Hanke Date: Tue, 6 Sep 2022 13:05:49 +0200 Subject: [PATCH] Warn when a debug cluster is created --- cli/internal/cmd/create.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/internal/cmd/create.go b/cli/internal/cmd/create.go index dd214ffe8..d6e5a2d21 100644 --- a/cli/internal/cmd/create.go +++ b/cli/internal/cmd/create.go @@ -67,17 +67,31 @@ func create(cmd *cobra.Command, creator cloudCreator, fileHandler file.Handler, return fmt.Errorf("reading and validating config: %w", err) } + var printedAWarning bool if config.IsDebugImage() { cmd.Println("Configured image does not look like a released production image. Double check image before deploying to production.") + printedAWarning = true + } + + if config.IsDebugCluster() { + cmd.Println("WARNING: Creating a debug cluster. This cluster is not secure and should only be used for debugging purposes.") + cmd.Println("DO NOT USE THIS CLUSTER IN PRODUCTION.") + printedAWarning = true } if config.IsAzureNonCVM() { cmd.Println("Disabling Confidential VMs is insecure. Use only for evaluation purposes.") + printedAWarning = true if config.EnforcesIdKeyDigest() { cmd.Println("Your config asks for enforcing the idkeydigest. This is only available on Confidential VMs. It will not be enforced.") } } + // Print an extra new line later to separate warnings from the prompt message of the create command + if printedAWarning { + cmd.Println("") + } + var instanceType string switch provider { case cloudprovider.Azure: