replaced logs in validators to be warnings

Originally kubeadm used klot in the validators to log
These logs are converted to warnings and klog was removed.
This commit is contained in:
Marek Counts 2019-08-29 19:29:54 +00:00
parent b88662505d
commit dfbb6fb6bb
3 changed files with 1 additions and 11 deletions

View File

@ -26,7 +26,6 @@ go_library(
"//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library",
"//vendor/github.com/blang/semver:go_default_library", "//vendor/github.com/blang/semver:go_default_library",
"//vendor/github.com/pkg/errors:go_default_library", "//vendor/github.com/pkg/errors:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
], ],
) )

View File

@ -32,7 +32,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
errorsutil "k8s.io/apimachinery/pkg/util/errors" errorsutil "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/klog"
) )
var _ Validator = &KernelValidator{} var _ Validator = &KernelValidator{}
@ -255,12 +254,7 @@ func (k *KernelValidator) parseKernelConfig(r io.Reader) (map[string]kConfigOpti
continue continue
} }
fields := strings.Split(line, "=") fields := strings.Split(line, "=")
if len(fields) != 2 { config[fields[0]] = kConfigOption(fields[1][0])
klog.Errorf("Unexpected fields number in config %q", line)
continue
}
config[fields[0]] = kConfigOption(fields[1])
} }
return config, nil return config, nil
} }

View File

@ -26,7 +26,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
errorsutil "k8s.io/apimachinery/pkg/util/errors" errorsutil "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/klog"
) )
// semVerDotsCount is the number of dots in a valid semantic version. // semVerDotsCount is the number of dots in a valid semantic version.
@ -127,7 +126,6 @@ func (validator *packageValidator) validate(packageSpecs []PackageSpec, manager
// Get the version of the package on the running machine. // Get the version of the package on the running machine.
version, err := manager.getPackageVersion(packageName) version, err := manager.getPackageVersion(packageName)
if err != nil { if err != nil {
klog.V(1).Infof("Failed to get the version for the package %q: %s\n", packageName, err)
errs = append(errs, err) errs = append(errs, err)
validator.reporter.Report(nameWithVerRange, "not installed", bad) validator.reporter.Report(nameWithVerRange, "not installed", bad)
continue continue
@ -145,7 +143,6 @@ func (validator *packageValidator) validate(packageSpecs []PackageSpec, manager
// the version is in the range. // the version is in the range.
sv, err := semver.Make(toSemVer(version)) sv, err := semver.Make(toSemVer(version))
if err != nil { if err != nil {
klog.Errorf("Failed to convert %q to semantic version: %s\n", version, err)
errs = append(errs, err) errs = append(errs, err)
validator.reporter.Report(nameWithVerRange, "internal error", bad) validator.reporter.Report(nameWithVerRange, "internal error", bad)
continue continue