MCPcopy Create free account
hub / github.com/coldbrewcloud/coldbrew-cli / isClusterAvailable

Method isClusterAvailable

commands/deploy/command.go:138–160  ·  view source on GitHub ↗
(clusterName string)

Source from the content-addressed store, hash-verified

136}
137
138func (c *Command) isClusterAvailable(clusterName string) error {
139 // check ECS cluster
140 ecsClusterName := core.DefaultECSClusterName(clusterName)
141 ecsCluster, err := c.awsClient.ECS().RetrieveCluster(ecsClusterName)
142 if err != nil {
143 return fmt.Errorf("Failed to retrieve ECS Cluster [%s]: %s", ecsClusterName, err.Error())
144 }
145 if ecsCluster == nil || conv.S(ecsCluster.Status) == "INACTIVE" {
146 return fmt.Errorf("ECS Cluster [%s] not found", ecsClusterName)
147 }
148
149 // check ECS service role
150 ecsServiceRoleName := core.DefaultECSServiceRoleName(clusterName)
151 ecsServiceRole, err := c.awsClient.IAM().RetrieveRole(ecsServiceRoleName)
152 if err != nil {
153 return fmt.Errorf("Failed to retrieve IAM Role [%s]: %s", ecsServiceRoleName, err.Error())
154 }
155 if ecsServiceRole == nil {
156 return fmt.Errorf("IAM Role [%s] not found", ecsServiceRoleName)
157 }
158
159 return nil
160}
161
162func (c *Command) prepareECRRepo(repoName string) (string, error) {
163 ecrRepo, err := c.awsClient.ECR().RetrieveRepository(repoName)

Callers 1

RunMethod · 0.95

Implementers 8

Commandcommands/clusterstatus/command.go
Commandcommands/deploy/command.go
Commandcommands/clusterdelete/command.go
Commandcommands/delete/command.go
Commandcommands/clustercreate/command.go
Commandcommands/create/command.go
Commandcommands/clusterscale/command.go
Commandcommands/status/command.go

Calls 5

RetrieveClusterMethod · 0.80
ECSMethod · 0.80
ErrorMethod · 0.80
RetrieveRoleMethod · 0.80
IAMMethod · 0.80

Tested by

no test coverage detected