Skip to content

Commit 2844101

Browse files
author
Scott Nichols
committed
colors work.
1 parent dff56a4 commit 2844101

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

hack/update-codegen.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ ${CODEGEN_PKG}/generate-groups.sh "deepcopy" \
1212
"duck:v1alpha1"
1313

1414
# Make sure our dependencies are up-to-date
15-
${REPO_ROOT_DIR}/hack/update-deps.sh
15+
./hack/update-deps.sh

pkg/apis/duck/v1alpha1/source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ type SourceType struct {
1616
}
1717

1818
type SourceStatus struct {
19-
duckv1beta1.Status `json:"inline,"`
19+
duckv1beta1.Status `json:",inline,"`
2020
SinkURI *string `json:"sinkUri,omitempty"`
2121
}

pkg/graph/graph.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ type Graph struct {
2828

2929
func New(ns string) *Graph {
3030
g := dot.NewGraph("G")
31+
_ = g.Set("tooltip", "Graph View")
3132
_ = g.Set("shape", "box")
3233
_ = g.Set("label", "Triggers in "+ns)
3334
_ = g.Set("rankdir", "LR")
35+
3436
//_ = g.Set("compound", "true")
3537

3638
graph := &Graph{
@@ -360,8 +362,17 @@ func setNodeShapeForKind(node *dot.Node, kind, apiVersion string) {
360362

361363
func setNodeColorForStatus(node *dot.Node, status duckv1beta1.Status) {
362364
cond := status.GetCondition(apis.ConditionReady)
365+
_ = node.Set("fillcolor", "white")
366+
_ = node.Set("style", "filled")
363367
if cond.IsTrue() {
364-
_ = node.Set("color", "darkgreen")
368+
_ = node.Set("color", "black")
369+
_ = node.Set("tooltip", fmt.Sprintf("Ready as of %s", cond.LastTransitionTime.Inner.String()))
370+
} else if cond.IsUnknown() {
371+
_ = node.Set("color", "goldenrod")
372+
_ = node.Set("tooltip", fmt.Sprintf("[%s] %s: %s", cond.Status, cond.Reason, cond.Message))
373+
} else if cond.IsFalse() {
374+
_ = node.Set("color", "deeppink")
375+
_ = node.Set("tooltip", fmt.Sprintf("[%s] %s: %s", cond.Status, cond.Reason, cond.Message))
365376
}
366377
}
367378

0 commit comments

Comments
 (0)