diff --git a/cmd/skaffold/app/cmd/cmd.go b/cmd/skaffold/app/cmd/cmd.go index 9dae9fa4008..39e214c3309 100644 --- a/cmd/skaffold/app/cmd/cmd.go +++ b/cmd/skaffold/app/cmd/cmd.go @@ -142,13 +142,7 @@ func FlagToEnvVarName(f *pflag.Flag) string { return fmt.Sprintf("SKAFFOLD_%s", strings.Replace(strings.ToUpper(f.Name), "-", "_", -1)) } -func AddRunDeployFlags(cmd *cobra.Command) { - cmd.Flags().BoolVar(&opts.Tail, "tail", false, "Stream logs from deployed objects") - cmd.Flags().BoolVar(&opts.Force, "force", false, "Recreate kubernetes resources if necessary for deployment (default: false, warning: might cause downtime!)") - cmd.Flags().StringArrayVarP(&opts.CustomLabels, "label", "l", nil, "Add custom labels to deployed objects. Set multiple times for multiple labels.") -} - -func AddRunDevFlags(cmd *cobra.Command) { +func AddRunCommonFlags(cmd *cobra.Command) { cmd.Flags().BoolVar(&opts.EnableRPC, "enable-rpc", false, "Enable gRPC for exposing Skaffold events (true by default for `skaffold dev`)") cmd.Flags().IntVar(&opts.RPCPort, "rpc-port", constants.DefaultRPCPort, "tcp port to expose event API") cmd.Flags().IntVar(&opts.RPCHTTPPort, "rpc-http-port", constants.DefaultRPCHTTPPort, "tcp port to expose event REST API over HTTP") @@ -157,11 +151,21 @@ func AddRunDevFlags(cmd *cobra.Command) { cmd.Flags().StringArrayVarP(&opts.Profiles, "profile", "p", nil, "Activate profiles by name") cmd.Flags().StringVarP(&opts.Namespace, "namespace", "n", "", "Run deployments in the specified namespace") cmd.Flags().StringVarP(&opts.DefaultRepo, "default-repo", "d", "", "Default repository value (overrides global config)") + cmd.Flags().BoolVar(&opts.NoPrune, "no-prune", false, "Skip removing images and containers built by Skaffold") + cmd.Flags().StringArrayVar(&opts.InsecureRegistries, "insecure-registry", nil, "Target registries for built images which are not secure") +} + +func AddRunDeployFlags(cmd *cobra.Command) { + cmd.Flags().BoolVar(&opts.Tail, "tail", false, "Stream logs from deployed objects") + cmd.Flags().BoolVar(&opts.Force, "force", false, "Recreate kubernetes resources if necessary for deployment (default: false, warning: might cause downtime!)") + cmd.Flags().StringArrayVarP(&opts.CustomLabels, "label", "l", nil, "Add custom labels to deployed objects. Set multiple times for multiple labels.") +} + +func AddRunDevFlags(cmd *cobra.Command) { + AddRunCommonFlags(cmd) cmd.Flags().BoolVar(&opts.SkipTests, "skip-tests", false, "Whether to skip the tests after building") cmd.Flags().BoolVar(&opts.CacheArtifacts, "cache-artifacts", false, "Set to true to enable caching of artifacts.") cmd.Flags().StringVarP(&opts.CacheFile, "cache-file", "", "", "Specify the location of the cache file (default $HOME/.skaffold/cache)") - cmd.Flags().BoolVar(&opts.NoPrune, "no-prune", false, "Skip removing images and containers built by Skaffold") - cmd.Flags().StringArrayVar(&opts.InsecureRegistries, "insecure-registry", nil, "Target registries for built images which are not secure") } func AddDevDebugFlags(cmd *cobra.Command) { diff --git a/cmd/skaffold/app/cmd/delete.go b/cmd/skaffold/app/cmd/delete.go index f956afb9b99..f16bde91da3 100644 --- a/cmd/skaffold/app/cmd/delete.go +++ b/cmd/skaffold/app/cmd/delete.go @@ -34,7 +34,7 @@ func NewCmdDelete(out io.Writer) *cobra.Command { return delete(out) }, } - AddRunDevFlags(cmd) + AddRunCommonFlags(cmd) return cmd } diff --git a/docs/content/en/docs/references/cli/_index.md b/docs/content/en/docs/references/cli/_index.md index 9dce5d3c76e..cbd1bc412db 100644 --- a/docs/content/en/docs/references/cli/_index.md +++ b/docs/content/en/docs/references/cli/_index.md @@ -279,8 +279,6 @@ Usage: skaffold delete Flags: - --cache-artifacts Set to true to enable caching of artifacts. - --cache-file string Specify the location of the cache file (default $HOME/.skaffold/cache) -d, --default-repo string Default repository value (overrides global config) --enable-rpc skaffold dev Enable gRPC for exposing Skaffold events (true by default for skaffold dev) -f, --filename string Filename or URL to the pipeline file (default "skaffold.yaml") @@ -290,7 +288,6 @@ Flags: -p, --profile stringArray Activate profiles by name --rpc-http-port int tcp port to expose event REST API over HTTP (default 50052) --rpc-port int tcp port to expose event API (default 50051) - --skip-tests Whether to skip the tests after building --toot Emit a terminal beep after the deploy is complete Global Flags: @@ -301,8 +298,6 @@ Global Flags: ``` Env vars: -* `SKAFFOLD_CACHE_ARTIFACTS` (same as `--cache-artifacts`) -* `SKAFFOLD_CACHE_FILE` (same as `--cache-file`) * `SKAFFOLD_DEFAULT_REPO` (same as `--default-repo`) * `SKAFFOLD_ENABLE_RPC` (same as `--enable-rpc`) * `SKAFFOLD_FILENAME` (same as `--filename`) @@ -312,7 +307,6 @@ Env vars: * `SKAFFOLD_PROFILE` (same as `--profile`) * `SKAFFOLD_RPC_HTTP_PORT` (same as `--rpc-http-port`) * `SKAFFOLD_RPC_PORT` (same as `--rpc-port`) -* `SKAFFOLD_SKIP_TESTS` (same as `--skip-tests`) * `SKAFFOLD_TOOT` (same as `--toot`) ### skaffold deploy