Added check for Alerta admin API key generation
Related-PROD: PROD-35884 PROD-35932 PROD-35958
Change-Id: I50e43d839f6fa00ccc264d03777fc98cb950a4f8
diff --git a/upgrade-mcp-release.groovy b/upgrade-mcp-release.groovy
index 3ad67f4..f415be5 100644
--- a/upgrade-mcp-release.groovy
+++ b/upgrade-mcp-release.groovy
@@ -255,6 +255,16 @@
}
}
+def check_35884(String cluster_name) {
+ def alertaApiKeyGenPillar = salt.getPillar(venvPepper, 'I@salt:master', '_param:alerta_admin_api_key_generated').get("return")[0].values()[0]
+ def alertaApiKeyPillar = salt.getPillar(venvPepper, 'I@prometheus:alerta or I@prometheus:alertmanager', '_param:alerta_admin_key').get("return")[0].values()[0]
+
+ if (alertaApiKeyGenPillar == '' || alertaApiKeyGenPillar == 'null' || alertaApiKeyGenPillar == null || alertaApiKeyPillar == '' || alertaApiKeyPillar == 'null' || alertaApiKeyPillar == null) {
+ error('Alerta admin API key not defined.\n' +
+ 'See https://docs.mirantis.com/mcp/q4-18/mcp-release-notes/mu/mu-12/mu-12-addressed/mu-12-dtrain/mu-12-dt-manual.html#i-35884 for more info')
+ }
+}
+
def wa32182(String cluster_name) {
if (salt.testTarget(venvPepper, 'I@opencontrail:control or I@opencontrail:collector')) {
def clusterModelPath = "/srv/salt/reclass/classes/cluster/${cluster_name}"
@@ -649,6 +659,7 @@
check_34406(cluster_name)
check_35705(cluster_name)
+ check_35884(cluster_name)
common.infoMsg('Perform: Validate reclass medata before processing')
validateReclassModel(minions, 'before')