Skip to content

Commit

Permalink
implements ExistenceChecker intf for deployments and replicasets
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Feb 12, 2018
1 parent 76c1143 commit 1fb4271
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/oc/cli/describe/projectstatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ func (d *ProjectStatusDescriber) Describe(namespace, name string) (string, error
})...)
}
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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/oc/graph/kubegraph/nodes/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
10 changes: 10 additions & 0 deletions pkg/oc/graph/kubegraph/nodes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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{} {
Expand Down

0 comments on commit 1fb4271

Please sign in to comment.