Skip to content

Commit

Permalink
Prevent nil pointer in pod helper (#6225)
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier authored Feb 6, 2025
1 parent 66d7257 commit b5443c8
Showing 1 changed file with 2 additions and 2 deletions.
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 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v

// 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 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v

// 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

0 comments on commit b5443c8

Please sign in to comment.