From 985ab776c47abf45e74009d827ca4d479f715b4e Mon Sep 17 00:00:00 2001 From: Will Broadbelt Date: Wed, 30 Oct 2024 13:48:15 +0000 Subject: [PATCH] SDKQE-3458: Add ability to deploy specific Columnar AMIs in Capella --- 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 {