Skip to content

Commit

Permalink
Review remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
trasc committed Feb 5, 2024
1 parent d531485 commit ebe1e32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/kueue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/utils/ptr"

zaplog "go.uber.org/zap"
"go.uber.org/zap/zapcore"
Expand All @@ -39,6 +38,7 @@ import (
"k8s.io/client-go/discovery"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/healthz"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ func (rc *remoteClient) runGC(ctx context.Context) {

// if the remote wl has a controller(owning Job), delete the job
if controller := metav1.GetControllerOf(&remoteWl); controller != nil {
ownerKey := types.NamespacedName{Name: controller.Name, Namespace: remoteWl.Namespace}
ownerKey := klog.KRef(remoteWl.Namespace, controller.Name)
adapterKey := schema.FromAPIVersionAndKind(controller.APIVersion, controller.Kind).String()
if adapter, found := adapters[adapterKey]; !found {
wlLog.V(2).Info("No adapter found", "adapterKey", adapterKey, "ownerKey", ownerKey)
} else {
wlLog.V(5).Info("MultiKueueGC deleting workload owner", "ownerKey", ownerKey, "ownnerKind", controller)
err := adapter.DeleteRemoteObject(ctx, rc.client, ownerKey)
err := adapter.DeleteRemoteObject(ctx, rc.client, types.NamespacedName{Name: controller.Name, Namespace: remoteWl.Namespace})
if client.IgnoreNotFound(err) != nil {
wlLog.V(2).Error(err, "Deleting remote workload's owner", "ownerKey", ownerKey)
}
Expand Down Expand Up @@ -344,7 +344,7 @@ func (c *clustersReconciler) updateStatus(ctx context.Context, cluster *kueuealp
}

func (c *clustersReconciler) runGC(ctx context.Context) {
log := ctrl.LoggerFrom(ctx)
log := ctrl.LoggerFrom(ctx).WithName("MultiKueueGC")
if c.gcInterval == 0 {
log.V(2).Info("Garbage Collection is disabled")
return
Expand Down

0 comments on commit ebe1e32

Please sign in to comment.