From bfc4d8e37f94ffa15bc9d2891307e94fafc55da3 Mon Sep 17 00:00:00 2001 From: jamesmarshall24 Date: Thu, 12 Feb 2026 13:46:24 -0500 Subject: [PATCH] Add CRD validation for images and image version (#2096) --- config/crd/bases/awx.ansible.com_awxbackups.yaml | 3 +++ config/crd/bases/awx.ansible.com_awxrestores.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/crd/bases/awx.ansible.com_awxbackups.yaml b/config/crd/bases/awx.ansible.com_awxbackups.yaml index 74d325d0..863ac77f 100644 --- a/config/crd/bases/awx.ansible.com_awxbackups.yaml +++ b/config/crd/bases/awx.ansible.com_awxbackups.yaml @@ -37,6 +37,9 @@ spec: metadata: type: object spec: + x-kubernetes-validations: + - rule: "has(self.postgres_image) && has(self.postgres_image_version) || !has(self.postgres_image) && !has(self.postgres_image_version)" + message: "Both postgres_image and postgres_image_version must be set when required" type: object x-kubernetes-preserve-unknown-fields: true required: diff --git a/config/crd/bases/awx.ansible.com_awxrestores.yaml b/config/crd/bases/awx.ansible.com_awxrestores.yaml index d841d5fc..33b00237 100644 --- a/config/crd/bases/awx.ansible.com_awxrestores.yaml +++ b/config/crd/bases/awx.ansible.com_awxrestores.yaml @@ -37,6 +37,9 @@ spec: metadata: type: object spec: + x-kubernetes-validations: + - rule: "has(self.postgres_image) && has(self.postgres_image_version) || !has(self.postgres_image) && !has(self.postgres_image_version)" + message: "Both postgres_image and postgres_image_version must be set when required" type: object x-kubernetes-preserve-unknown-fields: true required: