From 1752be55df7158fda9fda050d61f2645b5352b49 Mon Sep 17 00:00:00 2001 From: Will Broadbelt <33037297+willbroadbelt@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:13:18 +0000 Subject: [PATCH] SDKQE-3458: Add ability to deploy specific Columnar AMIs in Capella (#71) --- deployment/clouddeploy/deployer.go | 11 +++++++++-- utils/capellacontrol/controller.go | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/deployment/clouddeploy/deployer.go b/deployment/clouddeploy/deployer.go index da3f830..3a78bce 100644 --- a/deployment/clouddeploy/deployer.go +++ b/deployment/clouddeploy/deployer.go @@ -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) @@ -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) diff --git a/utils/capellacontrol/controller.go b/utils/capellacontrol/controller.go index bc1fe28..88e34c9 100644 --- a/utils/capellacontrol/controller.go +++ b/utils/capellacontrol/controller.go @@ -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 { @@ -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 {