diff --git a/cmd/kubeadm/app/cmd/options/generic.go b/cmd/kubeadm/app/cmd/options/generic.go index 2f52fec618c..039d398551a 100644 --- a/cmd/kubeadm/app/cmd/options/generic.go +++ b/cmd/kubeadm/app/cmd/options/generic.go @@ -95,3 +95,15 @@ func AddKustomizePodsFlag(fs *pflag.FlagSet, kustomizeDir *string) { fs.StringVarP(kustomizeDir, Kustomize, "k", *kustomizeDir, "The path where kustomize patches for static pod manifests are stored.") fs.MarkDeprecated(Kustomize, fmt.Sprintf("This flag is deprecated and will be removed in a future version. Please use %s instead.", Patches)) } + +// AddPatchesFlag adds the --patches flag to the given flagset +func AddPatchesFlag(fs *pflag.FlagSet, patchesDir *string) { + fs.StringVar(patchesDir, Patches, *patchesDir, `Path to a directory that contains files named `+ + `"target[suffix][+patchtype].extension". For example, `+ + `"kube-apiserver0+merge.yaml" or just "etcd.json". `+ + `"patchtype" can be one of "strategic", "merge" or "json" and they match the patch formats `+ + `supported by kubectl. The default "patchtype" is "strategic". "extension" must be either `+ + `"json" or "yaml". "suffix" is an optional string that can be used to determine `+ + `which patches are applied first alpha-numerically.`, + ) +}