-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compare gating version against existing deployment versions and set u…
…pgradeFrom status
- Loading branch information
1 parent
d4de2d3
commit 42754c4
Showing
4 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
|
||
- name: Check for existing deployment | ||
k8s_info: | ||
api_version: "{{ api_version }}" | ||
kind: "{{ kind }}" | ||
namespace: "{{ ansible_operator_meta.namespace }}" | ||
name: "{{ ansible_operator_meta.name }}" | ||
register: existing_deployment | ||
|
||
- name: Set prevous_version version based on AWX CR version status | ||
ansible.builtin.set_fact: | ||
prevous_version: "{{ existing_deployment.resources[0].status.version | default(0.0.0) }}" | ||
when: existing_deployment['resources'] | length > 0 | ||
|
||
- name: If prevous_version is less than or equal to gating_version, set upgrade_from to prevous_version | ||
ansible.builtin.set_fact: | ||
upgrade_from: "{{ prevous_version }}" | ||
when: prevous_version | version_compare(gating_version, '<=') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters