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
Due to a different problem that I have to figure out, I noticed the following possibly wrong behavior of the sdk ...
I apply the custom resource handled by my controller and the handleDispatch reaches the point where a finalizer is applied to the resource itself. At that point an exception happens (in my case a 404 NOT FOUND) and the handleExecution of the dispatcher is executed and the execution ends (without calling the createOrUpdateResource of my controller which is ok).
AFAIK the operator sdk has a retry logic so the event is handled again but at this point in the handleCreateOrUpdate the ControllerUtils.hasGivenFinalizer return true because the resource (is it in a cache of the operator sdk?) has the finalizer in the metadata even if the corresponding apply in the previous step was failed against the Kubernetes cluster.
Due to the fact that the finalizer is there, the operator sdk goes ahead handling the event calling the createOrUpdateResource of the controller.
I guess it's wrong, because applying the finalizer didn't end well actually due to a problem that could be of any type and could happen even in the controller.
The text was updated successfully, but these errors were encountered:
@ppatierno@metacosm I will take a look into this too. To be honest did not had this on mind when implementing this part, thus the scenario when adding a finalizer would fail.
Due to a different problem that I have to figure out, I noticed the following possibly wrong behavior of the sdk ...
I apply the custom resource handled by my controller and the
handleDispatch
reaches the point where a finalizer is applied to the resource itself. At that point an exception happens (in my case a 404 NOT FOUND) and thehandleExecution
of the dispatcher is executed and the execution ends (without calling thecreateOrUpdateResource
of my controller which is ok).AFAIK the operator sdk has a retry logic so the event is handled again but at this point in the
handleCreateOrUpdate
theControllerUtils.hasGivenFinalizer
return true because the resource (is it in a cache of the operator sdk?) has the finalizer in the metadata even if the corresponding apply in the previous step was failed against the Kubernetes cluster.Due to the fact that the finalizer is there, the operator sdk goes ahead handling the event calling the
createOrUpdateResource
of the controller.I guess it's wrong, because applying the finalizer didn't end well actually due to a problem that could be of any type and could happen even in the controller.
The text was updated successfully, but these errors were encountered: