kubeadm: fixed warning nil logging

parent da20ffda
...@@ -335,9 +335,13 @@ func (sysver SystemVerificationCheck) Check() (warnings, errors []error) { ...@@ -335,9 +335,13 @@ func (sysver SystemVerificationCheck) Check() (warnings, errors []error) {
// Run all validators // Run all validators
for _, v := range validators { for _, v := range validators {
warn, err := v.Validate(system.DefaultSysSpec) warn, err := v.Validate(system.DefaultSysSpec)
if err != nil {
errs = append(errs, err) errs = append(errs, err)
}
if warn != nil {
warns = append(warns, warn) warns = append(warns, warn)
} }
}
err := utilerrors.NewAggregate(errs) err := utilerrors.NewAggregate(errs)
if err != nil { if err != nil {
...@@ -575,7 +579,7 @@ func RunChecks(checks []Checker, ww io.Writer) error { ...@@ -575,7 +579,7 @@ func RunChecks(checks []Checker, ww io.Writer) error {
for _, c := range checks { for _, c := range checks {
warnings, errs := c.Check() warnings, errs := c.Check()
for _, w := range warnings { for _, w := range warnings {
io.WriteString(ww, fmt.Sprintf("[preflight] WARNING: %s\n", w)) io.WriteString(ww, fmt.Sprintf("[preflight] WARNING: %v\n", w))
} }
found = append(found, errs...) found = append(found, errs...)
} }
......
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