-
Notifications
You must be signed in to change notification settings - Fork 688
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 pod template override error #6224
Conversation
Signed-off-by: Nelson Chen <[email protected]>
Code Review Agent Run #bbe101Actionable Suggestions - 1
Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
@@ -289,7 +289,7 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v | |||
|
|||
// handle pod template override | |||
podTemplate := tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate() | |||
if tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate() != nil { | |||
if podTemplate.GetPodSpec() != nil { |
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.
Consider checking if podTemplate
is not nil before accessing its methods. The current code could panic if podTemplate
is nil.
Code suggestion
Check the AI-generated fix before applying
if podTemplate.GetPodSpec() != nil { | |
if podTemplate != nil && podTemplate.GetPodSpec() != nil { |
Code Review Run #bbe101
Is this a valid issue, or was it incorrectly flagged by the Agent?
- it was incorrectly flagged
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6224 +/- ##
=======================================
Coverage 36.85% 36.86%
=======================================
Files 1318 1318
Lines 134534 134534
=======================================
+ Hits 49586 49592 +6
+ Misses 80627 80621 -6
Partials 4321 4321
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Tracking issue
#5683
Why are the changes needed?
An error occurs when running a workflow because of this error.
Workflow[flytesnacks:development:dynamic.dynamic_wf] failed. RuntimeExecutionError: max number of system retry attempts [11/10] exhausted. Last known status message: failed at Node[n0]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [container]: nil Struct Object passed
![Screenshot 2025-02-06 at 11 07 01 AM](https://private-user-images.githubusercontent.com/26268253/410270398-69c01995-a7c1-40b9-9c10-3da95e5fb8e1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNDUyMjYsIm5iZiI6MTczOTI0NDkyNiwicGF0aCI6Ii8yNjI2ODI1My80MTAyNzAzOTgtNjljMDE5OTUtYTdjMS00MGI5LTljMTAtM2RhOTVlNWZiOGUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDAzMzUyNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI1ZGNjZDQwYmVmOTU5YzU1ODJmZDBmM2VlYzU4NGFjZDkyZTk1NDg5MzZkYjY3OGVlYThkNDYzOGVhYTBiNzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1Tno88aWGFqnaGylAi2hBEkKDQ3wHzDKnzEYYg42f4w)
What changes were proposed in this pull request?
Accessing PodTemplate correctly.
How was this patch tested?
Labels
Please add one or more of the following labels to categorize your PR:
This is important to improve the readability of release notes.
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This PR addresses a critical workflow execution error by implementing proper pod template validation. The fix modifies pod helper logic to ensure safe PodSpec access, preventing system retry exhaustion errors. The change introduces additional nil checks to prevent potential crashes.Unit tests added: False
Estimated effort to review (1-5, lower is better): 1