Skip to content

Commit 70cfdff

Browse files
committed
fix: fix lint issue
Signed-off-by: machichima <nary12321@gmail.com>
1 parent b7daee1 commit 70cfdff

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func BuildRawPod(ctx context.Context, tCtx pluginsCore.TaskExecutionContext) (*v
282282

283283
// If primaryContainerName is set in taskTemplate config, use it instead
284284
// of c.Name
285-
if val, ok := taskTemplate.Config[PrimaryContainerKey]; ok {
285+
if val, ok := taskTemplate.GetConfig()[PrimaryContainerKey]; ok {
286286
primaryContainerName = val
287287
c.Name = primaryContainerName
288288
} else {

flyteplugins/go/tasks/plugins/k8s/spark/spark.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ func createSparkPodSpec(
157157
config.GetK8sPluginConfig().DefaultLabels,
158158
pluginsUtils.CopyMap(taskCtx.TaskExecutionMetadata().GetLabels()),
159159
)
160-
if k8sPod != nil && k8sPod.Metadata != nil {
160+
if k8sPod != nil && k8sPod.GetMetadata() != nil {
161161
if k8sPod.Metadata.Annotations != nil {
162-
annotations = pluginsUtils.UnionMaps(annotations, k8sPod.Metadata.Annotations)
162+
annotations = pluginsUtils.UnionMaps(annotations, k8sPod.GetMetadata().GetAnnotations())
163163
}
164164
if k8sPod.Metadata.Labels != nil {
165-
labels = pluginsUtils.UnionMaps(labels, k8sPod.Metadata.Labels)
165+
labels = pluginsUtils.UnionMaps(labels, k8sPod.GetMetadata().GetLabels())
166166
}
167167
}
168168

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

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

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

250-
executorPod := sparkJob.ExecutorPod
250+
executorPod := sparkJob.GetExecutorPod()
251251
if executorPod != nil {
252252
var customPodSpec *v1.PodSpec
253253

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

260260
podSpec, err = flytek8s.MergePodSpecs(podSpec, customPodSpec, primaryContainerName, "")
@@ -267,7 +267,7 @@ func createExecutorSpec(ctx context.Context, taskCtx pluginsCore.TaskExecutionCo
267267
if err != nil {
268268
return nil, err
269269
}
270-
sparkPodSpec := createSparkPodSpec(taskCtx, podSpec, primaryContainer, sparkJob.ExecutorPod)
270+
sparkPodSpec := createSparkPodSpec(taskCtx, podSpec, primaryContainer, sparkJob.GetExecutorPod())
271271
serviceAccountName := serviceAccountName(taskCtx.TaskExecutionMetadata())
272272
spec := executorSpec{
273273
primaryContainer,

flyteplugins/go/tasks/plugins/k8s/spark/spark_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010

1111
sj "github.com/GoogleCloudPlatform/spark-on-k8s-operator/pkg/apis/sparkoperator.k8s.io/v1beta2"
1212
sparkOp "github.com/GoogleCloudPlatform/spark-on-k8s-operator/pkg/apis/sparkoperator.k8s.io/v1beta2"
13-
// NOTE: this import also use things inside google.golang structpb one
14-
// structpb "github.com/golang/protobuf/ptypes/struct"
1513
"github.com/stretchr/testify/assert"
1614
"github.com/stretchr/testify/mock"
1715
"google.golang.org/protobuf/types/known/structpb"

0 commit comments

Comments
 (0)