Add SetOutputFormat() to Factory interface
This is needed to facilitate tests.
@@ -35,6 +35,8 @@ type Factory interface {
RawConfig() (clientcmdapi.Config, error)
// GetOutputFormat Get the output format
GetOutputFormat() (string, error)
+ // SetOutputFormat Set the output format
+ SetOutputFormat(string)
}
// NewFactory Return a new factory interface that can be used by commands
@@ -87,3 +89,7 @@ func (f *factory) GetOutputFormat() (string, error) {
return "", fmt.Errorf("Unsupported output type %v", f.outputFormat)
}
}
+
+func (f *factory) SetOutputFormat(outputFormat string) {
+ f.outputFormat = outputFormat
+}
