Skip to content

Commit

Permalink
Merge pull request #1235 from sanchezl/graph_readable
Browse files Browse the repository at this point in the history
docs: rebuild dependency graph
  • Loading branch information
openshift-merge-robot authored Feb 13, 2019
2 parents 17c0fa8 + e6a2029 commit e148f64
Show file tree
Hide file tree
Showing 2 changed files with 752 additions and 752 deletions.
13 changes: 13 additions & 0 deletions cmd/openshift-install/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io"
"os"
"reflect"
"regexp"

"github.com/awalterschulze/gographviz"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -49,6 +50,18 @@ func runGraphCmd(cmd *cobra.Command, args []string) error {
}
}

g.AddAttr("G", "rankdir", "LR")
r := regexp.MustCompile(`[. ]`)
for _, node := range g.Nodes.Nodes {
cluster := r.Split(node.Name, -1)[0][1:]
subgraphName := "cluster_" + cluster
_, ok := g.SubGraphs.SubGraphs[subgraphName]
if !ok {
g.AddSubGraph("G", subgraphName, map[string]string{"label": cluster})
}
g.AddNode(subgraphName, node.Name, nil)
}

out := os.Stdout
if graphOpts.outputFile != "" {
f, err := os.Create(graphOpts.outputFile)
Expand Down
Loading

0 comments on commit e148f64

Please sign in to comment.