Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Dye <[email protected]>
  • Loading branch information
andrewwdye committed Oct 10, 2023
1 parent 6fc00ea commit 94cbc22
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions flyteplugins/go/tasks/plugins/k8s/spark/spark.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ func serviceAccountName(metadata pluginsCore.TaskExecutionMetadata) string {
return name
}

func createSparkPodSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionContext, podSpec *v1.PodSpec, container *v1.Container) (
*sparkOp.SparkPodSpec, error) {
func createSparkPodSpec(taskCtx pluginsCore.TaskExecutionContext, podSpec *v1.PodSpec, container *v1.Container) *sparkOp.SparkPodSpec {
annotations := utils.UnionMaps(config.GetK8sPluginConfig().DefaultAnnotations, utils.CopyMap(taskCtx.TaskExecutionMetadata().GetAnnotations()))
labels := utils.UnionMaps(config.GetK8sPluginConfig().DefaultLabels, utils.CopyMap(taskCtx.TaskExecutionMetadata().GetLabels()))

Expand All @@ -165,7 +164,7 @@ func createSparkPodSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCo
NodeSelector: podSpec.NodeSelector,
HostNetwork: &podSpec.HostNetwork,
}
return &spec, nil
return &spec
}

type driverSpec struct {
Expand All @@ -183,10 +182,7 @@ func createDriverSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCont
if err != nil {
return nil, err
}

Check warning on line 184 in flyteplugins/go/tasks/plugins/k8s/spark/spark.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/plugins/k8s/spark/spark.go#L183-L184

Added lines #L183 - L184 were not covered by tests
sparkPodSpec, err := createSparkPodSpec(ctx, nonInterruptibleTaskCtx, podSpec, primaryContainer)
if err != nil {
return nil, err
}
sparkPodSpec := createSparkPodSpec(nonInterruptibleTaskCtx, podSpec, primaryContainer)
serviceAccountName := serviceAccountName(nonInterruptibleTaskCtx.TaskExecutionMetadata())
spec := driverSpec{
&sparkOp.DriverSpec{
Expand Down Expand Up @@ -216,10 +212,7 @@ func createExecutorSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCo
if err != nil {
return nil, err
}

Check warning on line 214 in flyteplugins/go/tasks/plugins/k8s/spark/spark.go

View check run for this annotation

Codecov / codecov/patch

flyteplugins/go/tasks/plugins/k8s/spark/spark.go#L213-L214

Added lines #L213 - L214 were not covered by tests
sparkPodSpec, err := createSparkPodSpec(ctx, taskCtx, podSpec, primaryContainer)
if err != nil {
return nil, err
}
sparkPodSpec := createSparkPodSpec(taskCtx, podSpec, primaryContainer)
serviceAccountName := serviceAccountName(taskCtx.TaskExecutionMetadata())
spec := executorSpec{
primaryContainer,
Expand Down

0 comments on commit 94cbc22

Please sign in to comment.