Skip to content

Ignoring updates to the status subresource? #637

Closed Answered by eladb
eladb asked this question in Q&A
Discussion options

You must be logged in to vote

So what we did is filter the events inside the hook by inspecting the subresource field in the last element of managedFields.

Here's a short snippet (in JavaScript):

// ignore updates to the `status` subresource
if (ctx.watchEvent === "Modified") {
  const fields = ctx.object.metadata?.managedFields ?? [];
  const last = f[fields.length - 1];
  if (last?.subresource === "status") {
    return;
  }
}

Might be a nice feature to add to this awesome framework.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by eladb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant