INNER CODE UNIT · Go

getNamespaceConfig

grafana/grafana-operator · main.go:495

func getNamespaceConfig(namespaces string, labelSelectors labels.Selector) map[string]cache.Config {
	defaultNamespaces := map[string]cache.Config{}
	for v := range strings.SplitSeq(namespaces, ",") {
		// Generate a mapping of namespaces to label/field selectors, set to Everything() to enable matching all
		// instances in all namespaces from operatorConfig.WatchNamespace to be controlled by the operator
		// this is the default behavior of the operator on v5, if you require finer grained control over this
		// please file an issue in the grafana-operator/grafana-operator GH project
		defaultNamespaces[v] = cache.Config{
			LabelSelector:         labelSelectors,
			FieldSelector:         fields.Everything(), // Match any fields
			Transform:             nil,
			UnsafeDisableDeepCopy: nil,
		}
	}

	return defaultNamespaces
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…