Skip to content

Commit

Permalink
Merge watchLabelSelectors with model.CommonLabels
Browse files Browse the repository at this point in the history
Signed-off-by: Wilfried Roset <[email protected]>
  • Loading branch information
wilfriedroset committed Jan 30, 2025
1 parent 698a279 commit b99fe16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import (
// to ensure that exec-entrypoint and run can make use of them.
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/grafana/grafana-operator/v5/controllers/model"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -339,5 +340,7 @@ func getLabelSelectors(watchLabelSelectors string) (labels.Selector, error) {
} else {
labelSelectors = labels.Everything() // Match any labels
}
managedByLabelSelector, _ := labels.SelectorFromSet(model.CommonLabels).Requirements()
labelSelectors.Add(managedByLabelSelector...)
return labelSelectors, nil
}

0 comments on commit b99fe16

Please sign in to comment.