Skip to content

Commit

Permalink
Include phase strategy in plan status output
Browse files Browse the repository at this point in the history
Phase strategy can be defined independently of that for a plan, so this
commit includes this in the output so that the Operator behaviour is
less confusing to the user.
  • Loading branch information
yankcrime committed Dec 13, 2019
1 parent b40e01e commit 1ac1ffc
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pkg/kudoctl/cmd/plan/plan_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ func status(kc *kudo.Client, options *Options, ns string) error {
if name == lastPlanStatus.Name {
planDisplay := fmt.Sprintf("Plan %s (%s strategy) [%s]%s", name, plan.Strategy, lastPlanStatus.Status, printMessageIfAvailable(lastPlanStatus.Message))
planBranchName := rootBranchName.AddBranch(planDisplay)
for _, phase := range lastPlanStatus.Phases {
phaseDisplay := fmt.Sprintf("Phase %s [%s]%s", phase.Name, phase.Status, printMessageIfAvailable(phase.Message))
for i, phase := range lastPlanStatus.Phases {
phaseDisplay := fmt.Sprintf("Phase %s (%s strategy) [%s]%s", phase.Name, plan.Phases[i].Strategy, phase.Status, printMessageIfAvailable(phase.Message))
phaseBranchName := planBranchName.AddBranch(phaseDisplay)
for _, steps := range phase.Steps {
stepsDisplay := fmt.Sprintf("Step %s [%s]%s", steps.Name, steps.Status, printMessageIfAvailable(steps.Message))
Expand All @@ -69,13 +69,9 @@ func status(kc *kudo.Client, options *Options, ns string) error {
for _, phase := range plan.Phases {
phaseDisplay := fmt.Sprintf("Phase %s (%s strategy) [NOT ACTIVE]", phase.Name, phase.Strategy)
phaseBranchName := planBranchName.AddBranch(phaseDisplay)
for _, steps := range plan.Phases {
stepsDisplay := fmt.Sprintf("Step %s (%s strategy) [NOT ACTIVE]", steps.Name, steps.Strategy)
stepBranchName := phaseBranchName.AddBranch(stepsDisplay)
for _, step := range steps.Steps {
stepDisplay := fmt.Sprintf("%s [NOT ACTIVE]", step.Name)
stepBranchName.AddBranch(stepDisplay)
}
for _, steps := range phase.Steps {
stepDisplay := fmt.Sprintf("Step %s [NOT ACTIVE]", steps.Name)
phaseBranchName.AddBranch(stepDisplay)
}
}
}
Expand Down

0 comments on commit 1ac1ffc

Please sign in to comment.