Skip to content

Commit

Permalink
Fix awx_kube_devel (#1759)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Signed-off-by: Seth Foster <[email protected]>
Co-authored-by: Seth Foster <[email protected]>
  • Loading branch information
TheRealHaoLiu and fosterseth authored Mar 11, 2024
1 parent 3abeec5 commit b5d81b8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions roles/installer/tasks/migrate_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions roles/installer/templates/deployments/task.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
11 changes: 10 additions & 1 deletion roles/installer/templates/jobs/migration.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
- name: "migration-job"
image: '{{ _image }}'
command:
- /usr/bin/awx-manage
- awx-manage
- migrate
- --noinput
volumeMounts:
Expand All @@ -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:
Expand All @@ -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

0 comments on commit b5d81b8

Please sign in to comment.