-
| 
         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   | 
  
Beta Was this translation helpful? Give feedback.
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.  | 
  
Beta Was this translation helpful? Give feedback.
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.