From 7c14614c676a0f356e746f75d988626054230de3 Mon Sep 17 00:00:00 2001 From: James Slagle Date: Fri, 12 Apr 2024 07:15:36 -0400 Subject: [PATCH] Add multipathd image and Fix EDPM $RELATED_IMAGE* vars for consistency (#741) * Add multipathd image This image was missing from OpenStackVersion. Signed-off-by: James Slagle * Fix EDPM $RELATED_IMAGE* vars for consistency Fixes the EDPM environment variables to match the naming convention from the other operators for consistency. - Drops OPENSTACK from the names - Each vars ends in IMAGE_URL_DEFAULT Syncs openstack-operator with the changes done in dataplane-operator commit 6b307a874617acb1585d5acc09c2f04e47e17fa7 Signed-off-by: James Slagle --------- Signed-off-by: James Slagle Signed-off-by: James Slagle --- ...e.openstack.org_openstackcontrolplanes.yaml | 2 ++ .../core.openstack.org_openstackversions.yaml | 6 ++++++ apis/core/v1beta1/openstackversion_types.go | 1 + apis/core/v1beta1/zz_generated.deepcopy.go | 5 +++++ ...e.openstack.org_openstackcontrolplanes.yaml | 2 ++ .../core.openstack.org_openstackversions.yaml | 6 ++++++ hack/export_related_images.sh | 18 ++++++++---------- pkg/openstack/version.go | 10 +--------- .../openstackversion_controller_test.go | 6 ++++-- 9 files changed, 35 insertions(+), 21 deletions(-) diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 800b25d83..c9775e065 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17297,6 +17297,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: diff --git a/apis/bases/core.openstack.org_openstackversions.yaml b/apis/bases/core.openstack.org_openstackversions.yaml index 84205f3b9..656416baf 100644 --- a/apis/bases/core.openstack.org_openstackversions.yaml +++ b/apis/bases/core.openstack.org_openstackversions.yaml @@ -99,6 +99,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: @@ -288,6 +290,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: @@ -446,6 +450,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: diff --git a/apis/core/v1beta1/openstackversion_types.go b/apis/core/v1beta1/openstackversion_types.go index 6ad05013d..750e708fd 100644 --- a/apis/core/v1beta1/openstackversion_types.go +++ b/apis/core/v1beta1/openstackversion_types.go @@ -96,6 +96,7 @@ type ContainerTemplate struct { EdpmFrrImage *string `json:"edpmFrrImage,omitempty"` EdpmIscsidImage *string `json:"edpmIscsidImage,omitempty"` EdpmLogrotateCrondImage *string `json:"edpmLogrotateCrondImage,omitempty"` + EdpmMultipathdImage *string `json:"edpmMultipathdImage,omitempty"` EdpmNeutronMetadataAgentImage *string `json:"edpmNeutronMetadataAgentImage,omitempty"` EdpmNeutronSriovAgentImage *string `json:"edpmNeutronSriovAgentImage,omitempty"` EdpmOvnBgpAgentImage *string `json:"edpmOvnBgpAgentImage,omitempty"` diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index 46b13e8fb..0c5169450 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -345,6 +345,11 @@ func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { *out = new(string) **out = **in } + if in.EdpmMultipathdImage != nil { + in, out := &in.EdpmMultipathdImage, &out.EdpmMultipathdImage + *out = new(string) + **out = **in + } if in.EdpmNeutronMetadataAgentImage != nil { in, out := &in.EdpmNeutronMetadataAgentImage, &out.EdpmNeutronMetadataAgentImage *out = new(string) diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 800b25d83..c9775e065 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -17297,6 +17297,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: diff --git a/config/crd/bases/core.openstack.org_openstackversions.yaml b/config/crd/bases/core.openstack.org_openstackversions.yaml index 84205f3b9..656416baf 100644 --- a/config/crd/bases/core.openstack.org_openstackversions.yaml +++ b/config/crd/bases/core.openstack.org_openstackversions.yaml @@ -99,6 +99,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: @@ -288,6 +290,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: @@ -446,6 +450,8 @@ spec: type: string edpmLogrotateCrondImage: type: string + edpmMultipathdImage: + type: string edpmNeutronMetadataAgentImage: type: string edpmNeutronSriovAgentImage: diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index ad3774970..678b264ee 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -70,13 +70,11 @@ export RELATED_IMAGE_DESIGNATE_UNBOUND_IMAGE_URL_DEFAULT=quay.io/tripleowallabyc export RELATED_IMAGE_BARBICAN_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-api:current-podified export RELATED_IMAGE_BARBICAN_WORKER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-worker:current-podified export RELATED_IMAGE_BARBICAN_KEYSTONE_LISTENER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-barbican-keystone-listener:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_FRR_DEFAULT_IMG=quay.io/podified-antelope-centos9/openstack-frr:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_ISCSID_DEFAULT_IMG=quay.io/podified-antelope-centos9/openstack-iscsid:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_LOGROTATE_CROND_DEFAULT_IMG=quay.io/podified-antelope-centos9/openstack-cron:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_NEUTRON_METADATA_AGENT_DEFAULT_IMG=quay.io/podified-antelope-centos9/openstack-neutron-metadata-agent-ovn:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_NEUTRON_SRIOV_AGENT_DEFAULT_IMG=quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_OVN_BGP_AGENT_IMAGE=quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_CEILOMETER_COMPUTE_IMAGE=quay.io/podified-antelope-centos9/openstack-ceilometer-compute:current-podified -export RELATED_IMAGE_OPENSTACK_EDPM_CEILOMETER_IPMI_IMAGE=quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified -#NOTE: RELATED_IMAGE_OPENSTACK_EDPM_NODE_EXPORTER_IMAGE is the same as below -export RELATED_IMAGE_TELEMETRY_NODE_EXPORTER_IMAGE_URL_DEFAULT=quay.io/prometheus/node-exporter:v1.5.0 +export RELATED_IMAGE_EDPM_FRR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-frr:current-podified +export RELATED_IMAGE_EDPM_ISCSID_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-iscsid:current-podified +export RELATED_IMAGE_EDPM_LOGROTATE_CROND_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-cron:current-podified +export RELATED_IMAGE_EDPM_MULTIPATHD_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-multipathd:current-podified +export RELATED_IMAGE_EDPM_NEUTRON_METADATA_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-neutron-metadata-agent-ovn:current-podified +export RELATED_IMAGE_EDPM_NEUTRON_SRIOV_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified +export RELATED_IMAGE_EDPM_OVN_BGP_AGENT_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ovn-bgp-agent:current-podified +export RELATED_IMAGE_EDPM_NODE_EXPORTER_IMAGE_URL_DEFAULT=quay.io/prometheus/node-exporter:v1.5.0 diff --git a/pkg/openstack/version.go b/pkg/openstack/version.go index f5bc42814..ebffe90c1 100644 --- a/pkg/openstack/version.go +++ b/pkg/openstack/version.go @@ -39,15 +39,6 @@ func InitializeOpenStackVersionImageDefaults(ctx context.Context, envImages map[ } // format API so we adhere to go linting standards fieldName = strings.Replace(fieldName, "Api", "API", -1) - // EDPM variables have OPENSTACK prefixes we drop - if strings.Contains(fieldName, "Edpm") { - fieldName = strings.Replace(fieldName, "Openstack", "", -1) - fieldName += "Image" - } - // FIXME: RELATED_IMAGE_OPENSTACK_EDPM_OVN_BGP_AGENT_IMAGE is inconsistent with other EDPM image names - if fieldName == "EdpmOvnBgpImage" { - fieldName = "EdpmOvnBgpAgentImage" - } } Log.Info(fmt.Sprintf("Initialize Field name: %s", fieldName)) field := d.FieldByName(fieldName) @@ -113,6 +104,7 @@ func GetContainerImages(ctx context.Context, defaults *corev1beta1.ContainerDefa EdpmFrrImage: getImg(instance.Spec.CustomContainerImages.EdpmFrrImage, defaults.EdpmFrrImage), EdpmIscsidImage: getImg(instance.Spec.CustomContainerImages.EdpmIscsidImage, defaults.EdpmIscsidImage), EdpmLogrotateCrondImage: getImg(instance.Spec.CustomContainerImages.EdpmLogrotateCrondImage, defaults.EdpmLogrotateCrondImage), + EdpmMultipathdImage: getImg(instance.Spec.CustomContainerImages.EdpmMultipathdImage, defaults.EdpmMultipathdImage), EdpmNeutronMetadataAgentImage: getImg(instance.Spec.CustomContainerImages.EdpmNeutronMetadataAgentImage, defaults.EdpmNeutronMetadataAgentImage), EdpmNeutronSriovAgentImage: getImg(instance.Spec.CustomContainerImages.EdpmNeutronSriovAgentImage, defaults.EdpmNeutronSriovAgentImage), EdpmOvnBgpAgentImage: getImg(instance.Spec.CustomContainerImages.EdpmOvnBgpAgentImage, defaults.EdpmOvnBgpAgentImage), diff --git a/tests/functional/openstackversion_controller_test.go b/tests/functional/openstackversion_controller_test.go index 05201b118..bbbda027a 100644 --- a/tests/functional/openstackversion_controller_test.go +++ b/tests/functional/openstackversion_controller_test.go @@ -87,7 +87,10 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.EdpmFrrImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmIscsidImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmLogrotateCrondImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmMultipathdImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmNeutronMetadataAgentImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmNeutronSriovAgentImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmNodeExporterImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.EdpmOvnBgpAgentImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.GlanceAPIImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.HeatAPIImage).ShouldNot(BeNil()) @@ -130,8 +133,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.SwiftContainerImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.SwiftObjectImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.SwiftProxyImage).ShouldNot(BeNil()) - // same a RELATED_IMAGE_OPENSTACK_EDPM_NODE_EXPORTER_IMAGE - g.Expect(version.Status.ContainerImages.TelemetryNodeExporterImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.EdpmNodeExporterImage).ShouldNot(BeNil()) }, timeout, interval).Should(Succeed()) })