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

[stable/prometheus-operator] allow empty ruleSelector and ruleNamespa… #11395

Merged
merged 2 commits into from Feb 18, 2019
Merged

[stable/prometheus-operator] allow empty ruleSelector and ruleNamespa… #11395

merged 2 commits into from Feb 18, 2019

Conversation

ghost
Copy link

@ghost ghost commented Feb 13, 2019

…ceSelector

Currently an empty ruleSelector or ruleNamespaceSelector does not select
all PrometheusRules or Namespaces respectively. Fix the prometheus
template to allow empty ruleSelector and ruleNamespaceSelector.

What this PR does / why we need it:

Currently an empty ruleSelector or ruleNamespaceSelector does not select
all PrometheusRules or Namespaces respectively. Fix the prometheus
template to allow empty ruleSelector and ruleNamespaceSelector.

Special notes for your reviewer:

@gianrubio By default all ServiceMonitors and PrometheusRules in all namespaces will be selected.

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

…ceSelector

Currently an empty ruleSelector or ruleNamespaceSelector does not select
all PrometheusRules or Namespaces respectively. Fix the prometheus
template to allow empty ruleSelector and ruleNamespaceSelector.

Signed-off-by: Nick Troast <ntroast@gmail.com>
@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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 13, 2019
@ghost
Copy link
Author

ghost commented Feb 13, 2019

/assign @gianrubio

@vsliouniaev
Copy link
Collaborator

@ntroast The guidelines specify that charts should select their own resources by default, and from what you are saying this chart breaks this requirement : https://github.com/helm/charts/blob/master/REVIEW_GUIDELINES.md#deployments-statefulsets-daemonsets-selectors

@ghost
Copy link
Author

ghost commented Feb 15, 2019

@vsliouniaev Sorry, I should have been more clear. By default ruleSelectorNilUsesHelmValues and serviceMonitorSelectorNilUsesHelmValues are true. This will add a selector to select based on labels just like before. When these values are false then all will be selected in all namespaces. Therefore, this meets the selectors requirement.

@helm-bot helm-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 15, 2019
@gianrubio
Copy link
Collaborator

/ok-to-test
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gianrubio, ntroast

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 added approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Feb 18, 2019
@vsliouniaev
Copy link
Collaborator

Your changes to the description of the behaviour of the namespace selector don't correspond to what is described in the API for prometheus operator. https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#namespaceselector

Also, pretty certain that the behaviour of nil and {} is equivalent and cannot be distinguished by Helm templating

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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants