mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #52364 from fabriziopandini/kubeadm437
Automatic merge from submit-queue (batch tested with PRs 51601, 52153, 52364, 52362, 52342) fix Kubeadm phase addon error What this PR does / why we need it: fix Kubeadm phase addon error Which issue this PR fixes [#437](https://github.com/kubernetes/kubeadm/issues/437) Special notes for your reviewer: CC @luxas @andrewrynhard
This commit is contained in:
		@@ -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, 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 {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 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, 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.
 | 
				
			||||||
@@ -136,7 +136,6 @@ func runAddonsCmdFunc(cmdFunc func(cfg *kubeadmapi.MasterConfiguration, client c
 | 
				
			|||||||
			kubeadmutil.CheckErr(err)
 | 
								kubeadmutil.CheckErr(err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		var kubeConfigFile string
 | 
					 | 
				
			||||||
		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)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user