Skip to content

Commit

Permalink
Graphviz does not like hyphens #patch (#141)
Browse files Browse the repository at this point in the history
* Cluster names cannot have `-` in them.

Signed-off-by: Ketan Umare <[email protected]>

* clusters with labels

Signed-off-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 authored Jul 9, 2021
1 parent dd369af commit fb6eb2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions flytectl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/flyteorg/flyteidl v0.19.8 h1:jWWIEnFMgJCZm/XK25Xts4+kQhoOrd5dWgLj/fLsbIg=
github.com/flyteorg/flyteidl v0.19.8/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
github.com/flyteorg/flyteidl v0.19.9 h1:1j4/YbV/G1m2hrK017F9K0JYZYxCCwf4qtEkiNnUiEw=
github.com/flyteorg/flyteidl v0.19.9/go.mod h1:576W2ViEyjTpT+kEVHAGbrTP3HARNUZ/eCwrNPmdx9U=
github.com/flyteorg/flytestdlib v0.3.13/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220=
Expand Down
10 changes: 6 additions & 4 deletions flytectl/pkg/visualize/graphviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ func (gb *graphBuilder) constructNode(parentGraphName string, prefix string, gra
}
gb.nodeClusters[name] = parentGraphName
case *core.Node_BranchNode:
branchSubGraphName := SubgraphPrefix + n.Metadata.Name
err := graph.AddSubGraph(parentGraphName, branchSubGraphName, nil)
sanitizedName := strings.ReplaceAll(n.Metadata.Name, "-", "_")
branchSubGraphName := SubgraphPrefix + sanitizedName
err := graph.AddSubGraph(parentGraphName, branchSubGraphName, map[string]string{LabelAttr: sanitizedName})
if err != nil {
return nil, err
}
Expand All @@ -247,8 +248,9 @@ func (gb *graphBuilder) constructNode(parentGraphName string, prefix string, gra
return nil, err
}
} else {
subGraphName := SubgraphPrefix + name
err := graph.AddSubGraph(parentGraphName, subGraphName, nil)
sanitizedName := strings.ReplaceAll(name, "-", "_")
subGraphName := SubgraphPrefix + sanitizedName
err := graph.AddSubGraph(parentGraphName, subGraphName, map[string]string{LabelAttr: sanitizedName})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit fb6eb2d

Please sign in to comment.