Skip to content

Commit

Permalink
use ctx from function
Browse files Browse the repository at this point in the history
Signed-off-by: liucongran <[email protected]>
  • Loading branch information
crliu3227 committed Mar 10, 2025
1 parent 02fbc66 commit 96aee4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/sriovoperatorconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ func (r *SriovOperatorConfigReconciler) syncOpenShiftSystemdService(ctx context.
if cr.Spec.ConfigurationMode != sriovnetworkv1.SystemdConfigurationMode {
obj := &machinev1.MachineConfig{}
// use uncached api reader to get machineconfig to reduce memory footprint
err := r.UncachedAPIReader.Get(context.TODO(), types.NamespacedName{Name: consts.SystemdServiceOcpMachineConfigName}, obj)
err := r.UncachedAPIReader.Get(ctx, types.NamespacedName{Name: consts.SystemdServiceOcpMachineConfigName}, obj)
if err != nil {
if apierrors.IsNotFound(err) {
return nil
Expand All @@ -426,7 +426,7 @@ func (r *SriovOperatorConfigReconciler) syncOpenShiftSystemdService(ctx context.
}

logger.Info("Systemd service was deployed but the operator is now operating on daemonset mode, removing the machine config")
err = r.Delete(context.TODO(), obj)
err = r.Delete(ctx, obj)
if err != nil {
logger.Error(err, "failed to remove the systemd service machine config")
return err
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"context"
"flag"
"k8s.io/apimachinery/pkg/runtime/schema"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down

0 comments on commit 96aee4e

Please sign in to comment.