Skip to content

Commit ece9b0c

Browse files
authored
fix NewArtifact (#35)
1 parent dd58726 commit ece9b0c

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/operators/flux_gitops_operator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ def is_supported_message(self, phase_data) -> bool:
127127
kind = self._get_message_kind(phase_data)
128128
logging.debug(f'Kind: {kind}')
129129

130-
return (kind == 'Kustomization' or kind == 'GitRepository')
130+
reason = phase_data['reason']
131+
logging.debug(f'Reason: {reason}')
132+
133+
return (kind == 'Kustomization' or kind == 'GitRepository' and reason != 'NewArtifact')
131134

132135
def _get_message_kind(self, phase_data) -> str:
133136
return phase_data['involvedObject']['kind']
@@ -145,7 +148,8 @@ def _map_reason_to_description(self, reason, original_message):
145148
"HealthCheckFailed": "Health Check Failed",
146149
"ValidationFailed": "Manifests validation failed.",
147150
"info": original_message,
148-
"error": original_message
151+
"error": original_message,
152+
"NewArtifact": original_message
149153
}
150154
return reason_description_map[reason]
151155

src/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Flask==1.1.1
1+
Flask==2.1.0
22
gunicorn==20.0.4
33
requests
44
timeloop

0 commit comments

Comments
 (0)