-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/prometheus-operator]Moving out PrometheusSpec.portName from range loop to Global Scope. #20495
[stable/prometheus-operator]Moving out PrometheusSpec.portName from range loop to Global Scope. #20495
Conversation
…al Scope and Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
Hi @sc2borges. Thanks for your PR. I'm waiting for a helm member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@@ -31,7 +32,7 @@ items: | |||
{{- end }} | |||
{{- end }} | |||
ports: | |||
- name: {{ .Values.prometheus.prometheusSpec.portName }} | |||
- name: {{ $portName }} |
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.
There's actually a simpler way to fix this without introducing a variable: $.Values.prometheus.prometheusSpec.portName
According to the Helm docs:
However, there is one variable that is always global - $ - this variable will always point to the root context. This can be very useful when you are looping in a range need to know the chart’s release 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.
Following your suggestion, I've changed the variable field to use the $ global scope context.
b96e47d
to
6d264d0
Compare
6d264d0
to
0c75f99
Compare
0c75f99
to
d87c097
Compare
d87c097
to
54d91b7
Compare
…loop-to-Global-Scope-
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
/retest |
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
Looks like the error happens when the cluster is trying to destroy the test pod, I don't see any errors related to the chart. |
/retest |
1 similar comment
/retest |
/lgtm |
…loop-to-Global-Scope-
|
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
d25e036
to
a0ba9ab
Compare
/cc vsliouniaev |
/retest |
96f4ac0
to
48393da
Compare
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
48393da
to
e19be91
Compare
…loop-to-Global-Scope-
/cc vsliouniaev |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sc2borges, vsliouniaev The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…ange loop to Global Scope. (helm#20495) * Update Prometheus-operator for accept prometheusSpec.portName to Global Scope and Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Changing the variable field to use the global $ scope context Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Update the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bumps the Chart version to 8.9.1 Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bump the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
…ange loop to Global Scope. (helm#20495) * Update Prometheus-operator for accept prometheusSpec.portName to Global Scope and Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Changing the variable field to use the global $ scope context Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Update the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bumps the Chart version to 8.9.1 Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bump the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> Signed-off-by: Adrien Loiseau <adrien.loiseau@logic-immo.com>
…ange loop to Global Scope. (helm#20495) * Update Prometheus-operator for accept prometheusSpec.portName to Global Scope and Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Changing the variable field to use the global $ scope context Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Update the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bumps the Chart version to 8.9.1 Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> * Bump the Chart Version Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io> Signed-off-by: Miguel Mingorance <miguel.mingorance@deliveryhero.com>
Update Prometheus-operator for accepting prometheusSpec.portName to Global Scope and Chart Version
Signed-off-by: Sergio Borges sergio.borges@safetyculture.io
Is this a new chart
What this PR does / why we need it:
*Running within the range loop the variable value can't be accessed.
*Putting the portName as Global scope makes easier to have access on it.
Which issue this PR fixes
(optional, in fixes #(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
fixes #18948
Special notes for your reviewer:
Checklist
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
[stable/mychartname]
)