TykTechnologies/tyk-operator

[TT-5482] Tyk Operator ignores "-f" during reconciliation infinite loops

sedkis opened this issue · 1 comments

As a developer, if I pass the -f flag to kubectl command to delete a resource, I expect it to delete the resource. However, the Tyk Operator hangs infinitely during the reconciliation loop.

Recreate Steps

As a developer, if I (accidentally) delete an API/Policy in the Dashboard that was created through the Operator, and then I try to delete the

IE, when I try to modify the resource through Operator, it hangs forever because the Dashboard resource does not exist.

Expected Behavior

If I pass the --force command to the kubectl delete, the Operator should respect that.

Possible Solution

Here, we should skip the reconciliation process if the -f / --force command is passed in from kubectl in addition to the current check that looks for a finalizer
https://github.com/TykTechnologies/tyk-operator/blob/master/controllers/apidefinition_controller.go#L482

Alternatively, maybe we could check if the API does not exist on Dashboard, then treat it as deleted?