-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Description
When user deletes a existing Custom Resource(CR) that the operator is watching, user expects a delete event for that CR to be delivered to the Handle(ctx types.Context, event types.Event) error
. However, that's not the case.
Steps to reproduce:
Change pkg/stub/handler.go
to print out received event:
func (h *Handler) Handle(ctx types.Context, event types.Event) error {
switch o := event.Object.(type) {
case *v1alpha1.App:
logrus.Printf("Name %v Deleted? %v", o.Name, event.Deleted)
}
return nil
}
Create a CR:
$ kubectl create -f deploy/cr.yaml
output:
$ kubectl logs -f app-operator-67c6b694-nh7l7
...
time="2018-04-04T23:15:12Z" level=info msg="Name example Deleted? false"
Delete a CR:
$ kubectl delete -f deploy/cr.yaml
Expect "Name example Deleted? true"
, but got none.
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.