From ca8e97b3ae14c4cb0ca1fb0a8b577ebf423b9a2f Mon Sep 17 00:00:00 2001 From: Yuxiang Zhu Date: Mar 12 2019 13:40:04 +0000 Subject: CI/CD: Fix Greenwave message triggers The "real" message body of a `VirtualTopic.eng.greenwave.decision.update` message is in the `msg` field of the message body. Fixing it... --- diff --git a/openshift/pipelines/templates/waiverdb-greenwave-trigger.Jenkinsfile b/openshift/pipelines/templates/waiverdb-greenwave-trigger.Jenkinsfile index 15f8088..40a1e81 100644 --- a/openshift/pipelines/templates/waiverdb-greenwave-trigger.Jenkinsfile +++ b/openshift/pipelines/templates/waiverdb-greenwave-trigger.Jenkinsfile @@ -8,10 +8,10 @@ properties([ name: params.MESSAGING_PROVIDER, overrides: [topic: params.MESSAGING_TOPIC], checks: [ - [field: '$.subject_type', expectedValue: 'container-image'], - [field: '$.subject_identifier', expectedValue: params.SUBJECT_IDENTIFIER_REGEX], - [field: '$.decision_context', expectedValue: params.DECISION_CONTEXT_REGEX], - [field: '$.policies_satisfied', expectedValue: 'true'], + [field: '$.msg.subject_type', expectedValue: 'container-image'], + [field: '$.msg.subject_identifier', expectedValue: params.SUBJECT_IDENTIFIER_REGEX], + [field: '$.msg.decision_context', expectedValue: params.DECISION_CONTEXT_REGEX], + [field: '$.msg.policies_satisfied', expectedValue: 'true'], ], ], ], @@ -58,7 +58,7 @@ podTemplate( // Extract the digest of the image to be promoted. // e.g. factory2/waiverdb@sha256:35201c572fc8a137862b7a256476add8d7465fa5043d53d117f4132402f8ef6b // -> sha256:35201c572fc8a137862b7a256476add8d7465fa5043d53d117f4132402f8ef6b - def digest = (message.subject_identifier =~ /@(sha256:\w+)$/)[0][1] + def digest = (message.msg.subject_identifier =~ /@(sha256:\w+)$/)[0][1] // Generate the pull spec of the image // e.g. quay.io/factory2/waiverdb@sha256:35201c572fc8a137862b7a256476add8d7465fa5043d53d117f4132402f8ef6b def image = params.SOURCE_CONTAINER_REPO + '@' + digest