Skip to content

Commit

Permalink
updated logging
Browse files Browse the repository at this point in the history
  • Loading branch information
schaeferka committed Oct 28, 2024
1 parent 7da425d commit 60c303e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/finalizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,17 @@ export function addFinalizer<K extends KubernetesObject>(request: PeprMutateRequ
}

request.Merge({ metadata: { finalizers } } as DeepPartial<K>);

// Log the addition of a finalizer with the alias
Log.info({ alias: request.Request.name }, `Added finalizer '${peprFinal}' to ${request.Raw.metadata?.name}`);
}

export async function removeFinalizer(binding: Binding, obj: KubernetesObject) {
const peprFinal = "pepr.dev/finalizer";
const meta = obj.metadata!;
const resource = `${meta.namespace || "ClusterScoped"}/${meta.name}`;

Log.debug({ obj }, `Removing finalizer '${peprFinal}' from '${resource}'`);
Log.debug({ obj, alias: binding.alias }, `Removing finalizer '${peprFinal}' from '${resource}'`);

// ensure request model is registerd with KFC (for non-built in CRD's, etc.)
const { model, kind } = binding;
Expand Down

0 comments on commit 60c303e

Please sign in to comment.