From 42d305bbccf778362df8bd7833726def4928c795 Mon Sep 17 00:00:00 2001 From: David Hageman Date: Wed, 6 Mar 2024 18:24:28 -0600 Subject: [PATCH] Add imagePullSecrets option to Mesh Ingress --- config/crd/bases/awx.ansible.com_awxmeshingresses.yaml | 5 +++++ .../manifests/bases/awx-operator.clusterserviceversion.yaml | 5 +++++ roles/mesh_ingress/defaults/main.yml | 1 + roles/mesh_ingress/templates/deployment.yml.j2 | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml b/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml index 483a9e387..6ab6da8e5 100644 --- a/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml +++ b/config/crd/bases/awx.ansible.com_awxmeshingresses.yaml @@ -41,6 +41,11 @@ spec: deployment_name: description: Name of the AWX deployment to create the Mesh Ingress for. type: string + image_pull_secrets: + description: Image pull secrets for Mesh Ingress containers. + type: array + items: + type: string external_hostname: description: External hostname to use for the Mesh Ingress. type: string diff --git a/config/manifests/bases/awx-operator.clusterserviceversion.yaml b/config/manifests/bases/awx-operator.clusterserviceversion.yaml index a9fd00605..c5047d06f 100644 --- a/config/manifests/bases/awx-operator.clusterserviceversion.yaml +++ b/config/manifests/bases/awx-operator.clusterserviceversion.yaml @@ -58,6 +58,11 @@ spec: path: ingress_controller x-descriptors: - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Image Pull Secrets + path: image_pull_secrets + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:advanced + - urn:alm:descriptor:io.kubernetes:Secret version: v1alpha1 - description: Back up a deployment of the awx, including jobs, inventories, and credentials diff --git a/roles/mesh_ingress/defaults/main.yml b/roles/mesh_ingress/defaults/main.yml index 8351bb82e..1540fb241 100644 --- a/roles/mesh_ingress/defaults/main.yml +++ b/roles/mesh_ingress/defaults/main.yml @@ -11,5 +11,6 @@ set_self_owneref: true _control_plane_ee_image: quay.io/ansible/awx-ee:latest _image_pull_policy: Always +image_pull_secrets: [] finalizer_run: false diff --git a/roles/mesh_ingress/templates/deployment.yml.j2 b/roles/mesh_ingress/templates/deployment.yml.j2 index 90bbe6463..7aabca664 100644 --- a/roles/mesh_ingress/templates/deployment.yml.j2 +++ b/roles/mesh_ingress/templates/deployment.yml.j2 @@ -12,6 +12,12 @@ spec: labels: app.kubernetes.io/name: {{ ansible_operator_meta.name }} spec: +{% if image_pull_secrets | length > 0 %} + imagePullSecrets: +{% for secret in image_pull_secrets %} + - name: {{ secret }} +{% endfor %} +{% endif %} containers: - args: - /bin/sh