You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to remove ignoreRequest, otherwise we cannot do future action if pipeline deployment is removed as in #30.
We need to use err := r.client.Get(context.TODO(), types.NamespacedName{Name: req.Name}, res) to get the config cluster.
The text was updated successfully, but these errors were encountered:
houshengbo
changed the title
The scope of the config cluster should be narrowed down from cluster to namespaced
err := r.client.Get(context.TODO(), req.NamespacedName, res) will not get config cluster, since it is still cluster based
Aug 22, 2019
I want to explained more about the issue:
In our case, we watch two kinds of resource:
Config: cluster scope
Deployment: namespace scope and owner by Config
Notice, we watch Config by EnqueueRequestForObject and
watch Deployment by EnqueueRequestForOwner
that's means when any update on Config, Reconcile will receive request about cluster scope Config
and when Deployment update, Reconcile will receive request about namespace scopeConfig, that's not correct behavior, Reconcile should receive cluster scopeConfig, that's what exactly the bug talk about! the bug has already be fixed in Controller-runtime v0.2.0.*.
I am not sure if this is the bug with the client of controller-runtime, or it is a race condition in operator.
The config get function at
https://github.com/tektoncd/operator/blob/master/pkg/controller/config/config_controller.go#L166
will return NOT FOUND error, even if the CR was created with confirmation.
We need to remove ignoreRequest, otherwise we cannot do future action if pipeline deployment is removed as in #30.
We need to use err := r.client.Get(context.TODO(), types.NamespacedName{Name: req.Name}, res) to get the config cluster.
The text was updated successfully, but these errors were encountered: