Describe the bug
When a Subscription is not in a Ready status (e.g Reason: ChannelReferenceFailed, SubscriberResolveFailed) ,
kubectl delete subscription {subscription name} just hangs there after subscription.messaging.knative.dev "subscription name" deleted message printed. The subscription still exist.
Expected behavior
A Subscription should be able to be deleted even if the referenced resources don't exist.
To Reproduce
kubectl apply:
apiVersion: messaging.knative.dev/v1
kind: Subscription
metadata:
namespace: parallel-demo
name: even-filter-subscription
spec:
channel:
apiVersion: messaging.knative.dev/v1alpha1
kind: Channel
name: even-filter-channel
subscriber:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: even-filter
Story:
admission webhook "validation.webhook.eventing.knative.dev" denied the request: validation failed: Immutable fields changed (-old +new): spec
{v1.SubscriptionSpec}.Channel.Kind:
-: "Channel"
+: "InMemoryChannel"
{v1.SubscriptionSpec}.Channel.APIVersion:
-: "messaging.knative.dev/v1alpha1"
+: "messaging.knative.dev/v1"
I decide to delete this subscription and create a new one but I just hung there after kubectl delete command.
Knative release version
0.21.0
Additional context
Is there any work around before this issue is solved to delete the subscription?
Is there any work around before this issue is solved to delete the subscription?
Judging from the issue description, I guess something is broken in the finalizer... I think you can force the removal of the subscription removing the finalizer. This guide explains how to do that for a namespace, but you can apply the same guide to the broken subscription: https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e
Can you post the log of eventing-controller? it might help us to diagnose and fix the issue
Can you post the log of eventing-controller? it might help us to diagnose and fix the issue
@slinkydeveloper Do you mean the log when I try to delete the Subscription? I don't see any new log generated in eventing-controller pod after kubectl delete. (only warnings.go:67] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition after a few minutes which doesn't look relative to it)