Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Kaushik committed Sep 10, 2024
1 parent de45f52 commit 934815f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions internal/formatter/clusters_full.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ import (
"github.com/sirupsen/logrus"
"github.com/yugabyte/ybm-cli/internal/client"
"github.com/yugabyte/ybm-cli/internal/cluster"
"github.com/yugabyte/ybm-cli/cmd/util"
ybmclient "github.com/yugabyte/yugabytedb-managed-go-client-internal"
"golang.org/x/exp/slices"
)

const (
defaultFullClusterGeneral = "table {{.Name}}\t{{.ID}}\t{{.SoftwareVersion}}\t{{.State}}\t{{.HealthState}}"
defaultFullClusterGeneral2 = "table {{.Provider}}\t{{.Tier}}\t{{.FaultTolerance}}\t{{.Nodes}}\t{{.NodesSpec}}\t{{.ConnectionPoolingStatus}}"
defaultFullClusterGeneral2 = "table {{.Provider}}\t{{.Tier}}\t{{.FaultTolerance}}\t{{.Nodes}}\t{{.NodesSpec}}"
defaultFullClusterGeneral2v2 = "table {{.Provider}}\t{{.Tier}}\t{{.FaultTolerance}}\t{{.Nodes}}\t{{.NodesSpec}}\t{{.ConnectionPoolingStatus}}"
defaultVPCListingCluster = "table {{.Name}}\t{{.State}}\t{{.Provider}}\t{{.Regions}}\t{{.CIDR}}\t{{.Peerings}}"
defaultDefaultFullClusterRegion = "table {{.Region}}\t{{.NumNode}}\t{{.NumCores}}\t{{.MemoryGb}}\t{{.DiskSizeGb}}\t{{.VpcName}}"
defaultFullClusterNalListing = "table {{.Name}}\t{{.Desc}}\t{{.AllowedList}}"
Expand Down Expand Up @@ -157,7 +159,14 @@ func (c *FullClusterContext) Write() error {
}
c.postFormat(tmpl, NewClusterContext())

tmpl, err = c.startSubsection(defaultFullClusterGeneral2)


if util.IsFeatureFlagEnabled(util.CONNECTION_POOLING) {
tmpl, err = c.startSubsection(defaultFullClusterGeneral2v2)
} else {
tmpl, err = c.startSubsection(defaultFullClusterGeneral2)
}

if err != nil {
return err
}
Expand Down

0 comments on commit 934815f

Please sign in to comment.