-
Notifications
You must be signed in to change notification settings - Fork 494
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
Created annotations filter #2692
Conversation
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
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.
a few small things, also can you augment or create an e2e test for this? do we have one for the label filter that we could tack this on to?
Signed-off-by: Yuri Sa <[email protected]>
const configMapHashAnnotationKey = "opentelemetry-opampbridge-config/hash" | ||
|
||
// Annotations returns the annotations for the OPAmpBridge Pod. | ||
func Annotations(instance v1alpha1.OpAMPBridge, configMap *v1.ConfigMap, filterAnnotations []string) map[string]string { |
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.
i wonder if we should also move annotations.go and labels.go to a shared thing in manifestutils?
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.
To be honest, I've tried to do that, but I faced an import cycle issue. I believe we could dig into that in the future, moving the annotations to the manifestutils. wdyt?
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.
yeah that makes sense, want to open an issue about that?
Signed-off-by: Yuri Sa <[email protected]>
Added some e2e for Labels and Annotations filters. Do you think we should change the parameter from labels to labels-filter? I know it's a breaking change, however, this name makes more sense for that purpose. |
@yuriolisa i think if we make that change (renaming labels) we should do it in a follow up |
also, looks like the e2e tests are failing on make: |
Signed-off-by: Yuri Sa <[email protected]>
So, if we intend to do a follow-up, I decided to set the annotations parameters as annotations-filter. |
Thanks for catching-up on that, it should be labels instead, once we don't have any e2e labels filter yet. |
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
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.
one small nit, otherwise this LGTM. given the size of this, I'm going to wait to merge on another approver to give it a ✅
Signed-off-by: Yuri Sa <[email protected]>
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.
All of this looks good to me, although I think we ended up putting way too many changes into this PR. For example, the config hash annotation for opamp bridge definitely should've been a separate PR. I'm fine with merging as-is, though I wouldn't mind splitting it either.
The main thing that's actually unclear to me, is what the format of the --annotations-filter
value is supposed to be. It looks like a glob, but then we parse it into a regex in a weird way. I'd like us to document it better, even if it's just a description of the flag.
Signed-off-by: Yuri Sa <[email protected]>
@swiatekm-sumo, thank you for pointing out these topics. I will be aware next time to split into smaller parts. I've just sent an improvement to the parameter. Let me know wdyt. |
Signed-off-by: Yuri Sa <[email protected]>
Signed-off-by: Yuri Sa <[email protected]>
@yuriolisa Thank you for adding this!! |
No problem, happy to contribute; I hope it's gonna helpful for your use case. |
I just tested this out using the latest v0.96.0 image and the annotations aren't being filtered out as I'd expect. I'm not sure what i'm missing. I setup a kind cluster via:
then I downloaded the latest install here:
I then edited that to add the --annotations-filter arg below for the operator's Deployment:
Finally I added an OpenTelemetryCollector resource that has an annotation I was expecting filtered out:
The Am I using the |
* Created annotations filter Signed-off-by: Yuri Sa <[email protected]> * Created annotations filters test Signed-off-by: Yuri Sa <[email protected]> * Adjusted linters Signed-off-by: Yuri Sa <[email protected]> * Added Annotations Filter for OpAMP and TA Signed-off-by: Yuri Sa <[email protected]> * Added e2e tests for Labels and Annotations Signed-off-by: Yuri Sa <[email protected]> * Added e2e tests for Labels and Annotations Signed-off-by: Yuri Sa <[email protected]> * Added e2e tests for Labels and Annotations Signed-off-by: Yuri Sa <[email protected]> * Added e2e tests for Labels and Annotations Signed-off-by: Yuri Sa <[email protected]> * Fixed tests Signed-off-by: Yuri Sa <[email protected]> * Reverting kustomization Signed-off-by: Yuri Sa <[email protected]> * Reverting kustomization Signed-off-by: Yuri Sa <[email protected]> * Improved annotations Signed-off-by: Yuri Sa <[email protected]> * Changed description Signed-off-by: Yuri Sa <[email protected]> --------- Signed-off-by: Yuri Sa <[email protected]>
Description:
Created ability to filter out Annotations
Link to tracking Issue(s):
Testing:
Unit tests have been modified accordingly.
Documentation: