diff --git a/deployment/clouddeploy/clusterinfo.go b/deployment/clouddeploy/clusterinfo.go index f20ff18..a9d1ee4 100644 --- a/deployment/clouddeploy/clusterinfo.go +++ b/deployment/clouddeploy/clusterinfo.go @@ -8,6 +8,7 @@ import ( type ClusterInfo struct { ClusterID string + Type deployment.ClusterType CloudProjectID string CloudClusterID string Region string @@ -18,7 +19,7 @@ type ClusterInfo struct { var _ (deployment.ClusterInfo) = (*ClusterInfo)(nil) func (i ClusterInfo) GetID() string { return i.ClusterID } -func (i ClusterInfo) GetType() deployment.ClusterType { return deployment.ClusterTypeServer } +func (i ClusterInfo) GetType() deployment.ClusterType { return i.Type } func (i ClusterInfo) GetPurpose() string { return "" } func (i ClusterInfo) GetExpiry() time.Time { return i.Expiry } func (i ClusterInfo) GetState() string { return i.State } diff --git a/deployment/clouddeploy/deployer.go b/deployment/clouddeploy/deployer.go index 25156cc..08bc152 100644 --- a/deployment/clouddeploy/deployer.go +++ b/deployment/clouddeploy/deployer.go @@ -4,11 +4,12 @@ import ( "context" "encoding/base64" "fmt" - "github.com/couchbaselabs/cbdinocluster/utils/webhelper" "path/filepath" "strings" "time" + "github.com/couchbaselabs/cbdinocluster/utils/webhelper" + "github.com/couchbaselabs/cbdinocluster/clusterdef" "github.com/couchbaselabs/cbdinocluster/deployment" "github.com/couchbaselabs/cbdinocluster/utils/capellacontrol" @@ -244,6 +245,7 @@ func (p *Deployer) ListClusters(ctx context.Context) ([]deployment.ClusterInfo, if cluster.IsCorrupted { out = append(out, &ClusterInfo{ ClusterID: cluster.Meta.ID.String(), + Type: deployment.ClusterTypeUnknown, CloudProjectID: cluster.Project.ID, CloudClusterID: "", Region: "", @@ -254,6 +256,7 @@ func (p *Deployer) ListClusters(ctx context.Context) ([]deployment.ClusterInfo, } else if cluster.Cluster == nil && cluster.Columnar == nil { out = append(out, &ClusterInfo{ ClusterID: cluster.Meta.ID.String(), + Type: deployment.ClusterTypeUnknown, CloudProjectID: cluster.Project.ID, CloudClusterID: "", Region: "", @@ -266,6 +269,7 @@ func (p *Deployer) ListClusters(ctx context.Context) ([]deployment.ClusterInfo, if cluster.Cluster != nil { out = append(out, &ClusterInfo{ ClusterID: cluster.Meta.ID.String(), + Type: deployment.ClusterTypeServer, CloudProjectID: cluster.Project.ID, CloudClusterID: cluster.Cluster.Id, Region: cluster.Cluster.Provider.Region, @@ -275,6 +279,7 @@ func (p *Deployer) ListClusters(ctx context.Context) ([]deployment.ClusterInfo, } else if cluster.Columnar != nil { out = append(out, &ClusterInfo{ ClusterID: cluster.Meta.ID.String(), + Type: deployment.ClusterTypeColumnar, CloudProjectID: cluster.Project.ID, CloudClusterID: cluster.Columnar.ID, Region: cluster.Columnar.Config.Region, diff --git a/deployment/deployer.go b/deployment/deployer.go index 7ea7ce7..ec4dacb 100644 --- a/deployment/deployer.go +++ b/deployment/deployer.go @@ -10,6 +10,7 @@ import ( type ClusterType string const ( + ClusterTypeUnknown ClusterType = "unknown" ClusterTypeServer ClusterType = "server" ClusterTypeColumnar ClusterType = "columnar" )