From 9241b79322ef3f4be78db71f1134c8c79f86ea45 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Fri, 17 Jan 2025 14:19:19 +0000 Subject: [PATCH] Add octavia rsyslog container image handling Depends-On: https://github.com/openstack-k8s-operators/octavia-operator/pull/435 JIRA: OSPRH-13090 --- apis/core/v1beta1/openstackversion_types.go | 1 + apis/core/v1beta1/zz_generated.deepcopy.go | 5 +++++ bindata/operator/operator.yaml | 2 ++ config/default/manager_default_images.yaml | 2 ++ hack/export_related_images.sh | 1 + pkg/openstack/octavia.go | 5 +++++ pkg/openstack/version.go | 1 + .../functional/ctlplane/openstackversion_controller_test.go | 1 + 8 files changed, 18 insertions(+) diff --git a/apis/core/v1beta1/openstackversion_types.go b/apis/core/v1beta1/openstackversion_types.go index dbe8ede40..7c346ba40 100644 --- a/apis/core/v1beta1/openstackversion_types.go +++ b/apis/core/v1beta1/openstackversion_types.go @@ -139,6 +139,7 @@ type ContainerTemplate struct { OctaviaHealthmanagerImage *string `json:"octaviaHealthmanagerImage,omitempty"` OctaviaHousekeepingImage *string `json:"octaviaHousekeepingImage,omitempty"` OctaviaWorkerImage *string `json:"octaviaWorkerImage,omitempty"` + OctaviaRsyslogImage *string `json:"octaviaRsyslogImage,omitempty"` OpenstackClientImage *string `json:"openstackClientImage,omitempty"` OsContainerImage *string `json:"osContainerImage,omitempty"` //fixme wire this in? OvnControllerImage *string `json:"ovnControllerImage,omitempty"` diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index a80978ab0..e93706504 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -574,6 +574,11 @@ func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate) { *out = new(string) **out = **in } + if in.OctaviaRsyslogImage != nil { + in, out := &in.OctaviaRsyslogImage, &out.OctaviaRsyslogImage + *out = new(string) + **out = **in + } if in.OpenstackClientImage != nil { in, out := &in.OpenstackClientImage, &out.OpenstackClientImage *out = new(string) diff --git a/bindata/operator/operator.yaml b/bindata/operator/operator.yaml index bac4f4e19..6a4b16cac 100644 --- a/bindata/operator/operator.yaml +++ b/bindata/operator/operator.yaml @@ -206,6 +206,8 @@ spec: value: quay.io/podified-antelope-centos9/openstack-octavia-housekeeping:current-podified - name: RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified + - name: RELATED_IMAGE_OCTAVIA_RSYSLOG_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-rsyslog:current-podified - name: RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified - name: RELATED_IMAGE_OS_CONTAINER_IMAGE_URL_DEFAULT diff --git a/config/default/manager_default_images.yaml b/config/default/manager_default_images.yaml index d2706326e..28e37bac4 100644 --- a/config/default/manager_default_images.yaml +++ b/config/default/manager_default_images.yaml @@ -143,6 +143,8 @@ spec: value: quay.io/podified-antelope-centos9/openstack-octavia-housekeeping:current-podified - name: RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified + - name: RELATED_IMAGE_OCTAVIA_RSYSLOG_IMAGE_URL_DEFAULT + value: quay.io/podified-antelope-centos9/openstack-rsyslog:current-podified - name: RELATED_IMAGE_OPENSTACK_CLIENT_IMAGE_URL_DEFAULT value: quay.io/podified-antelope-centos9/openstack-openstackclient:current-podified - name: RELATED_IMAGE_OS_CONTAINER_IMAGE_URL_DEFAULT diff --git a/hack/export_related_images.sh b/hack/export_related_images.sh index 87f900ba2..9fd7036af 100755 --- a/hack/export_related_images.sh +++ b/hack/export_related_images.sh @@ -60,6 +60,7 @@ export RELATED_IMAGE_OCTAVIA_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-cen export RELATED_IMAGE_OCTAVIA_HOUSEKEEPING_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-housekeeping:current-podified export RELATED_IMAGE_OCTAVIA_HEALTHMANAGER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-health-manager:current-podified export RELATED_IMAGE_OCTAVIA_WORKER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-octavia-worker:current-podified +export RELATED_IMAGE_OCTAVIA_RSYSLOG_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-rsyslog:current-podified export RELATED_IMAGE_DESIGNATE_API_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-api:current-podified export RELATED_IMAGE_DESIGNATE_CENTRAL_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-central:current-podified export RELATED_IMAGE_DESIGNATE_MDNS_IMAGE_URL_DEFAULT=quay.io/tripleowallabycentos9/openstack-designate-mdns:current-podified diff --git a/pkg/openstack/octavia.go b/pkg/openstack/octavia.go index 3aeb6b352..eadb74475 100644 --- a/pkg/openstack/octavia.go +++ b/pkg/openstack/octavia.go @@ -58,6 +58,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro instance.Status.ContainerImages.OctaviaHealthmanagerImage = nil instance.Status.ContainerImages.OctaviaHousekeepingImage = nil instance.Status.ContainerImages.OctaviaApacheImage = nil + instance.Status.ContainerImages.OctaviaRsyslogImage = nil return ctrl.Result{}, nil } @@ -174,12 +175,14 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro instance.Spec.Octavia.Template.OctaviaHousekeeping.DeepCopyInto(&octavia.Spec.OctaviaHousekeeping.OctaviaAmphoraControllerSpecCore) instance.Spec.Octavia.Template.OctaviaHealthManager.DeepCopyInto(&octavia.Spec.OctaviaHealthManager.OctaviaAmphoraControllerSpecCore) instance.Spec.Octavia.Template.OctaviaWorker.DeepCopyInto(&octavia.Spec.OctaviaWorker.OctaviaAmphoraControllerSpecCore) + instance.Spec.Octavia.Template.OctaviaRsyslog.DeepCopyInto(&octavia.Spec.OctaviaRsyslog.OctaviaRsyslogSpecCore) octavia.Spec.OctaviaAPI.ContainerImage = *version.Status.ContainerImages.OctaviaAPIImage octavia.Spec.OctaviaWorker.ContainerImage = *version.Status.ContainerImages.OctaviaWorkerImage octavia.Spec.OctaviaHealthManager.ContainerImage = *version.Status.ContainerImages.OctaviaHealthmanagerImage octavia.Spec.OctaviaHousekeeping.ContainerImage = *version.Status.ContainerImages.OctaviaHousekeepingImage octavia.Spec.ApacheContainerImage = *version.Status.ContainerImages.OctaviaApacheImage + octavia.Spec.OctaviaRsyslog.ContainerImage = *version.Status.ContainerImages.OctaviaRsyslogImage if octavia.Spec.Secret == "" { octavia.Spec.Secret = instance.Spec.Secret @@ -216,6 +219,7 @@ func ReconcileOctavia(ctx context.Context, instance *corev1beta1.OpenStackContro instance.Status.ContainerImages.OctaviaHealthmanagerImage = version.Status.ContainerImages.OctaviaHealthmanagerImage instance.Status.ContainerImages.OctaviaHousekeepingImage = version.Status.ContainerImages.OctaviaHousekeepingImage instance.Status.ContainerImages.OctaviaApacheImage = version.Status.ContainerImages.ApacheImage + instance.Status.ContainerImages.OctaviaRsyslogImage = version.Status.ContainerImages.OctaviaRsyslogImage instance.Status.Conditions.MarkTrue(corev1beta1.OpenStackControlPlaneOctaviaReadyCondition, corev1beta1.OpenStackControlPlaneOctaviaReadyMessage) } else { instance.Status.Conditions.Set(condition.FalseCondition( @@ -236,6 +240,7 @@ func OctaviaImageMatch(ctx context.Context, controlPlane *corev1beta1.OpenStackC !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaWorkerImage, version.Status.ContainerImages.OctaviaWorkerImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaHealthmanagerImage, version.Status.ContainerImages.OctaviaHealthmanagerImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaHousekeepingImage, version.Status.ContainerImages.OctaviaHousekeepingImage) || + !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaRsyslogImage, version.Status.ContainerImages.OctaviaRsyslogImage) || !stringPointersEqual(controlPlane.Status.ContainerImages.OctaviaApacheImage, version.Status.ContainerImages.ApacheImage) { Log.Info("Octavia images do not match") return false diff --git a/pkg/openstack/version.go b/pkg/openstack/version.go index 927a9757b..d7d2f3bc1 100644 --- a/pkg/openstack/version.go +++ b/pkg/openstack/version.go @@ -148,6 +148,7 @@ func GetContainerImages(defaults *corev1beta1.ContainerDefaults, instance corev1 OctaviaHealthmanagerImage: getImg(instance.Spec.CustomContainerImages.OctaviaHealthmanagerImage, defaults.OctaviaHealthmanagerImage), OctaviaHousekeepingImage: getImg(instance.Spec.CustomContainerImages.OctaviaHousekeepingImage, defaults.OctaviaHousekeepingImage), OctaviaWorkerImage: getImg(instance.Spec.CustomContainerImages.OctaviaWorkerImage, defaults.OctaviaWorkerImage), + OctaviaRsyslogImage: getImg(instance.Spec.CustomContainerImages.OctaviaRsyslogImage, defaults.OctaviaRsyslogImage), OpenstackClientImage: getImg(instance.Spec.CustomContainerImages.OpenstackClientImage, defaults.OpenstackClientImage), OsContainerImage: getImg(instance.Spec.CustomContainerImages.OsContainerImage, defaults.OsContainerImage), OvnControllerImage: getImg(instance.Spec.CustomContainerImages.OvnControllerImage, defaults.OvnControllerImage), diff --git a/tests/functional/ctlplane/openstackversion_controller_test.go b/tests/functional/ctlplane/openstackversion_controller_test.go index f679602a2..abeb8914b 100644 --- a/tests/functional/ctlplane/openstackversion_controller_test.go +++ b/tests/functional/ctlplane/openstackversion_controller_test.go @@ -165,6 +165,7 @@ var _ = Describe("OpenStackOperator controller", func() { g.Expect(version.Status.ContainerImages.OctaviaHealthmanagerImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OctaviaHousekeepingImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OctaviaWorkerImage).ShouldNot(BeNil()) + g.Expect(version.Status.ContainerImages.OctaviaRsyslogImage).ShouldNot(BeNil()) g.Expect(version.Status.ContainerImages.OpenstackClientImage).ShouldNot(BeNil()) //fixme wire this one in //g.Expect(version.Status.ContainerImages.OsContainerImage).ShouldNot(BeNil())