Merge pull request #35408 from xilabao/add-secret-to-pflag

Automatic merge from submit-queue (batch tested with PRs 35408, 41915, 41992, 41964, 41925)

add secret option to flag

To resolve the issue of security(pr #35030 ),

> @smarterclayton commented 5 days ago
> This is unfortunately not all flags that could be secrets. The best option would be to add support in spf13/pflag to tag a flag as a secret, and then use that bit to determine the list.
> 
> Also, Command() could be used in contexts that need exact parameters (for subshell execution), so we would need to add a new method or extend the signature here to allow exact flags to be retrieved.

we could add a secret option to the flags.
This commit is contained in:
Kubernetes Submit Queue
2017-02-26 18:07:53 -08:00
committed by GitHub
36 changed files with 628 additions and 71 deletions

View File

@@ -537,7 +537,7 @@ func visitAnnotation(cmd *cobra.Command, f cmdutil.Factory, annotationVisitor re
return err
}
if cmdutil.ShouldRecord(cmd, info) {
if err := cmdutil.RecordChangeCause(info.Object, f.Command()); err != nil {
if err := cmdutil.RecordChangeCause(info.Object, f.Command(cmd, false)); err != nil {
return err
}
}