Commit d3731ddb authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #52576 from fabriziopandini/fixAddonPhase

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. fix Kubeadm phase addon regression What this PR does / why we need it: fix Kubeadm phase addon regression Special notes for your reviewer: CC @luxas
parents 3899491d d21040b8
...@@ -99,7 +99,7 @@ func getAddonsSubCommands() []*cobra.Command { ...@@ -99,7 +99,7 @@ func getAddonsSubCommands() []*cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: properties.use, Use: properties.use,
Short: properties.short, Short: properties.short,
Run: runAddonsCmdFunc(properties.cmdFunc, cfg, kubeConfigFile, cfgPath), Run: runAddonsCmdFunc(properties.cmdFunc, cfg, &kubeConfigFile, &cfgPath),
} }
// Add flags to the command // Add flags to the command
...@@ -124,7 +124,7 @@ func getAddonsSubCommands() []*cobra.Command { ...@@ -124,7 +124,7 @@ func getAddonsSubCommands() []*cobra.Command {
} }
// runAddonsCmdFunc creates a cobra.Command Run function, by composing the call to the given cmdFunc with necessary additional steps (e.g preparation of input parameters) // runAddonsCmdFunc creates a cobra.Command Run function, by composing the call to the given cmdFunc with necessary additional steps (e.g preparation of input parameters)
func runAddonsCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration, client clientset.Interface) error, cfg *kubeadmapiext.MasterConfiguration, kubeConfigFile string, cfgPath string) func(cmd *cobra.Command, args []string) { func runAddonsCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration, client clientset.Interface) error, cfg *kubeadmapiext.MasterConfiguration, kubeConfigFile *string, cfgPath *string) func(cmd *cobra.Command, args []string) {
// the following statement build a clousure that wraps a call to a cmdFunc, binding // the following statement build a clousure that wraps a call to a cmdFunc, binding
// the function itself with the specific parameters of each sub command. // the function itself with the specific parameters of each sub command.
...@@ -138,9 +138,9 @@ func runAddonsCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration, client c ...@@ -138,9 +138,9 @@ func runAddonsCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration, client c
internalcfg := &kubeadmapi.MasterConfiguration{} internalcfg := &kubeadmapi.MasterConfiguration{}
api.Scheme.Convert(cfg, internalcfg, nil) api.Scheme.Convert(cfg, internalcfg, nil)
client, err := kubeconfigutil.ClientSetFromFile(kubeConfigFile) client, err := kubeconfigutil.ClientSetFromFile(*kubeConfigFile)
kubeadmutil.CheckErr(err) kubeadmutil.CheckErr(err)
internalcfg, err = configutil.ConfigFileAndDefaultsToInternalConfig(cfgPath, cfg) internalcfg, err = configutil.ConfigFileAndDefaultsToInternalConfig(*cfgPath, cfg)
kubeadmutil.CheckErr(err) kubeadmutil.CheckErr(err)
// Execute the cmdFunc // Execute the cmdFunc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment