From b1a64a65caa568e8a9d819eb60f6754e5fea9576 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Mon, 15 Nov 2021 09:58:30 +0000 Subject: [PATCH] Hide behind envvars --- pkg/cmd/pulumi/preview.go | 8 +++++--- pkg/cmd/pulumi/up.go | 12 +++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkg/cmd/pulumi/preview.go b/pkg/cmd/pulumi/preview.go index fb29177e3..40617f480 100644 --- a/pkg/cmd/pulumi/preview.go +++ b/pkg/cmd/pulumi/preview.go @@ -233,9 +233,11 @@ func newPreviewCmd() *cobra.Command { cmd.PersistentFlags().BoolVar( &configPath, "config-path", false, "Config keys contain a path to a property in a map or list to set") - cmd.PersistentFlags().StringVar( - &planFilePath, "save-constaints", "", - "Save the operations proposed by the preview to a constraints file at the given path") + if hasExperimentalCommands() { + cmd.PersistentFlags().StringVar( + &planFilePath, "save-constaints", "", + "Save the operations proposed by the preview to a constraints file at the given path") + } cmd.Flags().BoolVarP( &showSecrets, "show-secrets", "", false, "Emit secrets in plaintext in the plan file. Defaults to `false`") diff --git a/pkg/cmd/pulumi/up.go b/pkg/cmd/pulumi/up.go index 982297d14..7bc7afd25 100644 --- a/pkg/cmd/pulumi/up.go +++ b/pkg/cmd/pulumi/up.go @@ -522,11 +522,13 @@ func newUpCmd() *cobra.Command { &yes, "yes", "y", false, "Automatically approve and perform the update after previewing it") - cmd.PersistentFlags().StringVar( - &planFilePath, "constraints-file", "", - "Path to a constraints file to use for the update. The update will not "+ - "perform operations that exceed its constraints (e.g. replacements instead of updates, or updates instead"+ - "of sames).") + if hasExperimentalCommands() { + cmd.PersistentFlags().StringVar( + &planFilePath, "constraints-file", "", + "Path to a constraints file to use for the update. The update will not "+ + "perform operations that exceed its constraints (e.g. replacements instead of updates, or updates instead"+ + "of sames).") + } if hasDebugCommands() { cmd.PersistentFlags().StringVar(