-
Notifications
You must be signed in to change notification settings - Fork 639
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 (#1972)
* Compare gating version against existing deployment versions and set upgradeFrom status * Add quotes to default version Co-authored-by: Dimitri Savineau <[email protected]>
- Loading branch information
1 parent
8a5ec6e
commit c30d4c1
Showing
4 changed files
with
36 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 previous_version version based on AWX CR version status | ||
ansible.builtin.set_fact: | ||
previous_version: "{{ existing_deployment.resources[0].status.version | default('0.0.0') }}" | ||
when: existing_deployment['resources'] | length | ||
|
||
- name: If previous_version is less than or equal to gating_version, set upgraded_from to previous_version | ||
ansible.builtin.set_fact: | ||
upgraded_from: "{{ previous_version }}" | ||
when: previous_version is 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