Update kubefed federate to dry run when outputing yaml
@@ -92,7 +92,7 @@ func (o *enableTypeOptions) Bind(flags *pflag.FlagSet) {
)
flags.StringVar(&o.primitiveGroup, "primitive-group", defaultPrimitiveGroup, "The name of the API group to use for generated federation primitives.")
flags.StringVar(&o.primitiveVersion, "primitive-version", defaultPrimitiveVersion, "The API version to use for generated federation primitives.")
- flags.StringVarP(&o.output, "output", "o", "", "If provided, the resources that will be created in the API will be output to stdout in the provided format. Valid values are ['yaml'].")
+ flags.StringVarP(&o.output, "output", "o", "", "If provided, the resources that would be created in the API by the command are instead output to stdout in the provided format. Valid values are ['yaml'].")
flags.StringVarP(&o.filename, "filename", "f", "", "If provided, the command will be configured from the provided yaml file. Only --output wll be accepted from the command line")
}
@@ -194,6 +194,8 @@ func (j *enableType) Run(cmdOut io.Writer, config util.FedConfig) error {
if err != nil {
return fmt.Errorf("Failed to write objects to YAML: %v", err)
}
+ // -o yaml implies dry run
+ return nil
}
if j.DryRun {
