Copy deployment's annotations to its RC

This commit is contained in:
Janet Kuo
2016-02-01 17:34:48 -08:00
parent 5088d0e147
commit e3cb44aaff
4 changed files with 37 additions and 27 deletions

View File

@@ -46,8 +46,8 @@ type AnnotateOptions struct {
all bool
resourceVersion string
changeCause string
recordFlag bool
changeCause string
recordChangeCause bool
f *cmdutil.Factory
out io.Writer
@@ -155,7 +155,7 @@ func (o *AnnotateOptions) Complete(f *cmdutil.Factory, out io.Writer, cmd *cobra
return err
}
o.recordFlag = cmdutil.GetRecordFlag(cmd)
o.recordChangeCause = cmdutil.GetRecordFlag(cmd)
o.changeCause = f.Command()
mapper, typer := f.Object()
@@ -207,7 +207,7 @@ func (o AnnotateOptions) RunAnnotate() error {
return err
}
// If we should record change-cause, add it to new annotations
if cmdutil.ContainsChangeCause(info) || o.recordFlag {
if cmdutil.ContainsChangeCause(info) || o.recordChangeCause {
o.newAnnotations[kubectl.ChangeCauseAnnotation] = o.changeCause
}
if err := o.updateAnnotations(obj); err != nil {