Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/prometheus-operator]Moving out PrometheusSpec.portName from range loop to Global Scope. #20495

Conversation

sc2borges
Copy link
Contributor

@sc2borges sc2borges commented Feb 3, 2020

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

NOTE: We're experiencing a high volume of PRs to this repo and reviews will be delayed. Please host your own chart repository and submit your repository to the Helm Hub instead of this repo to make them discoverable to the community. Here is how to submit new chart repositories to the Helm Hub.

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.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/mychartname])

…al Scope and Chart Version

Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 3, 2020
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 3, 2020
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@bismarck
Copy link
Contributor

bismarck commented Feb 3, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 3, 2020
@@ -31,7 +32,7 @@ items:
{{- end }}
{{- end }}
ports:
- name: {{ .Values.prometheus.prometheusSpec.portName }}
- name: {{ $portName }}
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@helm-bot helm-bot removed the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 3, 2020
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch 3 times, most recently from b96e47d to 6d264d0 Compare February 4, 2020 03:43
@helm-bot helm-bot added Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 4, 2020
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from 6d264d0 to 0c75f99 Compare February 4, 2020 03:51
@helm-bot helm-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 4, 2020
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from 0c75f99 to d87c097 Compare February 4, 2020 03:53
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 4, 2020
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from d87c097 to 54d91b7 Compare February 4, 2020 03:54
sc2borges and others added 2 commits February 4, 2020 14:55
@bismarck
Copy link
Contributor

bismarck commented Feb 4, 2020

/retest

Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
@sc2borges
Copy link
Contributor Author

sc2borges commented Feb 4, 2020

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.
Similar issue occurs with #20545

@sc2borges
Copy link
Contributor Author

/retest

1 similar comment
@sc2borges
Copy link
Contributor Author

/retest

@vsliouniaev
Copy link
Collaborator

/lgtm
/retest

@k8s-ci-robot k8s-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 20, 2020
@k8s-ci-robot k8s-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Feb 20, 2020
@vsliouniaev
Copy link
Collaborator

I0220 23:19:51.600] ✖︎ prometheus-operator => (version: "8.9.0", path: "stable/prometheus-operator") > Chart version not ok. Needs a version bump!

@helm-bot helm-bot removed the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 21, 2020
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from d25e036 to a0ba9ab Compare February 21, 2020 11:01
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 21, 2020
@sc2borges
Copy link
Contributor Author

/cc vsliouniaev

@vsliouniaev
Copy link
Collaborator

vsliouniaev commented Feb 21, 2020

@helm-bot helm-bot removed the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 21, 2020
@sc2borges
Copy link
Contributor Author

/retest

@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from 96f4ac0 to 48393da Compare February 21, 2020 22:58
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Feb 21, 2020
Signed-off-by: Sergio Borges <sergio.borges@safetyculture.io>
@sc2borges sc2borges force-pushed the Fixing-PrometheusSpec.portName-from-range-loop-to-Global-Scope- branch from 48393da to e19be91 Compare February 21, 2020 23:02
@sc2borges
Copy link
Contributor Author

/cc vsliouniaev

@vsliouniaev
Copy link
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 22, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 880fa53 into helm:master Feb 22, 2020
irlevesque pushed a commit to quantopian/charts that referenced this pull request Jul 13, 2020
…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>
li-adrienloiseau pushed a commit to li-adrienloiseau/charts that referenced this pull request Jul 29, 2020
…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>
mmingorance-dh pushed a commit to mmingorance-dh/charts that referenced this pull request Aug 28, 2020
…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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). lgtm Indicates that a PR is ready to be merged. ok-to-test size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants