-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add missing null checks for notification triggers on ArgoCD sync failed (issue no #21591) #21679
Open
prashant231203
wants to merge
13
commits into
argoproj:master
Choose a base branch
from
prashant231203:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,996
−725
Conversation
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
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
prashant231203
force-pushed
the
master
branch
2 times, most recently
from
January 27, 2025 11:27
e08f602
to
2306884
Compare
Signed-off-by: Prashant singh <[email protected]>
…oj#21540) Signed-off-by: Michael Crenshaw <[email protected]> Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: reggie-k <[email protected]> Signed-off-by: Prashant singh <[email protected]>
argoproj#21658) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: Prashant singh <[email protected]>
…rgoproj#21440) Signed-off-by: Rafal Pelczar <[email protected]> Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
Signed-off-by: Prashant singh <[email protected]>
prashant231203
force-pushed
the
master
branch
from
January 27, 2025 12:02
c8cdcb6
to
c2899e6
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Fix nil
operationState
issue inargocd-notifications
Summary:
This PR resolves the issue where ArgoCD Notifications fails with errors when accessing the
operationState
for uninitialized applications (i.e., when the value isnull
). The solution ensures thatnull
checks are added in all triggers before attempting to access theoperationState.phase
, preventing the error.Issue:
Error:
This error occurs when an application either lacks the
operationState
or has an uninitializedoperationState
object. In such cases, the condition attempts to checkoperationState.phase
, which throws an error because the reference is null.Fix:
What was changed:
This fix modifies the condition checks in the notification YAML to ensure that
operationState
is properly validated (i.e.,nil
checks) before any attempt to access its properties, likeoperationState.phase
.nil
checks foroperationState
across allwhen
conditions in the triggers, such ason-sync-running
,on-deployed
,on-sync-succeeded
, andon-sync-failed
.Expected Outcome:
When the application is still being synced or lacks a valid
operationState
, it should not cause an error.Notifications should be successfully triggered regardless of whether the
operationState
exists, as long as allwhen
conditions are properly checked fornull
values.After fix (successful notification without errors):
Provide logs demonstrating that the notifications now trigger without issues.
Additional Notes:
operationState
might not yet be initialized for newly created applications or applications in a non-running state.