Make generation of the apply annotation optional

This commit is contained in:
Janet Kuo
2015-11-04 13:47:08 -08:00
parent 13e68d2a87
commit a6a64820d7
24 changed files with 158 additions and 41 deletions

View File

@@ -93,6 +93,7 @@ func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command {
usage := "Filename, directory, or URL to a file identifying the resource to expose a service"
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
cmdutil.AddApplyAnnotationFlags(cmd)
return cmd
}
@@ -201,8 +202,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
if cmdutil.GetFlagBool(cmd, "dry-run") {
return f.PrintObject(cmd, object, out)
}
// Serialize the configuration into an annotation.
if err := kubectl.UpdateApplyAnnotation(info); err != nil {
if err := kubectl.CreateOrUpdateAnnotation(cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag), info); err != nil {
return err
}