diff --git a/pkg/resources/common/formatter.go b/pkg/resources/common/formatter.go index 39c7aef..201a1db 100644 --- a/pkg/resources/common/formatter.go +++ b/pkg/resources/common/formatter.go @@ -9,6 +9,7 @@ import ( "github.com/rancher/steve/pkg/stores/proxy" "github.com/rancher/steve/pkg/summarycache" "github.com/rancher/wrangler/pkg/data" + "github.com/rancher/wrangler/pkg/summary" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) @@ -42,14 +43,16 @@ func formatter(summarycache *summarycache.SummaryCache) types.Formatter { } if unstr, ok := resource.APIObject.Object.(*unstructured.Unstructured); ok { - summary, rel := summarycache.SummaryAndRelationship(unstr) + s, rel := summarycache.SummaryAndRelationship(unstr) data.PutValue(unstr.Object, map[string]interface{}{ - "name": summary.State, - "error": summary.Error, - "transitioning": summary.Transitioning, - "message": strings.Join(summary.Message, ":"), + "name": s.State, + "error": s.Error, + "transitioning": s.Transitioning, + "message": strings.Join(s.Message, ":"), }, "metadata", "state") data.PutValue(unstr.Object, rel, "metadata", "relationships") + + summary.NormalizeConditions(unstr) } } } diff --git a/pkg/schema/collection.go b/pkg/schema/collection.go index df9b713..8100ebe 100644 --- a/pkg/schema/collection.go +++ b/pkg/schema/collection.go @@ -10,6 +10,7 @@ import ( "github.com/rancher/apiserver/pkg/types" "github.com/rancher/steve/pkg/accesscontrol" "github.com/rancher/steve/pkg/attributes" + "github.com/rancher/steve/pkg/schema/converter" "github.com/rancher/wrangler/pkg/name" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/runtime/schema" @@ -218,6 +219,10 @@ func (c *Collection) AddTemplate(templates ...Template) { for i, template := range templates { if template.Kind != "" { c.templates[template.Group+"/"+template.Kind] = &templates[i] + c.templates[converter.GVKToSchemaID(schema.GroupVersionKind{ + Group: template.Group, + Kind: template.Kind, + })] = &templates[i] } if template.ID != "" { c.templates[template.ID] = &templates[i]