| Comment: |
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 are all implemented in the main.go.
Note that the MSS-OPERATOR is justing fetching in the specific namespaces. It will just fetch in the operator namespace and in the namespace where the app is applied/bind. See [here|https://github.com/aerogear/mobile-security-service-operator/blob/master/pkg/controller/mobilesecurityservice/fetches.go#L47].
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}
*I understand that the only thing that we need to do here regards this point is to change the scope of the operator from cluster to namespaced which will also change the above code and pass the namespace as an argument.*
c/c [~dffrench] [~lfitzgerald] |