1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-17 07:48:52 +00:00

Normalize conditions

This commit is contained in:
Darren Shepherd
2020-09-22 13:46:46 -07:00
parent b26bbc6494
commit 09d79b238b
2 changed files with 13 additions and 5 deletions

View File

@@ -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)
}
}
}