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

Prevent nil pointer in pod helper #6225

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Feb 6, 2025

Tracking issue

#5683

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

Implementation of additional null pointer checks in pod_helper.go to prevent potential nil pointer dereferences when accessing podTemplate.GetPodSpec(). This defensive programming enhancement improves system stability by preventing runtime crashes from null pointer exceptions.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

@flyte-bot
Copy link
Collaborator

flyte-bot commented Feb 6, 2025

Code Review Agent Run #c653a1

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 2043b6a..2043b6a
    • flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go
  • Files skipped - 0
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

@Future-Outlier Future-Outlier enabled auto-merge (squash) February 6, 2025 03:52
@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Pod Template Null Check Enhancement

pod_helper.go - Added null check for podTemplate before accessing GetPodSpec()

Copy link

codecov bot commented Feb 6, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.86%. Comparing base (66d7257) to head (2043b6a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ns/go/tasks/pluginmachinery/flytek8s/pod_helper.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6225   +/-   ##
=======================================
  Coverage   36.85%   36.86%           
=======================================
  Files        1318     1318           
  Lines      134534   134534           
=======================================
+ Hits        49585    49592    +7     
+ Misses      80628    80621    -7     
  Partials     4321     4321           
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 51.94% <ø> (+0.02%) ⬆️
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.23% <ø> (ø)
unittests-flyteplugins 53.91% <50.00%> (ø)
unittests-flytepropeller 42.78% <ø> (ø)
unittests-flytestdlib 55.35% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Future-Outlier Future-Outlier merged commit b5443c8 into master Feb 6, 2025
53 checks passed
@Future-Outlier Future-Outlier deleted the pod-template-error-handling branch February 6, 2025 04:37
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.

3 participants