Skip to content

Commit

Permalink
update image names
Browse files Browse the repository at this point in the history
  • Loading branch information
MaysaMacedo committed Dec 26, 2024
1 parent ec7505e commit ac29170
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hypershift-operator/controllers/nodepool/capi.go
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ func (c *CAPI) machineTemplateBuilders() (client.Object, func(object client.Obje
case hyperv1.OpenStackPlatform:
template = &capiopenstackv1beta1.OpenStackMachineTemplate{}
var err error
machineTemplateSpec, err = openstack.MachineTemplateSpec(hcluster, nodePool)
machineTemplateSpec, err = openstack.MachineTemplateSpec(hcluster, nodePool, c.releaseImage)
if err != nil {
SetStatusCondition(&nodePool.Status.Conditions, hyperv1.NodePoolCondition{
Type: hyperv1.NodePoolValidMachineTemplateConditionType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
capiopenstackv1beta1 "sigs.k8s.io/cluster-api-provider-openstack/api/v1beta1"
)

func MachineTemplateSpec(hcluster *hyperv1.HostedCluster, nodePool *hyperv1.NodePool) (*capiopenstackv1beta1.OpenStackMachineTemplateSpec, error) {
func MachineTemplateSpec(hcluster *hyperv1.HostedCluster, nodePool *hyperv1.NodePool, releaseImage *releaseinfo.ReleaseImage) (*capiopenstackv1beta1.OpenStackMachineTemplateSpec, error) {
openStackMachineTemplate := &capiopenstackv1beta1.OpenStackMachineTemplateSpec{Template: capiopenstackv1beta1.OpenStackMachineTemplateResource{Spec: capiopenstackv1beta1.OpenStackMachineSpec{
Flavor: ptr.To(nodePool.Spec.Platform.OpenStack.Flavor),
}}}
Expand All @@ -28,7 +28,7 @@ func MachineTemplateSpec(hcluster *hyperv1.HostedCluster, nodePool *hyperv1.Node
}
} else {
openStackMachineTemplate.Template.Spec.Image.ImageRef = &capiopenstackv1beta1.ResourceReference{
Name: "rhcos-" + hcluster.Name,
Name: "rhcos-" + releaseImage.Version() + hcluster.Name,
}
}

Expand Down Expand Up @@ -80,7 +80,7 @@ func MachineTemplateSpec(hcluster *hyperv1.HostedCluster, nodePool *hyperv1.Node
func ReconcileOpenStackImageCR(ctx context.Context, client client.Client, createOrUpdate upsert.CreateOrUpdateFN, hcluster *hyperv1.HostedCluster, release *releaseinfo.ReleaseImage) error {
openStackImage := orc.Image{
ObjectMeta: metav1.ObjectMeta{
Name: "rhcos-" + hcluster.Name,
Name: "rhcos-" + release.Version() + hcluster.Name,
Namespace: hcluster.Namespace,
// TODO: add proper cleanup in CAPI resources cleanup
OwnerReferences: []metav1.OwnerReference{
Expand Down Expand Up @@ -119,7 +119,7 @@ func reconcileOpenStackImageSpec(hcluster *hyperv1.HostedCluster, openStackImage
}

openStackImageSpec.Resource = &orc.ImageResourceSpec{
Name: "rhcos-" + hcluster.Name,
Name: "rhcos-" + release.Version() + hcluster.Name,
Content: &orc.ImageContent{
DiskFormat: "qcow2",
Download: &orc.ImageContentSourceDownload{
Expand Down

0 comments on commit ac29170

Please sign in to comment.