Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

feat: enable pretty output #16

Merged
merged 8 commits into from
Sep 14, 2021
Prev Previous commit
Next Next commit
fix: humanwriter does not print result.Details (and probably should n…
…ot?)
  • Loading branch information
johnstcn committed Sep 13, 2021
commit 62786bd019c8048aa9caa98cfecbf9dda1537ce7
28 changes: 20 additions & 8 deletions internal/cmd/check/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,27 @@ func run(cmd *cobra.Command, _ []string) error {
)

_ = hw.WriteResult(&api.CheckResult{
Name: "kubernetes config",
Name: "kubernetes current-context",
State: api.StateInfo,
Summary: "using the following context to talk to kubernetes",
Details: map[string]interface{}{
"context": rawConfig.CurrentContext,
"cluster": currentContext.Cluster,
"namespace": currentContext.Namespace,
"authinfo": currentContext.AuthInfo,
},
Summary: rawConfig.CurrentContext,
})

_ = hw.WriteResult(&api.CheckResult{
Name: "kubernetes cluster",
State: api.StateInfo,
Summary: currentContext.Cluster,
})

_ = hw.WriteResult(&api.CheckResult{
Name: "kubernetes namespace",
State: api.StateInfo,
Summary: currentContext.Namespace,
})

_ = hw.WriteResult(&api.CheckResult{
Name: "kubernetes authinfo",
State: api.StateInfo,
Summary: currentContext.AuthInfo,
})

if err := localChecker.Validate(); err != nil {
Expand Down