Skip to content

Commit

Permalink
fix: fix lint issue
Browse files Browse the repository at this point in the history
Signed-off-by: machichima <[email protected]>
  • Loading branch information
machichima committed Dec 20, 2024
1 parent b7daee1 commit c3eed97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v

// If primaryContainerName is set in taskTemplate config, use it instead
// of c.Name
if val, ok := taskTemplate.Config[PrimaryContainerKey]; ok {
if val, ok := taskTemplate.GetConfig()[PrimaryContainerKey]; ok {
primaryContainerName = val
c.Name = primaryContainerName
} else {
Expand Down
18 changes: 9 additions & 9 deletions flyteplugins/go/tasks/plugins/k8s/spark/spark.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ func createSparkPodSpec(
config.GetK8sPluginConfig().DefaultLabels,
pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetLabels()),
)
if k8sPod != nil && k8sPod.Metadata != nil {
if k8sPod != nil && k8sPod.GetMetadata() != nil {
if k8sPod.Metadata.Annotations != nil {
annotations = pluginsUtils.UnionMaps(annotations, k8sPod.Metadata.Annotations)
annotations = pluginsUtils.UnionMaps(annotations, k8sPod.GetMetadata().GetAnnotations())
}
if k8sPod.Metadata.Labels != nil {
labels = pluginsUtils.UnionMaps(labels, k8sPod.Metadata.Labels)
labels = pluginsUtils.UnionMaps(labels, k8sPod.GetMetadata().GetLabels())
}
}

Expand Down Expand Up @@ -204,10 +204,10 @@ func createDriverSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCont
if driverPod != nil {
var customPodSpec *v1.PodSpec

err = utils.UnmarshalStructToObj(driverPod.PodSpec, &customPodSpec)
err = utils.UnmarshalStructToObj(driverPod.GetPodSpec(), &customPodSpec)
if err != nil {
return nil, errors.Errorf(errors.BadTaskSpecification,
"Unable to unmarshal pod spec [%v], Err: [%v]", driverPod.PodSpec, err.Error())
"Unable to unmarshal pod spec [%v], Err: [%v]", driverPod.GetPodSpec(), err.Error())
}

podSpec, err = flytek8s.MergePodSpecs(podSpec, customPodSpec, primaryContainerName, "")
Expand Down Expand Up @@ -247,14 +247,14 @@ func createExecutorSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCo
return nil, err
}

executorPod := sparkJob.ExecutorPod
executorPod := sparkJob.GetExecutorPod()
if executorPod != nil {
var customPodSpec *v1.PodSpec

err = utils.UnmarshalStructToObj(executorPod.PodSpec, &customPodSpec)
err = utils.UnmarshalStructToObj(executorPod.GetPodSpec(), &customPodSpec)
if err != nil {
return nil, errors.Errorf(errors.BadTaskSpecification,
"Unable to unmarshal pod spec [%v], Err: [%v]", executorPod.PodSpec, err.Error())
"Unable to unmarshal pod spec [%v], Err: [%v]", executorPod.GetPodSpec(), err.Error())
}

podSpec, err = flytek8s.MergePodSpecs(podSpec, customPodSpec, primaryContainerName, "")
Expand All @@ -267,7 +267,7 @@ func createExecutorSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCo
if err != nil {
return nil, err
}
sparkPodSpec := createSparkPodSpec(taskCtx, podSpec, primaryContainer, sparkJob.ExecutorPod)
sparkPodSpec := createSparkPodSpec(taskCtx, podSpec, primaryContainer, sparkJob.GetExecutorPod())
serviceAccountName := serviceAccountName(taskCtx.TaskExecutionMetadata())
spec := executorSpec{
primaryContainer,
Expand Down

0 comments on commit c3eed97

Please sign in to comment.