diff --git a/pkg/oc/cli/describe/projectstatus.go b/pkg/oc/cli/describe/projectstatus.go index 3f5979682d45..b173d523496e 100644 --- a/pkg/oc/cli/describe/projectstatus.go +++ b/pkg/oc/cli/describe/projectstatus.go @@ -298,12 +298,20 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error } for _, standaloneDC := range standaloneDCs { + if !standaloneDC.DeploymentConfig.Found() { + continue + } + fmt.Fprintln(out) printLines(out, indent, 0, describeDeploymentConfigInServiceGroup(f, standaloneDC, func(rc *kubegraph.ReplicationControllerNode) int32 { return graphview.MaxRecentContainerRestartsForRC(g, rc) })...) } for _, standaloneDeployment := range standaloneDeployments { + if !standaloneDeployment.Deployment.Found() { + continue + } + fmt.Fprintln(out) printLines(out, indent, 0, describeDeploymentInServiceGroup(f, standaloneDeployment, func(rs *kubegraph.ReplicaSetNode) int32 { return graphview.MaxRecentContainerRestartsForRS(g, rs) @@ -318,11 +326,19 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error } for _, standaloneRC := range standaloneRCs { + if !standaloneRC.RC.Found() { + continue + } + fmt.Fprintln(out) printLines(out, indent, 0, describeRCInServiceGroup(f, standaloneRC.RC)...) } for _, standaloneRS := range standaloneRSs { + if !standaloneRS.RS.Found() { + continue + } + fmt.Fprintln(out) printLines(out, indent, 0, describeRSInServiceGroup(f, standaloneRS.RS)...) } diff --git a/pkg/oc/graph/kubegraph/nodes/nodes.go b/pkg/oc/graph/kubegraph/nodes/nodes.go index d17742b44237..03be6b246e6c 100644 --- a/pkg/oc/graph/kubegraph/nodes/nodes.go +++ b/pkg/oc/graph/kubegraph/nodes/nodes.go @@ -229,7 +229,7 @@ func EnsureStatefulSetNode(g osgraph.MutableUniqueGraph, statefulSet *kapps.Stat node := osgraph.EnsureUnique(g, nodeName, func(node osgraph.Node) graph.Node { - return &StatefulSetNode{node, statefulSet} + return &StatefulSetNode{node, statefulSet, false} }, ).(*StatefulSetNode) diff --git a/pkg/oc/graph/kubegraph/nodes/types.go b/pkg/oc/graph/kubegraph/nodes/types.go index a5c843508732..f69e9b0e0729 100644 --- a/pkg/oc/graph/kubegraph/nodes/types.go +++ b/pkg/oc/graph/kubegraph/nodes/types.go @@ -379,6 +379,10 @@ type DeploymentNode struct { IsFound bool } +func (n DeploymentNode) Found() bool { + return n.IsFound +} + func (n DeploymentNode) Object() interface{} { return n.Deployment } @@ -430,6 +434,12 @@ func StatefulSetNodeName(o *kapps.StatefulSet) osgraph.UniqueName { type StatefulSetNode struct { osgraph.Node StatefulSet *kapps.StatefulSet + + IsFound bool +} + +func (n StatefulSetNode) Found() bool { + return n.IsFound } func (n StatefulSetNode) Object() interface{} {