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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@

// handle pod template override
podTemplate := tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate()
if podTemplate.GetPodSpec() != nil {
if podTemplate != nil && podTemplate.GetPodSpec() != nil {
podSpec, objectMeta, err = ApplyPodTemplateOverride(objectMeta, podTemplate)
if err != nil {
return nil, nil, "", err
Expand Down Expand Up @@ -325,7 +325,7 @@

// handle pod template override
podTemplate := tCtx.TaskExecutionMetadata().GetOverrides().GetPodTemplate()
if podTemplate.GetPodSpec() != nil {
if podTemplate != nil && podTemplate.GetPodSpec() != nil {

Check warning on line 328 in flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go#L328

Added line #L328 was not covered by tests
podSpec, objectMeta, err = ApplyPodTemplateOverride(objectMeta, podTemplate)
if err != nil {
return nil, nil, "", err
Expand Down
Loading