-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
salt: exclude PrometheusRule cleanup under certain conditions
The Metalk8s python-kubernetes module list_objects method is bugged for already released versions. The module has been patched in this PR: #2592 but since we require the list_objects methods to cleanup old PrometheusRule, we need to find a way to skip cleanup for already released versions. Closes: #2606
- Loading branch information
Showing
5 changed files
with
31 additions
and
2 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
23 changes: 23 additions & 0 deletions
23
salt/metalk8s/addons/prometheus-operator/post-downgrade.sls
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,23 @@ | ||
# Include here all states that should be called after downgrading | ||
|
||
{%- set version = pillar.metalk8s.cluster_version %} | ||
|
||
{#- The Metalk8s python-kubernetes module for listing objects is bugged for | ||
already released versions, The following release versions are affected: | ||
2.4.0, 2.4.1, 2.4.2, 2.4.3 and 2.5.0 | ||
This issue as reported here: | ||
https://github.com/scality/metalk8s/issues/2592 has been fixed. We need to | ||
skip the PrometheusRule cleanup state for the versions mentioned above. #} | ||
|
||
{%- set affected_versions = ['2.4.0', '2.4.1', '2.4.2', '2.4.3', '2.5.0'] %} | ||
|
||
{%- if version not in affected_versions %} | ||
include: | ||
- .post-cleanup | ||
|
||
{%- else %} | ||
|
||
Skipping PrometheusRule cleanup for affected version {{ version }}: | ||
test.succeed_without_changes: [] | ||
|
||
{%- endif %} |
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,4 @@ | ||
# Include here all states that should be called after upgrading | ||
|
||
include: | ||
- .post-cleanup |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Include here all states that should be called after downgrading | ||
|
||
include: | ||
- metalk8s.addons.prometheus-operator.post-cleanup | ||
- metalk8s.addons.prometheus-operator.post-downgrade |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Include here all states that should be called after upgrading | ||
|
||
include: | ||
- metalk8s.addons.prometheus-operator.post-cleanup | ||
- metalk8s.addons.prometheus-operator.post-upgrade |