Skip to content

Commit 97a72c2

Browse files
committed
[core][coconut] Display consolidated variable stack in role query
1 parent 1b695a2 commit 97a72c2

5 files changed

Lines changed: 204 additions & 157 deletions

File tree

coconut/control/control.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,21 +626,25 @@ func QueryRoles(cxt context.Context, rpc *coconut.RpcClient, cmd *cobra.Command,
626626
defaultsStr = stringMapToString(root.Defaults, "\t")
627627
varsStr = stringMapToString(root.Vars, "\t")
628628
userVarsStr = stringMapToString(root.UserVars, "\t")
629+
consolidatedStr = stringMapToString(root.ConsolidatedStack, "\t")
629630
)
630631

631632
_, _ = fmt.Fprintf(o, "(%s)\n", yellow(i))
632633
_, _ = fmt.Fprintf(o, "role path: %s\n", root.GetFullPath())
633634
_, _ = fmt.Fprintf(o, "status: %s\n", root.GetStatus())
634635
_, _ = fmt.Fprintf(o, "state: %s\n", root.GetState())
635636
if len(defaultsStr) != 0 {
636-
_, _ = fmt.Fprintf(o, "defaults:\n%s\n", defaultsStr)
637+
_, _ = fmt.Fprintf(o, "role defaults:\n%s\n", defaultsStr)
637638
}
638639
if len(varsStr) != 0 {
639-
_, _ = fmt.Fprintf(o, "variables:\n%s\n", varsStr)
640+
_, _ = fmt.Fprintf(o, "role variables:\n%s\n", varsStr)
640641
}
641642
if len(userVarsStr) != 0 {
642643
_, _ = fmt.Fprintf(o, "user-provided variables:\n%s\n", userVarsStr)
643644
}
645+
if len(consolidatedStr) != 0 {
646+
_, _ = fmt.Fprintf(o, "consolidated stack:\n%s\n", consolidatedStr)
647+
}
644648
_, _ = fmt.Fprintf(o, "subtree:\n")
645649
drawWorkflow(root, o)
646650
}

coconut/protos/o2control.pb.go

Lines changed: 93 additions & 73 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)