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
Conversation
…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>
if !found { | ||
return fmt.Errorf("Artifact GC Pod '%s' doesn't have annotation '%s'?", pod.Name, common.AnnotationKeyArtifactGCStrategy) | ||
} | ||
strategy := wfv1.ArtifactGCStrategy(strategyStr) |
There was a problem hiding this comment.
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) | ||
} |
There was a problem hiding this comment.
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
workflow/controller/artifact_gc.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use %q?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Signed-off-by: Julie Vogelman <julie_vogelman@intuit.com>
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:
make pre-commit -B
to fix codegen and lint problems.If changes were requested, and you've made them, dismiss the review to get it reviewed again.