Skip to content

Commit

Permalink
Merge pull request #618 from devppratik/update-cluster-context-ls-det…
Browse files Browse the repository at this point in the history
…ails

Update osdctl cluster context to display LS override reason
  • Loading branch information
openshift-merge-bot[bot] authored Nov 8, 2024
2 parents 82b25f0 + b522580 commit 9ab9ea0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/cluster/support/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (o *statusOptions) run() error {
table.AddRow([]string{
clusterLimitedSupportReason.ID(),
clusterLimitedSupportReason.Summary(),
strconv.FormatBool(clusterLimitedSupportReason.Override().Enabled()),
strconv.FormatBool(limitedSupportOverridden),
clusterLimitedSupportReason.Details(),
})
}
Expand Down
21 changes: 15 additions & 6 deletions pkg/utils/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package utils
import (
"encoding/json"
"fmt"
"math"
"os"
"strconv"
"strings"
"time"

pd "github.com/PagerDuty/go-pagerduty"
"github.com/andygrunwald/go-jira"
"github.com/openshift-online/ocm-cli/pkg/dump"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
v1 "github.com/openshift-online/ocm-sdk-go/servicelogs/v1"
"github.com/openshift/osdctl/pkg/printer"
"math"
"os"
"strings"
"time"
)

const (
Expand Down Expand Up @@ -107,10 +109,17 @@ func PrintLimitedSupportReasons(limitedSupportReasons []*cmv1.LimitedSupportReas
return
}

var limitedSupportOverridden = false
table := printer.NewTablePrinter(os.Stdout, 20, 1, 3, ' ')
table.AddRow([]string{"Reason ID", "Summary", "Details"})
table.AddRow([]string{"Reason ID", "Summary", "Overridden (SUPPORTEX)", "Details"})
for _, clusterLimitedSupportReason := range limitedSupportReasons {
table.AddRow([]string{clusterLimitedSupportReason.ID(), clusterLimitedSupportReason.Summary(), clusterLimitedSupportReason.Details()})
limitedSupportOverridden = limitedSupportOverridden || clusterLimitedSupportReason.Override().Enabled()
table.AddRow([]string{
clusterLimitedSupportReason.ID(),
clusterLimitedSupportReason.Summary(),
strconv.FormatBool(limitedSupportOverridden),
clusterLimitedSupportReason.Details(),
})
}
// Add empty row for readability
table.AddRow([]string{})
Expand Down

0 comments on commit 9ab9ea0

Please sign in to comment.