-
Notifications
You must be signed in to change notification settings - Fork 389
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
crd: Fix type mismatch warning #1979
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
pkg/watcher/crd/watcher.go
Outdated
@@ -143,6 +141,7 @@ func updateTracingPolicy(ctx context.Context, log logrus.FieldLogger, s *sensors | |||
"new": newTp.TpName(), | |||
}).Info("updating tracing policy") | |||
update(oldTp, newTp) | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm rather than putting more returns here maybe we could have update return an error and then if (err) ... print the warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this may be a cleaner solution there. I will try to make that better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated that a bit. The error is not due to the update but on the different types of tracing policies. I believe it is cleaner now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah that is much clearer to me what the issue was. thanks.
When we update a tracing policy (i.e. apply a policy with the same name as an existing policy), we check if the new tracing policy has the same type (i.e. TracingPolicy or TracingPolicyNamespaced) as the old one. Now we print the warning about type mismatch even if the types are the same. This patch fixes that by returing right after the actual update. Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
2fd5e5c
to
e0b1dce
Compare
When we update a tracing policy (i.e. apply a policy with the same name as an existing policy), we check if the new tracing policy has the same type (i.e. TracingPolicy or TracingPolicyNamespaced) as the old one.
Now we print the warning about type mismatch even if the types are the same. This patch fixes that by returing right after the actual update.