Skip to content

Commit 1fb4271

Browse files
committed
implements ExistenceChecker intf for deployments and replicasets
1 parent 76c1143 commit 1fb4271

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

pkg/oc/cli/describe/projectstatus.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
304304
})...)
305305
}
306306
for _, standaloneDeployment := range standaloneDeployments {
307+
if !standaloneDeployment.Deployment.Found() {
308+
continue
309+
}
310+
307311
fmt.Fprintln(out)
308312
printLines(out, indent, 0, describeDeploymentInServiceGroup(f, standaloneDeployment, func(rs *kubegraph.ReplicaSetNode) int32 {
309313
return graphview.MaxRecentContainerRestartsForRS(g, rs)

pkg/oc/graph/kubegraph/nodes/nodes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func EnsureStatefulSetNode(g osgraph.MutableUniqueGraph, statefulSet *kapps.Stat
229229
node := osgraph.EnsureUnique(g,
230230
nodeName,
231231
func(node osgraph.Node) graph.Node {
232-
return &StatefulSetNode{node, statefulSet}
232+
return &StatefulSetNode{node, statefulSet, false}
233233
},
234234
).(*StatefulSetNode)
235235

pkg/oc/graph/kubegraph/nodes/types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ type DeploymentNode struct {
379379
IsFound bool
380380
}
381381

382+
func (n DeploymentNode) Found() bool {
383+
return n.IsFound
384+
}
385+
382386
func (n DeploymentNode) Object() interface{} {
383387
return n.Deployment
384388
}
@@ -430,6 +434,12 @@ func StatefulSetNodeName(o *kapps.StatefulSet) osgraph.UniqueName {
430434
type StatefulSetNode struct {
431435
osgraph.Node
432436
StatefulSet *kapps.StatefulSet
437+
438+
IsFound bool
439+
}
440+
441+
func (n StatefulSetNode) Found() bool {
442+
return n.IsFound
433443
}
434444

435445
func (n StatefulSetNode) Object() interface{} {

0 commit comments

Comments
 (0)