-
Notifications
You must be signed in to change notification settings - Fork 510
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
[Operator] Optional tag for collector #1196
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -49,6 +49,8 @@ spec: | |||||
{{- end }} | ||||||
{{- if and .Values.manager.collectorImage.repository .Values.manager.collectorImage.tag }} | ||||||
- --collector-image={{ .Values.manager.collectorImage.repository }}:{{ .Values.manager.collectorImage.tag }} | ||||||
{{- else if .Values.manager.collectorImage.repository }} | ||||||
- --collector-image={{ .Values.manager.collectorImage.repository }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jdiegosierra in the situation that we don't pass in a tag, are you sure the tag that ends up being uses is the default collector version from the operator and not the latest version of the set image repository? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried with the latest version, so let me check it with a different one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TylerHelmuth It works as expected: manager:
image:
repository: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator
tag: "0.99.0"
collectorImage:
repository: ""
tag: "" k describe pod opentelemetry-operator-79cbd68444-wdpl9 | grep Image:
Image: ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.99.0 k describe pod simplest-collector-54bb659675-99d7g | grep Image:
Image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector:0.99.0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about when you set and image repository and not a tag? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that scenario, the operator assumes the collector image is the latest one. If we want to have both components with the same version in that specific scenario, I guess we can pick the tag from the operator. # Source: opentelemetry-operator/templates/deployment.yaml
- --collector-image=otel/opentelemetry-collector
image: "ghcr.io/open-telemetry/opentelemetry-operator/opentelemetry-operator:0.99.0"
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyway, that situation can not happen right now because it is mandatory to have both fields set: opentelemetry-helm-charts/charts/opentelemetry-operator/templates/deployment.yaml Lines 50 to 51 in ef0e1ac
|
||||||
{{- end }} | ||||||
{{- if and .Values.manager.opampBridgeImage.repository .Values.manager.opampBridgeImage.tag }} | ||||||
- --operator-opamp-bridge-image={{ .Values.manager.opampBridgeImage.repository }}:{{ .Values.manager.opampBridgeImage.tag }} | ||||||
|
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.
Let's move this and the above logic into a helper template so we don't have to do the same condition twice.
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.
Do you mean, something like this?
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 believe we can do something like:
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.
BTW, despite you are forcing the users to add a collector repository. I would add an if condition here so in case you remove the requirement in the future, it can avoid a bug if you forget to add the if condition here later.
Check it out: