fix --save-config in create subcommand

This commit is contained in:
xilabao 2017-01-23 15:15:37 +08:00
parent 8d5227bb2e
commit 93c63d76e8

View File

@ -243,9 +243,11 @@ func RunCreateSubcommand(f cmdutil.Factory, cmd *cobra.Command, out io.Writer, o
if err != nil { if err != nil {
return err return err
} }
if err := kubectl.UpdateApplyAnnotation(info, f.JSONEncoder()); err != nil { if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info, f.JSONEncoder()); err != nil {
return err return err
} }
obj = info.Object
if !options.DryRun { if !options.DryRun {
obj, err = resource.NewHelper(client, mapping).Create(namespace, false, info.Object) obj, err = resource.NewHelper(client, mapping).Create(namespace, false, info.Object)
if err != nil { if err != nil {