Skip to content
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

Watch namespaces based on CR value #4

Conversation

sedroche
Copy link
Contributor

@sedroche sedroche commented Feb 4, 2019

Ticket: https://issues.jboss.org/browse/INTLY-796

This PR changes the Grafana operator to monitor namespaces based on a value retrieved from the CR instead of the hardcoded "monitoring=enabled" label.

Grafana CR now takes a labelSelector to filter monitored namespaces.

@sedroche sedroche force-pushed the INTLY-796-watch-namespaces-based-on-cr-selector branch from a3d8589 to 513ad1b Compare February 4, 2019 11:49
@pb82
Copy link
Collaborator

pb82 commented Feb 4, 2019

👀

selector := metav1.ListOptions{
LabelSelector: "monitoring=enabled",
LabelSelector: ss,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sedroche for readability, probably better to have something like selector and selectorString instead of s and ss

@sedroche sedroche force-pushed the INTLY-796-watch-namespaces-based-on-cr-selector branch from 513ad1b to 66882cc Compare February 4, 2019 11:57
Copy link
Collaborator

@pb82 pb82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on RHPDS. If you don't provide monitoringNamespaceSelector in the CR it will scan all namespaces which i think is ok.

@sedroche
Copy link
Contributor Author

sedroche commented Feb 4, 2019

@pb82 yep, empty matches everything. null matches nothing => https://github.com/integr8ly/grafana-operator/pull/4/files#diff-39459cd6e907cd9011fff8584e63b8eaR22

@sedroche sedroche merged commit 10f313b into grafana:master Feb 4, 2019
@sedroche sedroche deleted the INTLY-796-watch-namespaces-based-on-cr-selector branch February 4, 2019 12:21
@david-martin david-martin mentioned this pull request Apr 30, 2019
9 tasks
kd7lxl referenced this pull request in kd7lxl/grafana-operator Mar 11, 2021
* adding DB password reference to secret

* addresing PR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants