dump failed objects to aid in debugging
@@ -26,6 +26,7 @@ import (
"knative.dev/eventing/test/lib/duck"
"knative.dev/eventing/test/lib/resources"
+ duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1"
)
// LabelNamespace labels the given namespace with the labels map.
@@ -63,6 +64,13 @@ func (c *Client) WaitForResourceReadyOrFail(name string, typemeta *metav1.TypeMe
namespace := c.Namespace
metaResource := resources.NewMetaResource(name, namespace, typemeta)
if err := duck.WaitForResourceReady(c.Dynamic, metaResource); err != nil {
+ untyped, err := duck.GetGenericObject(c.Dynamic, metaResource, &duckv1beta1.KResource{})
+ if err != nil {
+ c.T.Errorf("Failed to get the object %v-%s when dumping error state: %v", *typemeta, name, err)
+ }
+ if untyped != nil {
+ c.T.Errorf("Object that did not become ready %v-%s when dumping error state: %+v", *typemeta, name, untyped)
+ }
c.T.Fatalf("Failed to get %v-%s ready: %+v", *typemeta, name, errors.WithStack(err))
}
}
