Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logs in orphaned PV controller #1431

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkg/controller/orphanedpv/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (opc *Controller) sync(ctx context.Context, key string) error {

sc, err := opc.scyllaLister.ScyllaClusters(namespace).Get(name)
if apierrors.IsNotFound(err) {
klog.V(2).InfoS("ScyllaCluster has been deleted", "ScyllaCluster", klog.KObj(sc))
klog.V(2).InfoS("ScyllaCluster has been deleted", "ScyllaCluster", klog.KRef(namespace, name))
return nil
}
if err != nil {
Expand All @@ -93,7 +93,7 @@ func (opc *Controller) sync(ctx context.Context, key string) error {
}

if !sc.Spec.AutomaticOrphanedNodeCleanup {
klog.V(4).InfoS("ScyllaCluster doesn't have AutomaticOrphanedNodeCleanup enabled", "ScyllaCluster", klog.KRef(namespace, name))
klog.V(4).InfoS("ScyllaCluster doesn't have AutomaticOrphanedNodeCleanup enabled", "ScyllaCluster", klog.KObj(sc))
return nil
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func (opc *Controller) sync(ctx context.Context, key string) error {
continue
}

klog.V(2).InfoS("PV is orphaned", "ScyllaCluster", sc, "PV", klog.KObj(pi.PV))
klog.V(2).InfoS("PV is orphaned", "ScyllaCluster", klog.KObj(sc), "PV", klog.KObj(pi.PV))

// Verify that the node doesn't exist with a live call.
freshNodes, err := opc.kubeClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{
Expand All @@ -142,7 +142,7 @@ func (opc *Controller) sync(ctx context.Context, key string) error {
continue
}

klog.V(2).InfoS("PV is verified as orphaned.", "ScyllaCluster", sc, "PV", klog.KObj(pi.PV))
klog.V(2).InfoS("PV is verified as orphaned.", "ScyllaCluster", klog.KObj(sc), "PV", klog.KObj(pi.PV))

_, err = opc.kubeClient.CoreV1().Services(sc.Namespace).Patch(
ctx,
Expand All @@ -156,7 +156,7 @@ func (opc *Controller) sync(ctx context.Context, key string) error {
continue
}

klog.V(2).InfoS("Marked service for replacement", "ScyllaCluster", sc, "Service", pi.ServiceName)
klog.V(2).InfoS("Marked service for replacement", "ScyllaCluster", klog.KObj(sc), "Service", klog.KRef(sc.Namespace, pi.ServiceName))
}

err = utilerrors.NewAggregate(errs)
Expand Down