Skip to content

Commit

Permalink
Fix %w usage in klog.Errorf
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Feb 29, 2024
1 parent 6687442 commit b9c70f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cmd/nvidia-dra-plugin/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ func (d *driver) CleanupStaleStateContinuously(ctx context.Context) {
for {
resourceVersion, err := d.cleanupStaleStateOnce(ctx)
if err != nil {
klog.Errorf("Error cleaning up stale claim state: %w", err)
klog.Errorf("Error cleaning up stale claim state: %v", err)
}

err = d.cleanupStaleStateContinuously(ctx, resourceVersion, err)
if err != nil {
klog.Errorf("Error cleaning up stale claim state: %w", err)
klog.Errorf("Error cleaning up stale claim state: %v", err)
time.Sleep(CleanupTimeoutSecondsOnError * time.Second)
}
}
Expand Down Expand Up @@ -279,7 +279,7 @@ func (d *driver) cleanupStaleState(ctx context.Context, nas *nascrd.NodeAllocati
go func() {
count := 0
for err := range caErrors {
klog.Errorf("Error cleaning up claim allocations: %w", err)
klog.Errorf("Error cleaning up claim allocations: %v", err)
count++
}
errorCounts <- count
Expand All @@ -290,7 +290,7 @@ func (d *driver) cleanupStaleState(ctx context.Context, nas *nascrd.NodeAllocati
go func() {
count := 0
for err := range cdiErrors {
klog.Errorf("Error cleaning up CDI files: %w", err)
klog.Errorf("Error cleaning up CDI files: %v", err)
count++
}
errorCounts <- count
Expand All @@ -301,7 +301,7 @@ func (d *driver) cleanupStaleState(ctx context.Context, nas *nascrd.NodeAllocati
go func() {
count := 0
for err := range mpsErrors {
klog.Errorf("Error cleaning up MPS control daemon artifacts: %w", err)
klog.Errorf("Error cleaning up MPS control daemon artifacts: %v", err)
count++
}
errorCounts <- count
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-dra-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func StartPlugin(ctx context.Context, config *Config) error {

err = driver.Shutdown(ctx)
if err != nil {
klog.Errorf("Unable to cleanly shutdown driver: %w", err)
klog.Errorf("Unable to cleanly shutdown driver: %v", err)
}

return nil
Expand Down

0 comments on commit b9c70f0

Please sign in to comment.