Skip to content

Commit

Permalink
SDKQE-3458: Add ability to deploy specific Columnar AMIs in Capella (#71
Browse files Browse the repository at this point in the history
)
  • Loading branch information
willbroadbelt authored Oct 30, 2024
1 parent e6f3aba commit 1752be5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions deployment/clouddeploy/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,12 @@ func (p *Deployer) createNewCluster(ctx context.Context, def *clusterdef.Cluster
},
AvailabilityZone: "single",
}
if def.NodeGroups[0].Cloud.ServerImage != "" {
createReq.Override = capellacontrol.CreateOverrideRequest{
Image: def.NodeGroups[0].Cloud.ServerImage,
Token: p.overrideToken,
}
}
p.logger.Debug("creating columnar", zap.Any("req", createReq))

newCluster, err := p.client.CreateColumnar(ctx, p.tenantID, cloudProjectID, createReq)
Expand Down Expand Up @@ -931,8 +937,9 @@ func (p *Deployer) NewCluster(ctx context.Context, def *clusterdef.Cluster) (dep
}
}

// Deploy cluster based on presence of server image
if serverImage != "" {
// Deploy cluster based on presence of server image,
// specific Columnar images are deployed through the normal createCluster func
if serverImage != "" && !def.Columnar {
return p.deployNewCluster(ctx, def, clusterVersion, serverImage)
} else {
return p.createNewCluster(ctx, def, clusterVersion)
Expand Down
3 changes: 2 additions & 1 deletion utils/capellacontrol/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ type CreateServices struct {
type CreateOverrideRequest struct {
Image string `json:"image"`
Token string `json:"token"`
Server string `json:"server"`
Server string `json:"server,omitempty"`
}

func (o CreateOverrideRequest) IsEmpty() bool {
Expand Down Expand Up @@ -723,6 +723,7 @@ type CreateColumnarInstanceRequest struct {
Package Package `json:"package"`
InstanceTypes ColumnarInstanceTypes `json:"instanceTypes"`
AvailabilityZone string `json:"availabilityZone"`
Override CreateOverrideRequest `json:"overRide,omitempty"`
}

type UpdateColumnarInstanceRequest struct {
Expand Down

0 comments on commit 1752be5

Please sign in to comment.