kuttl icon indicating copy to clipboard operation
kuttl copied to clipboard

Show content of unexpected resources

Open porridge opened this issue 3 years ago • 0 comments

What would you like to be added:

Just like kuttl shows a diff between expected and actual resource for assert.yaml files, it should show the content of the actual resource when an errors.yaml says that the resource should not exist (i.e. when the expected resource specifies just apiVersion, kind and metadata.name).

Why is this needed:

Currently all that is printed is:

    case.go:363: resource matched of kind: authorization.openshift.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: authorization.openshift.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: authorization.openshift.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: rbac.authorization.k8s.io/v1, Kind=ClusterRole
    case.go:363: resource matched of kind: /v1, Kind=ConfigMap

Which is not terribly useful - in order to investigate the cause for unexpected existence of a resource I'd like to see its metadata (to see owner references for example) and status (which might show details of why it was not deleted).

FTR, this the place where the message is emitted.

porridge avatar May 17 '22 12:05 porridge