Repository navigation
|
I am building a controller that manages a custom resource and I want the controller to update fields in the But... Every time I update the status, my controller receives another Is there a best practice on how to implement this pattern? Perhaps there's a way to configure the shell-operator to ignore any updates performed on the |
Answered by
eladb
Aug 7, 2024
Replies: 1 comment
|
So what we did is filter the events inside the hook by inspecting the 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. |
0 replies
Answer selected by
eladb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So what we did is filter the events inside the hook by inspecting the
subresourcefield in the last element ofmanagedFields.Here's a short snippet (in JavaScript):
Might be a nice feature to add to this awesome framework.