mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Replace logger.Warn(f) with logger.Warning(f)
This aligns better with klog used in other projects. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -134,7 +134,7 @@ func (o Options) RevertConfig(cfg engine.Interface) error {
|
||||
func (o Options) Restart(service string, withSignal func(string) error) error {
|
||||
switch o.RestartMode {
|
||||
case restartModeNone:
|
||||
logrus.Warnf("Skipping restart of %v due to --restart-mode=%v", service, o.RestartMode)
|
||||
logrus.Warningf("Skipping restart of %v due to --restart-mode=%v", service, o.RestartMode)
|
||||
return nil
|
||||
case restartModeSignal:
|
||||
return withSignal(o.Socket)
|
||||
|
||||
@@ -311,11 +311,11 @@ func SignalContainerd(socket string) error {
|
||||
if i == maxReloadAttempts-1 {
|
||||
break
|
||||
}
|
||||
log.Warnf("Error signaling containerd, attempt %v/%v: %v", i+1, maxReloadAttempts, err)
|
||||
log.Warningf("Error signaling containerd, attempt %v/%v: %v", i+1, maxReloadAttempts, err)
|
||||
time.Sleep(reloadBackoff)
|
||||
}
|
||||
if err != nil {
|
||||
log.Warnf("Max retries reached %v/%v, aborting", maxReloadAttempts, maxReloadAttempts)
|
||||
log.Warningf("Max retries reached %v/%v, aborting", maxReloadAttempts, maxReloadAttempts)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -285,11 +285,11 @@ func SignalDocker(socket string) error {
|
||||
if i == maxReloadAttempts-1 {
|
||||
break
|
||||
}
|
||||
log.Warnf("Error signaling docker, attempt %v/%v: %v", i+1, maxReloadAttempts, err)
|
||||
log.Warningf("Error signaling docker, attempt %v/%v: %v", i+1, maxReloadAttempts, err)
|
||||
time.Sleep(reloadBackoff)
|
||||
}
|
||||
if err != nil {
|
||||
log.Warnf("Max retries reached %v/%v, aborting", maxReloadAttempts, maxReloadAttempts)
|
||||
log.Warningf("Max retries reached %v/%v, aborting", maxReloadAttempts, maxReloadAttempts)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -192,8 +192,8 @@ func initialize() error {
|
||||
|
||||
err = unix.Flock(int(f.Fd()), unix.LOCK_EX|unix.LOCK_NB)
|
||||
if err != nil {
|
||||
log.Warnf("Unable to get exclusive lock on '%v'", pidFile)
|
||||
log.Warnf("This normally means an instance of the NVIDIA toolkit Container is already running, aborting")
|
||||
log.Warningf("Unable to get exclusive lock on '%v'", pidFile)
|
||||
log.Warningf("This normally means an instance of the NVIDIA toolkit Container is already running, aborting")
|
||||
return fmt.Errorf("unable to get flock on pidfile: %v", err)
|
||||
}
|
||||
|
||||
@@ -288,6 +288,6 @@ func shutdown() {
|
||||
|
||||
err := os.Remove(pidFile)
|
||||
if err != nil {
|
||||
log.Warnf("Unable to remove pidfile: %v", err)
|
||||
log.Warningf("Unable to remove pidfile: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func installContainerRuntimes(toolkitDir string, driverRoot string) error {
|
||||
// Install the experimental runtime and treat failures as non-fatal.
|
||||
err := installExperimentalRuntime(toolkitDir, driverRoot)
|
||||
if err != nil {
|
||||
log.Warnf("Could not install experimental runtime: %v", err)
|
||||
log.Warningf("Could not install experimental runtime: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -60,7 +60,7 @@ func installContainerRuntimes(toolkitDir string, driverRoot string) error {
|
||||
func installExperimentalRuntime(toolkitDir string, driverRoot string) error {
|
||||
libraryRoot, err := findLibraryRoot(driverRoot)
|
||||
if err != nil {
|
||||
log.Warnf("Error finding library path for root %v: %v", driverRoot, err)
|
||||
log.Warningf("Error finding library path for root %v: %v", driverRoot, err)
|
||||
}
|
||||
log.Infof("Using library root %v", libraryRoot)
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ func installToolkitConfig(c *cli.Context, toolkitConfigPath string, nvidiaContai
|
||||
}
|
||||
value = v.Value()
|
||||
default:
|
||||
log.Warnf("Unexpected type for option %v=%v: %T", key, value, v)
|
||||
log.Warningf("Unexpected type for option %v=%v: %T", key, value, v)
|
||||
}
|
||||
|
||||
config.Set(key, value)
|
||||
|
||||
Reference in New Issue
Block a user