-
Notifications
You must be signed in to change notification settings - Fork 459
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
Restart collector pod when config is updated #215
Conversation
@jpkrohling, Kindly share feedback |
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.
Looks great! If you agree with the change to the test package, I'll merge this after you update the PR.
Also, had a question. I still have not yet figured out how sidecar deployment works. I am not sure if this change will support sidecar mode of deployment. |
How it works should be documented as part of #214. Once I check that, I'll let you know so that you can verify how this PR would influence that (it shouldn't). |
@jpkrohling - I guess merge was blocked as branch diverged from main. Rebased with main. I guess you would need to approve again |
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.
Sorry, found a small bug in the way precedence of the values. Other than that, looks good.
main.go
Outdated
Log: ctrl.Log.WithName("controllers").WithName("OpenTelemetryCollector"), | ||
Scheme: mgr.GetScheme(), | ||
Config: cfg, | ||
Recorder: mgr.GetEventRecorderFor("otel-controller"), |
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.
Can we use opentelemetry-operator
, or do they recommend using the shortest possible name?
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.
My bad. Agreed, we should be consistent - would change it to opentelemetry-operator.
|
||
// test | ||
annotations := Annotations(otelcol) | ||
assert.Equal(t, "true", annotations["prometheus.io/scrape"]) |
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.
Could you also add a test for the case where the annotation exists in the CR? If a user has specified scrape
as false, we should honor that. I think the code is currently doing the opposite.
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. My bad, fixing it and adding a test for the same
Signed-off-by: santosh <bsantosh@thoughtworks.com>
Signed-off-by: santosh <bsantosh@thoughtworks.com>
Signed-off-by: santosh <bsantosh@thoughtworks.com>
Annotations now allow user to override prometheus annotations. Add tests for the same. Signed-off-by: santosh <bsantosh@thoughtworks.com>
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.
Thanks for the contribution!
Signed-off-by: santosh <bsantosh@thoughtworks.com>
Signed-off-by: santosh <bsantosh@thoughtworks.com>
Signed-off-by: santosh bsantosh@thoughtworks.com
Resolves #197
Change Description
Annotate deployment/daemonset with SHA256 of the config data. Publish an event for configmap, whenever config changes. On the reconcile loop triggered by configmap event - deployment/daemonset would be updated leading to rolling restart of the pod.