Fix awx_kube_devel (#1759)

* Fix awx_kube_devel
* Sanitize version name for kube_dev

When in development mode, awx version may look
like 23.9.1.dev18+gee9eac15dc.d20240311

k8s job to the migration can only have
a name with alphanumeric, and '.', '-'

so we can just drop off the +

Signed-off-by: Seth Foster <fosterbseth@gmail.com>

---------

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
Co-authored-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
Hao Liu
2024-03-11 15:01:00 -04:00
committed by GitHub
parent 3abeec518a
commit b5d81b8e5d
3 changed files with 16 additions and 3 deletions

View File

@@ -22,9 +22,9 @@
changed_when: false
register: version_check
- name: Update instance version
- name: Sanitize instance version
set_fact:
version: "{{ version_check.stdout | trim }}"
version: "{{ version_check.stdout.split('+')[0] | trim }}"
# It is possible to do a wait on this task to create the job and wait
# until it completes. Unfortunately, if the job doesn't wait finish within

View File

@@ -95,6 +95,10 @@ spec:
mountPath: "/etc/tower/settings.py"
subPath: settings.py
readOnly: true
{% if development_mode | bool %}
- name: awx-devel
mountPath: "/awx_devel"
{% endif %}
- name: init-receptor
image: '{{ _init_container_image }}'
imagePullPolicy: '{{ image_pull_policy }}'

View File

@@ -13,7 +13,7 @@ spec:
- name: "migration-job"
image: '{{ _image }}'
command:
- /usr/bin/awx-manage
- awx-manage
- migrate
- --noinput
volumeMounts:
@@ -29,6 +29,10 @@ spec:
mountPath: "/etc/tower/settings.py"
subPath: settings.py
readOnly: true
{% if development_mode | bool %}
- name: awx-devel
mountPath: "/awx_devel"
{% endif %}
volumes:
- name: "{{ ansible_operator_meta.name }}-application-credentials"
secret:
@@ -52,6 +56,11 @@ spec:
items:
- key: settings
path: settings.py
{% if development_mode | bool %}
- name: awx-devel
hostPath:
path: /awx_devel
{% endif %}
dnsPolicy: ClusterFirst
restartPolicy: Never
terminationGracePeriodSeconds: 30