mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-04-27 00:58:13 -04:00
Split factory#BindFlags
This commit is contained in:
parent
6fef6bc977
commit
59ea2b1e59
2 changed files with 7 additions and 3 deletions
|
|
@ -147,6 +147,7 @@ Find more information at https://github.com/kubernetes/kubernetes.`,
|
|||
}
|
||||
|
||||
f.BindFlags(cmds.PersistentFlags())
|
||||
f.BindExternalFlags(cmds.PersistentFlags())
|
||||
|
||||
// From this point and forward we get warnings on flags that contain "_" separators
|
||||
cmds.SetGlobalNormalizationFunc(util.WarnWordSepNormalizeFunc)
|
||||
|
|
|
|||
|
|
@ -564,9 +564,6 @@ func (f *Factory) Command() string {
|
|||
|
||||
// BindFlags adds any flags that are common to all kubectl sub commands.
|
||||
func (f *Factory) BindFlags(flags *pflag.FlagSet) {
|
||||
// any flags defined by external projects (not part of pflags)
|
||||
flags.AddGoFlagSet(flag.CommandLine)
|
||||
|
||||
// Merge factory's flags
|
||||
flags.AddFlagSet(f.flags)
|
||||
|
||||
|
|
@ -581,6 +578,12 @@ func (f *Factory) BindFlags(flags *pflag.FlagSet) {
|
|||
flags.SetNormalizeFunc(util.WordSepNormalizeFunc)
|
||||
}
|
||||
|
||||
// BindCommonFlags adds any flags defined by external projects (not part of pflags)
|
||||
func (f *Factory) BindExternalFlags(flags *pflag.FlagSet) {
|
||||
// any flags defined by external projects (not part of pflags)
|
||||
flags.AddGoFlagSet(flag.CommandLine)
|
||||
}
|
||||
|
||||
func getPorts(spec api.PodSpec) []string {
|
||||
result := []string{}
|
||||
for _, container := range spec.Containers {
|
||||
|
|
|
|||
Loading…
Reference in a new issue