Skip to content

Commit

Permalink
revert add controllerRef edge kind; use managedByController edge kind
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Oct 18, 2016
1 parent d75004e commit da1c400
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 6 additions & 7 deletions pkg/api/kubegraph/analysis/podspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
osgraph "github.com/openshift/origin/pkg/api/graph"
kubeedges "github.com/openshift/origin/pkg/api/kubegraph"
kubegraph "github.com/openshift/origin/pkg/api/kubegraph/nodes"
deploygraph "github.com/openshift/origin/pkg/deploy/graph"
"k8s.io/kubernetes/pkg/util/sets"
)

Expand Down Expand Up @@ -82,7 +81,7 @@ func FindMissingSecrets(g osgraph.Graph, f osgraph.Namer) []osgraph.Marker {
func FindMissingLivenessProbes(g osgraph.Graph, f osgraph.Namer, setProbeCommand string) []osgraph.Marker {
markers := []osgraph.Marker{}
appendedNodes := sets.NewString()
ignoredNodes := findControllerRefEdgeKinds(g)
ignoredNodes := findNodesManagedByController(g)

for _, uncastPodSpecNode := range g.NodesByKind(kubegraph.PodSpecNodeKind) {
podSpecNode := uncastPodSpecNode.(*kubegraph.PodSpecNode)
Expand Down Expand Up @@ -185,18 +184,18 @@ func CheckMissingMountedSecrets(g osgraph.Graph, podSpecNode *kubegraph.PodSpecN
return missingSecrets
}

func findControllerRefEdgeKinds(g osgraph.Graph) []graph.Node {
func findNodesManagedByController(g osgraph.Graph) []graph.Node {
nodeFilter := osgraph.NodesOfKind()
edgeFilter := osgraph.EdgesOfKind(deploygraph.ControllerRefEdgeKind)
edgeFilter := osgraph.EdgesOfKind(kubeedges.ManagedByControllerEdgeKind)

subGraph := g.Subgraph(nodeFilter, edgeFilter)
ignoredNodes := []graph.Node{}
managedNodes := []graph.Node{}

// ignore all nodes "controlled" by another node
for _, edge := range subGraph.Edges() {
ignoredNodes = append(ignoredNodes, edge.To())
managedNodes = append(managedNodes, edge.To())
}
return ignoredNodes
return managedNodes
}

func isNodeInList(node graph.Node, nodeList []graph.Node) bool {
Expand Down
3 changes: 0 additions & 3 deletions pkg/deploy/graph/edges.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const (
DeploymentEdgeKind = "Deployment"
// VolumeClaimEdgeKind goes from DeploymentConfigs to PersistentVolumeClaims indicating a request for persistent storage.
VolumeClaimEdgeKind = "VolumeClaim"
// ControllerRefEdgeKind goes from a controller node to its controlled child-node
ControllerRefEdgeKind = "ControllerRef"
)

// AddTriggerEdges creates edges that point to named Docker image repositories for each image used in the deployment.
Expand Down Expand Up @@ -75,7 +73,6 @@ func AddDeploymentEdges(g osgraph.MutableUniqueGraph, node *deploygraph.Deployme
}
if BelongsToDeploymentConfig(node.DeploymentConfig, rcNode.ReplicationController) {
g.AddEdge(node, rcNode, DeploymentEdgeKind)
g.AddEdge(node, rcNode, ControllerRefEdgeKind)
}
}
}
Expand Down

0 comments on commit da1c400

Please sign in to comment.