Remove redundant kubernetes ID

This commit is contained in:
Alfonso Acosta
2016-08-10 16:01:28 +00:00
parent d06547e596
commit 166bdf13f3
6 changed files with 8 additions and 26 deletions

View File

@@ -330,7 +330,6 @@ func TestMakeDetailedPodNode(t *testing.T) {
Linkable: true,
Pseudo: false,
Metadata: []report.MetadataRow{
{ID: "kubernetes_id", Label: "ID", Value: "ping/pong-b", Priority: 1},
{ID: "kubernetes_state", Label: "State", Value: "running", Priority: 2},
{ID: "container", Label: "# Containers", Value: "1", Priority: 4, Datatype: "number"},
{ID: "kubernetes_namespace", Label: "Namespace", Value: "ping", Priority: 5},

View File

@@ -243,8 +243,8 @@ func containerImageNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bo
func podNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
base.Label, _ = n.Latest.Lookup(kubernetes.Name)
base.Rank, _ = n.Latest.Lookup(kubernetes.ID)
namespace, _ := n.Latest.Lookup(kubernetes.Namespace)
base.Rank = namespace + "/" + base.Label
if c, ok := n.Counters.Lookup(report.Container); ok {
if c == 1 {
base.LabelMinor = fmt.Sprintf("%d container", c)
@@ -258,7 +258,8 @@ func podNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
func serviceNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
base.Label, _ = n.Latest.Lookup(kubernetes.Name)
base.Rank, _ = n.Latest.Lookup(kubernetes.ID)
namespace, _ := n.Latest.Lookup(kubernetes.Namespace)
base.Rank = namespace + "/" + base.Label
base.Stack = true
// Services are always just a group of pods, so there's no counting multiple
@@ -276,7 +277,8 @@ func serviceNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
func deploymentNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
base.Label, _ = n.Latest.Lookup(kubernetes.Name)
base.Rank, _ = n.Latest.Lookup(kubernetes.ID)
namespace, _ := n.Latest.Lookup(kubernetes.Namespace)
base.Rank = namespace + "/" + base.Label
base.Stack = true
if p, ok := n.Counters.Lookup(report.Pod); ok {
@@ -292,7 +294,8 @@ func deploymentNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool)
func replicaSetNodeSummary(base NodeSummary, n report.Node) (NodeSummary, bool) {
base.Label, _ = n.Latest.Lookup(kubernetes.Name)
base.Rank, _ = n.Latest.Lookup(kubernetes.ID)
namespace, _ := n.Latest.Lookup(kubernetes.Namespace)
base.Rank = namespace + "/" + base.Label
base.Stack = true
if p, ok := n.Counters.Lookup(report.Pod); ok {