diff --git a/cmd/cli/kubectl-kyverno/commands/apply/command.go b/cmd/cli/kubectl-kyverno/commands/apply/command.go index 80832df70c..4f6482b441 100644 --- a/cmd/cli/kubectl-kyverno/commands/apply/command.go +++ b/cmd/cli/kubectl-kyverno/commands/apply/command.go @@ -99,6 +99,7 @@ func Command() *cobra.Command { }, } cmd.Flags().StringSliceVarP(&applyCommandConfig.ResourcePaths, "resource", "r", []string{}, "Path to resource files") + cmd.Flags().StringSliceVarP(&applyCommandConfig.ResourcePaths, "resources", "", []string{}, "Path to resource files") cmd.Flags().BoolVarP(&applyCommandConfig.Cluster, "cluster", "c", false, "Checks if policies should be applied to cluster in the current context") cmd.Flags().StringVarP(&applyCommandConfig.MutateLogPath, "output", "o", "", "Prints the mutated resources in provided file/directory") // currently `set` flag supports variable for single policy applied on single resource @@ -119,6 +120,7 @@ func Command() *cobra.Command { cmd.Flags().BoolVar(&detailedResults, "detailed-results", false, "If set to true, display detailed results") cmd.Flags().BoolVarP(&table, "table", "t", false, "Show results in table format") cmd.Flags().StringSliceVarP(&applyCommandConfig.Exception, "exception", "e", nil, "Policy exception to be considered when evaluating policies against resources") + cmd.Flags().StringSliceVarP(&applyCommandConfig.Exception, "exceptions", "", nil, "Policy exception to be considered when evaluating policies against resources") return cmd } diff --git a/docs/user/cli/commands/kyverno_apply.md b/docs/user/cli/commands/kyverno_apply.md index 302cafc7a3..e5a99388ed 100644 --- a/docs/user/cli/commands/kyverno_apply.md +++ b/docs/user/cli/commands/kyverno_apply.md @@ -42,6 +42,7 @@ kyverno apply [flags] --context string The name of the kubeconfig context to use --detailed-results If set to true, display detailed results -e, --exception strings Policy exception to be considered when evaluating policies against resources + --exceptions strings Policy exception to be considered when evaluating policies against resources -b, --git-branch string test git repository branch -h, --help help for apply --kubeconfig string path to kubeconfig file with authorization and master location information @@ -51,6 +52,7 @@ kyverno apply [flags] --registry If set to true, access the image registry using local docker credentials to populate external data --remove-color Remove any color from output -r, --resource strings Path to resource files + --resources strings Path to resource files -s, --set strings Variables that are required -i, --stdin Optional mutate policy parameter to pipe directly through to kubectl -t, --table Show results in table format