Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Commit 7987f33

Browse files
authored
Go 1.16 -> Go 1.18 (#266)
Signed-off-by: Sean Lin <sean@union.ai>
1 parent 6dc5f39 commit 7987f33

File tree

6 files changed

+114
-42
lines changed

6 files changed

+114
-42
lines changed

flyteplugins/.github/workflows/master.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Set up Go
3535
uses: actions/setup-go@v2
3636
with:
37-
go-version: 1.14
37+
go-version: '1.18'
3838
- name: Run GoReleaser
3939
uses: goreleaser/goreleaser-action@v2
4040
with:
@@ -50,20 +50,12 @@ jobs:
5050
with:
5151
fetch-depth: "0"
5252
- name: Unit Tests
53-
uses: cedrickring/golang-action@1.7.0
54-
env:
55-
GO111MODULE: "on"
56-
with:
57-
args: make install && make test_unit_codecov
53+
run: make install && make test_unit_codecov
5854
- name: Push CodeCov
5955
uses: codecov/codecov-action@v1
6056
with:
6157
file: coverage.txt
6258
flags: unittests
6359
fail_ci_if_error: true
6460
- name: Lint
65-
uses: cedrickring/golang-action@1.7.0
66-
env:
67-
GO111MODULE: "on"
68-
with:
69-
args: make install && make lint
61+
run: make install && make lint

flyteplugins/.github/workflows/pull_request.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,27 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v2
12-
- name: Unit Tests
13-
uses: cedrickring/golang-action@1.7.0
14-
env:
15-
GO111MODULE: "on"
12+
- name: Set up Go
13+
uses: actions/setup-go@v2
1614
with:
17-
args: make install && make test_unit_codecov
15+
go-version: '1.18'
16+
- name: Unit Tests
17+
run: make install && make test_unit_codecov
1818
- name: Push CodeCov
1919
uses: codecov/codecov-action@v1
2020
with:
2121
file: coverage.txt
2222
flags: unittests
2323
fail_ci_if_error: true
2424
- name: Lint
25-
uses: cedrickring/golang-action@1.7.0
26-
env:
27-
GO111MODULE: "on"
28-
with:
29-
args: make install && make lint
25+
run: make install && make lint
3026

3127
generate:
3228
runs-on: ubuntu-latest
3329
steps:
3430
- uses: actions/checkout@v1
3531
- uses: actions/setup-go@v2
3632
with:
37-
go-version: '1.16'
33+
go-version: '1.18'
3834
- name: Go generate and diff
3935
run: DELTA_CHECK=true make generate

flyteplugins/go.mod

Lines changed: 98 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
module github.com/flyteorg/flyteplugins
22

3-
go 1.16
3+
go 1.18
44

55
require (
6-
cloud.google.com/go v0.78.0 // indirect
76
github.com/GoogleCloudPlatform/spark-on-k8s-operator v0.0.0-20200723154620-6f35a1152625
87
github.com/Masterminds/semver v1.5.0
9-
github.com/adammck/venv v0.0.0-20200610172036-e77789703e7c // indirect
108
github.com/aws/amazon-sagemaker-operator-for-k8s v1.0.1-0.20210303003444-0fb33b1fd49d
119
github.com/aws/aws-sdk-go v1.37.3
1210
github.com/aws/aws-sdk-go-v2 v1.2.0
@@ -15,11 +13,8 @@ require (
1513
github.com/coocood/freecache v1.1.1
1614
github.com/flyteorg/flyteidl v1.0.0
1715
github.com/flyteorg/flytestdlib v1.0.0
18-
github.com/go-logr/zapr v0.4.0 // indirect
1916
github.com/go-test/deep v1.0.7
2017
github.com/golang/protobuf v1.4.3
21-
github.com/google/gofuzz v1.2.0 // indirect
22-
github.com/google/uuid v1.2.0 // indirect
2318
github.com/hashicorp/golang-lru v0.5.4
2419
github.com/imdario/mergo v0.3.11
2520
github.com/kubeflow/common v0.4.0
@@ -32,12 +27,8 @@ require (
3227
github.com/prometheus/client_golang v1.10.0
3328
github.com/spf13/pflag v1.0.5
3429
github.com/stretchr/testify v1.7.0
35-
go.uber.org/multierr v1.6.0 // indirect
36-
go.uber.org/zap v1.16.0 // indirect
3730
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f
3831
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93
39-
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
40-
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
4132
google.golang.org/api v0.40.0
4233
google.golang.org/grpc v1.35.0
4334
google.golang.org/protobuf v1.25.0
@@ -49,4 +40,101 @@ require (
4940
sigs.k8s.io/controller-runtime v0.8.2
5041
)
5142

43+
require (
44+
cloud.google.com/go v0.78.0 // indirect
45+
cloud.google.com/go/storage v1.12.0 // indirect
46+
github.com/Azure/azure-sdk-for-go v62.3.0+incompatible // indirect
47+
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1 // indirect
48+
github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 // indirect
49+
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0 // indirect
50+
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
51+
github.com/Azure/go-autorest/autorest v0.11.17 // indirect
52+
github.com/Azure/go-autorest/autorest/adal v0.9.10 // indirect
53+
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
54+
github.com/Azure/go-autorest/logger v0.2.0 // indirect
55+
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
56+
github.com/PuerkitoBio/purell v1.1.1 // indirect
57+
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
58+
github.com/adammck/venv v0.0.0-20200610172036-e77789703e7c // indirect
59+
github.com/aws/aws-sdk-go-v2/credentials v1.0.0 // indirect
60+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.0 // indirect
61+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.0 // indirect
62+
github.com/aws/aws-sdk-go-v2/service/sts v1.0.0 // indirect
63+
github.com/aws/smithy-go v1.1.0 // indirect
64+
github.com/beorn7/perks v1.0.1 // indirect
65+
github.com/cespare/xxhash v1.1.0 // indirect
66+
github.com/cespare/xxhash/v2 v2.1.1 // indirect
67+
github.com/davecgh/go-spew v1.1.1 // indirect
68+
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
69+
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
70+
github.com/fatih/color v1.10.0 // indirect
71+
github.com/flyteorg/stow v0.3.3 // indirect
72+
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
73+
github.com/fsnotify/fsnotify v1.4.9 // indirect
74+
github.com/ghodss/yaml v1.0.0 // indirect
75+
github.com/go-logr/logr v0.4.0 // indirect
76+
github.com/go-logr/zapr v0.4.0 // indirect
77+
github.com/go-openapi/jsonpointer v0.19.5 // indirect
78+
github.com/go-openapi/jsonreference v0.19.5 // indirect
79+
github.com/go-openapi/spec v0.20.3 // indirect
80+
github.com/go-openapi/swag v0.19.14 // indirect
81+
github.com/gofrs/uuid v4.2.0+incompatible // indirect
82+
github.com/gogo/protobuf v1.3.2 // indirect
83+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
84+
github.com/google/go-cmp v0.5.6 // indirect
85+
github.com/google/gofuzz v1.2.0 // indirect
86+
github.com/google/uuid v1.2.0 // indirect
87+
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
88+
github.com/googleapis/gnostic v0.5.1 // indirect
89+
github.com/hashicorp/hcl v1.0.0 // indirect
90+
github.com/inconshreveable/mousetrap v1.0.0 // indirect
91+
github.com/jmespath/go-jmespath v0.4.0 // indirect
92+
github.com/josharian/intern v1.0.0 // indirect
93+
github.com/json-iterator/go v1.1.10 // indirect
94+
github.com/jstemmer/go-junit-report v0.9.1 // indirect
95+
github.com/mailru/easyjson v0.7.6 // indirect
96+
github.com/mattn/go-colorable v0.1.8 // indirect
97+
github.com/mattn/go-isatty v0.0.12 // indirect
98+
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
99+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
100+
github.com/modern-go/reflect2 v1.0.1 // indirect
101+
github.com/ncw/swift v1.0.53 // indirect
102+
github.com/pelletier/go-toml v1.8.1 // indirect
103+
github.com/pmezard/go-difflib v1.0.0 // indirect
104+
github.com/prometheus/client_model v0.2.0 // indirect
105+
github.com/prometheus/common v0.18.0 // indirect
106+
github.com/prometheus/procfs v0.6.0 // indirect
107+
github.com/sirupsen/logrus v1.7.0 // indirect
108+
github.com/spf13/afero v1.5.1 // indirect
109+
github.com/spf13/cast v1.3.1 // indirect
110+
github.com/spf13/cobra v1.1.1 // indirect
111+
github.com/spf13/jwalterweatherman v1.1.0 // indirect
112+
github.com/spf13/viper v1.7.1 // indirect
113+
github.com/stretchr/objx v0.3.0 // indirect
114+
github.com/subosito/gotenv v1.2.0 // indirect
115+
go.opencensus.io v0.22.6 // indirect
116+
go.uber.org/atomic v1.7.0 // indirect
117+
go.uber.org/multierr v1.6.0 // indirect
118+
go.uber.org/zap v1.16.0 // indirect
119+
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
120+
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 // indirect
121+
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
122+
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect
123+
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d // indirect
124+
golang.org/x/text v0.3.7 // indirect
125+
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect
126+
golang.org/x/tools v0.1.10 // indirect
127+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
128+
google.golang.org/appengine v1.6.7 // indirect
129+
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c // indirect
130+
gopkg.in/inf.v0 v0.9.1 // indirect
131+
gopkg.in/ini.v1 v1.62.0 // indirect
132+
gopkg.in/yaml.v2 v2.4.0 // indirect
133+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
134+
k8s.io/klog/v2 v2.5.0 // indirect
135+
k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect
136+
sigs.k8s.io/structured-merge-diff/v4 v4.0.3 // indirect
137+
sigs.k8s.io/yaml v1.2.0 // indirect
138+
)
139+
52140
replace github.com/aws/amazon-sagemaker-operator-for-k8s => github.com/aws/amazon-sagemaker-operator-for-k8s v1.0.1-0.20210303003444-0fb33b1fd49d

flyteplugins/go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,6 @@ k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8
13311331
k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
13321332
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
13331333
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
1334-
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
13351334
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
13361335
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
13371336
k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y=

flyteplugins/go/tasks/pluginmachinery/flytek8s/k8s_resource_adds_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package flytek8s
22

33
import (
44
"context"
5-
"fmt"
65
"os"
76
"reflect"
87
"testing"
@@ -250,7 +249,7 @@ func TestDecorateEnvVars(t *testing.T) {
250249
originalEnvVal := os.Getenv("value")
251250
err := os.Setenv("value", "v")
252251
if err != nil {
253-
t.Fatal(fmt.Sprintf("failed to set env var 'value'; %v", err))
252+
t.Fatalf("failed to set env var 'value'; %v", err)
254253
}
255254
defer os.Setenv("value", originalEnvVal)
256255

flyteplugins/go/tasks/plugins/array/k8s/subtask_exec_context.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ func NewSubTaskExecutionContext(ctx context.Context, tCtx pluginsCore.TaskExecut
6363
subtaskTemplate := &core.TaskTemplate{}
6464
*subtaskTemplate = *taskTemplate
6565

66-
if subtaskTemplate != nil {
67-
subtaskTemplate.TaskTypeVersion = 2
68-
if subtaskTemplate.GetContainer() != nil {
69-
subtaskTemplate.Type = podPlugin.ContainerTaskType
70-
} else if taskTemplate.GetK8SPod() != nil {
71-
subtaskTemplate.Type = podPlugin.SidecarTaskType
72-
}
66+
subtaskTemplate.TaskTypeVersion = 2
67+
if subtaskTemplate.GetContainer() != nil {
68+
subtaskTemplate.Type = podPlugin.ContainerTaskType
69+
} else if taskTemplate.GetK8SPod() != nil {
70+
subtaskTemplate.Type = podPlugin.SidecarTaskType
7371
}
7472

7573
arrayInputReader := array.GetInputReader(tCtx, taskTemplate)

0 commit comments

Comments
 (0)