Kong / gateway-operator

Kubernetes Operator for Kong Gateways
Apache License 2.0
51 stars 14 forks source link

When a target of an unmanaged `KongPluginBinding` is deleted, the `KongPluginBinding` is deleted without logs mentioning that #786

Open randmonkey opened 3 hours ago

randmonkey commented 3 hours ago

Current Behavior

When I create a KongPluginBinding and delete one of the entities in its targets, for example:

apiVersion: configuration.konghq.com/v1alpha1
kind: KongPluginBinding
metadata:
  name: plugin-binding-kongservice
spec:
  controlPlaneRef:
    type: konnectNamespacedRef
    konnectNamespacedRef:
      name: test1
  pluginRef:
    name: rate-limit-5-min
  targets:
    serviceRef:
      name: service-1
      kind: KongService
      group: configuration.konghq.com
    consumerRef:
      name: consumer-1

When I delete the KongConsumer, the consumer gets deleted in Konnect as well as the plugin. After a Reconciliation Error telling that failed to update the plugin in Konnect because the plugin's foreign entity is not found, the KongPluginBinding is also deleted without a log to mention this.

Expected Behavior

Steps To Reproduce

Operator Version

kubectl version

czeslavo commented 3 hours ago

I'd say the expected behavior here is to populate conditions - removing an unmanaged resource is not something users will expect.