Skip to content
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: if artifact GC Pod fails make sure error is propagated as a Condition #10019

Merged
merged 10 commits into from Nov 14, 2022

Conversation

juliev0
Copy link
Contributor

@juliev0 juliev0 commented Nov 12, 2022

Partial fix to #9953

Issue was that we were only adding the Condition based on failure of individual artifacts. In this case, the GC Pod never got to the point of attempting deletion of an artifact (it couldn't read what the artifacts were in fact), so there was no reporting of individual artifacts' status. Now a Condition will be written if the Pod fails as well.

Signed-off-by: Julie Vogelman julie_vogelman@intuit.com

Fixes #TODO

Please do not open a pull request until you have checked ALL of these:

  • Create the PR as draft .
  • Run make pre-commit -B to fix codegen and lint problems.
  • Sign-off your commits (otherwise the DCO check will fail).
  • Use a conventional commit message (otherwise the commit message check will fail).
  • "Fixes #" is in both the PR title (for release notes) and this description (to automatically link and close the issue).
  • Add unit or e2e tests. Say how you tested your changes. If you changed the UI, attach screenshots.
  • Github checks are green.
  • Once required tests have passed, mark your PR "Ready for review".

If changes were requested, and you've made them, dismiss the review to get it reviewed again.

…ition

Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
…wArtifactGCTasks

Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
if !found {
return fmt.Errorf("Artifact GC Pod '%s' doesn't have annotation '%s'?", pod.Name, common.AnnotationKeyArtifactGCStrategy)
}
strategy := wfv1.ArtifactGCStrategy(strategyStr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this code is just moved up from below

err := woc.controller.wfclientset.ArgoprojV1alpha1().WorkflowArtifactGCTasks(woc.wf.Namespace).Delete(ctx, task.Name, metav1.DeleteOptions{})
if err != nil {
woc.log.Errorf("error deleting WorkflowArtifactGCTask: %s: %v", task.Name, err)
}
Copy link
Contributor Author

@juliev0 juliev0 Nov 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this deletion code (which deletes both the WorkflowArtifactGCTask, as well as the Pod which it owns), used to just be in processCompletedWorkflowArtifactGCTask() but really this logic is dependent on both the Pod succeeding and the artifacts succeeding

Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
@juliev0 juliev0 marked this pull request as ready for review November 13, 2022 15:31
woc.log.Debugf("processing WorkflowArtifactGCTask %s", artifactGCTask.Name)

foundGCFailure := false
for nodeName, nodeResult := range artifactGCTask.Status.ArtifactResultsByNode {
// find this node result in the Workflow Status
wfNode, found := woc.wf.Status.Nodes[nodeName]
if !found {
return fmt.Errorf("node named '%s' returned by WorkflowArtifactGCTask '%s' wasn't found in Workflow '%s' Status", nodeName, artifactGCTask.Name, woc.wf.Name)
return false, fmt.Errorf("node named '%s' returned by WorkflowArtifactGCTask '%s' wasn't found in Workflow '%s' Status", nodeName, artifactGCTask.Name, woc.wf.Name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use %q?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to look that up. I guess it gives you a quoted string - good idea

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, just did a find and replace for all instances of '%s'

Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@terrytangyuan terrytangyuan enabled auto-merge (squash) November 13, 2022 18:30
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
@terrytangyuan terrytangyuan merged commit 55ad680 into argoproj:master Nov 14, 2022
@juliev0 juliev0 deleted the 9953-artgcfailure branch November 14, 2022 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants