mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
kubeadm: use "SkipPhases" from configuration for "init" and "join"
During Runner data initialization, if the value for the flag "--skip-phases" was empty set the {init|join}Runner.Options.SkipPhases to the {Init|Join}Configuration.SkipPhases value.
This commit is contained in:
parent
ac161866aa
commit
24a1f9d817
@ -192,7 +192,15 @@ func newCmdInit(out io.Writer, initOptions *initOptions) *cobra.Command {
|
||||
// sets the data builder function, that will be used by the runner
|
||||
// both when running the entire workflow or single phases
|
||||
initRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
|
||||
return newInitData(cmd, args, initOptions, out)
|
||||
data, err := newInitData(cmd, args, initOptions, out)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If the flag for skipping phases was empty, use the values from config
|
||||
if len(initRunner.Options.SkipPhases) == 0 {
|
||||
initRunner.Options.SkipPhases = data.cfg.SkipPhases
|
||||
}
|
||||
return data, nil
|
||||
})
|
||||
|
||||
// binds the Runner to kubeadm init command by altering
|
||||
|
@ -213,7 +213,15 @@ func newCmdJoin(out io.Writer, joinOptions *joinOptions) *cobra.Command {
|
||||
// sets the data builder function, that will be used by the runner
|
||||
// both when running the entire workflow or single phases
|
||||
joinRunner.SetDataInitializer(func(cmd *cobra.Command, args []string) (workflow.RunData, error) {
|
||||
return newJoinData(cmd, args, joinOptions, out, kubeadmconstants.GetAdminKubeConfigPath())
|
||||
data, err := newJoinData(cmd, args, joinOptions, out, kubeadmconstants.GetAdminKubeConfigPath())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// If the flag for skipping phases was empty, use the values from config
|
||||
if len(joinRunner.Options.SkipPhases) == 0 {
|
||||
joinRunner.Options.SkipPhases = data.cfg.SkipPhases
|
||||
}
|
||||
return data, nil
|
||||
})
|
||||
|
||||
// binds the Runner to kubeadm join command by altering
|
||||
|
Loading…
Reference in New Issue
Block a user