Skip to content

Commit

Permalink
Add amphora image tag configuration
Browse files Browse the repository at this point in the history
This configures the cloud to use the amphora
image with vertical scaling optimization when
using a compute flavor with multiple vCPUs.

JIRA: https://issues.redhat.com/browse/OSPRH-8446
  • Loading branch information
weinimo committed Sep 24, 2024
1 parent 5d1ca71 commit 27b7674
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/amphoracontrollers/flavors.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type OctaviaFlavors struct {
// FlavorProfileData -
type FlavorProfileData struct {
ComputeFlavorID string `json:"compute_flavor"`
AmpImageTag string `json:"amp_image_tag"`
}

var (
Expand Down Expand Up @@ -217,6 +218,13 @@ func ensureFlavors(osclient *openstack.OpenStack, log *logr.Logger, instance *oc
flavorProfileData := FlavorProfileData{
ComputeFlavorID: amphoraFlavors[flavorOpts.Name].ID,
}

if amphoraFlavors[flavorOpts.Name].VCPUs == 1 {
flavorProfileData.AmpImageTag = octavia.AmphoraImageTag
} else {
flavorProfileData.AmpImageTag = octavia.AmphoraImageVertTag
}

fpDataJSON, err := json.Marshal(flavorProfileData)
if err != nil {
return "", err
Expand Down

0 comments on commit 27b7674

Please sign in to comment.