kubeadm: try to reuse RunData
if possible
The generation of `RunData` for init and join is relative time consuming, the data should be shared / reused whenever possible. Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
parent
cba0dcecc9
commit
41b8536a50
@ -221,10 +221,12 @@ func (e *Runner) Run(args []string) error {
|
||||
return errors.New(msg.String())
|
||||
}
|
||||
|
||||
// builds the runner data
|
||||
var data RunData
|
||||
if data, err = e.InitData(args); err != nil {
|
||||
return err
|
||||
// builds the runner data if the runtime data is not initialized
|
||||
data := e.runData
|
||||
if data == nil {
|
||||
if data, err = e.InitData(args); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = e.visitAll(func(p *phaseRunner) error {
|
||||
|
Loading…
Reference in New Issue
Block a user