Skip to content

Commit

Permalink
Merge pull request #1997 from u5surf/issue-1995
Browse files Browse the repository at this point in the history
fix show some option in skaffold delete #1995
  • Loading branch information
dgageot authored Apr 23, 2019
2 parents 37baddd + e999b54 commit 86d72b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
22 changes: 13 additions & 9 deletions cmd/skaffold/app/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/skaffold/app/cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func NewCmdDelete(out io.Writer) *cobra.Command {
return delete(out)
},
}
AddRunDevFlags(cmd)
AddRunCommonFlags(cmd)
return cmd
}

Expand Down
6 changes: 0 additions & 6 deletions docs/content/en/docs/references/cli/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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:
Expand All @@ -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`)
Expand All @@ -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
Expand Down

0 comments on commit 86d72b0

Please sign in to comment.