Hi [~weil],
After give a better look in the example [https://github.com/integr8ly/keycloak-operator/blob/master/cmd/keycloak-operator/main.go#L66] I checked that the watches/client fetches instead of being implemented in each kind of controller as suggested in the operator-sdk docs and its getting started is implemented are all implemented in the main.go.
Note that the MSS-OPERATOR is justing fetching in the specific namespaces in the same way. See [here|https://github.com/aerogear/mobile-security-service-operator/blob/master/pkg/controller/mobilesecurityservice/fetches.go#L47] exactly in the same way . The following line is NOT the watch. It is a default setup of the manager as defined in its docs when it is cluster-scoped .
{code:java} // Create a new Cmd to provide shared dependencies and start components mgr, err := manager.New(cfg, manager.Options{Namespace: ""}) // TO WATCH ALL NAMESPACES {code}
{code:java} // Namespace if specified restricts the manager's cache to watch objects in the desired namespace // Defaults to all namespaces // Note: If a namespace is specified then controllers can still Watch for a cluster-scoped resource e.g Node // For namespaced resources the cache will only hold objects from the desired namespace. Namespace string {code}
*The only thing that we need here regards this point is changed to passing the namespace of the operator instead of "" since we do not need cache all since the requirement was changed at is namespace-scoped operator now*
c/c [~dffrench] [~lfitzgerald] |
|