Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add octavia rsyslog container image handling #1267

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apis/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
5 changes: 5 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bindata/operator/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions hack/export_related_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions pkg/openstack/octavia.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/openstack/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Loading