Skip to content

Commit cd2c860

Browse files
committed
Upgrade Kubernetes dependencies
Signed-off-by: Yuki Iwai <[email protected]>
1 parent 6d0d42c commit cd2c860

File tree

10 files changed

+15015
-628
lines changed

10 files changed

+15015
-628
lines changed

Makefile

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Copyright 2023 The Kubeflow Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
115
BIN_DIR=_output/cmd/bin
216
REPO_PATH="github.com/kubeflow/mpi-operator"
317
REL_OSARCH="linux/amd64"
@@ -13,17 +27,19 @@ LD_FLAGS_V2=" \
1327
-X '${REPO_PATH}/v2/pkg/version.Version=${RELEASE_VERSION}'"
1428
IMAGE_NAME?=mpioperator/mpi-operator
1529
KUBEBUILDER_ASSETS_PATH := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))bin/kubebuilder/bin
16-
KIND_VERSION=v0.11.1
30+
KIND_VERSION=v0.17.0
1731
# This kubectl version supports -k for kustomization.
18-
KUBECTL_VERSION=v1.21.4
19-
32+
KUBECTL_VERSION=v1.25.5
33+
ENVTEST_K8S_VERSION=1.25.0
2034
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
35+
GOARCH=$(shell go env GOARCH)
36+
GOOS=$(shell go env GOOS)
2137

2238
CRD_OPTIONS ?= "crd:trivialVersions=true,preserveUnknownFields=false"
2339

2440
build: all
2541

26-
all: ${BIN_DIR} fmt tidy lint test mpi-operator.v2
42+
all: ${BIN_DIR} fmt vet tidy lint test mpi-operator.v2
2743

2844
.PHONY: mpi-operator.v2
2945
mpi-operator.v2:
@@ -36,10 +52,14 @@ ${BIN_DIR}:
3652
fmt:
3753
go fmt ./...
3854

55+
.PHONY: vet
56+
vet:
57+
go vet ./...
58+
3959
.PHONY: test
40-
test: export KUBEBUILDER_ASSETS = ${KUBEBUILDER_ASSETS_PATH}
41-
test: bin/kubebuilder
42-
go test -covermode atomic -coverprofile=profile.cov ./...
60+
test:
61+
test: bin/envtest
62+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -covermode atomic -coverprofile=profile.cov ./...
4363

4464
# Only works with CONTROLLER_VERSION=v2
4565
.PHONY: test_e2e
@@ -80,50 +100,38 @@ test_images:
80100
tidy:
81101
go mod tidy -go 1.19
82102

83-
GOLANGCI_LINT = ./bin/golangci-lint
84-
bin/golangci-lint:
85-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.50.1
86-
87-
GOOS := $(shell go env GOOS)
88-
GOARCH := $(shell go env GOARCH)
89-
K8S_VERSION := "1.19.2"
90-
bin/kubebuilder:
91-
curl -sSLo envtest-bins.tar.gz "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-${K8S_VERSION}-${GOOS}-${GOARCH}.tar.gz"
92-
mkdir -p bin/kubebuilder
93-
tar -C bin/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz
94-
rm envtest-bins.tar.gz
95-
96-
bin/kubectl:
97-
mkdir -p bin
98-
curl -L -o bin/kubectl https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
99-
chmod +x bin/kubectl
100-
101103
.PHONY: lint
102104
lint: bin/golangci-lint ## Run golangci-lint linter
103105
$(GOLANGCI_LINT) run --new-from-rev=origin/master --go 1.19
104106

105-
.PHONY: kind
106-
kind:
107-
go install sigs.k8s.io/kind@${KIND_VERSION}
108-
109107
# Generate CRD
110108
crd: controller-gen
111109
$(CONTROLLER_GEN) $(CRD_OPTIONS) paths="./..." output:crd:artifacts:config=crd
112110

111+
.PHONY: bin
112+
bin:
113+
mkdir -p $(PROJECT_DIR)/bin
114+
115+
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
116+
.PHONY: bin/golangci-lint
117+
bin/golangci-lint: bin
118+
@GOBIN=$(PROJECT_DIR)/bin go install github.com/golangci/golangci-lint/cmd/[email protected]
119+
120+
ENVTEST = $(shell pwd)/bin/setup-envtest
121+
.PHONY: envtest
122+
bin/envtest: bin ## Download envtest-setup locally if necessary.
123+
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
124+
125+
bin/kubectl: bin
126+
curl -L -o $(PROJECT_DIR)/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/$(GOOS)/$(GOARCH)/kubectl
127+
chmod +x $(PROJECT_DIR)/bin/kubectl
128+
129+
.PHONY: kind
130+
kind: bin
131+
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/kind@${KIND_VERSION}
132+
113133
# Download controller-gen locally if necessary
114134
CONTROLLER_GEN = $(PROJECT_DIR)/bin/controller-gen
115-
controller-gen:
116-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/[email protected])
117-
118-
# go-get-tool will 'go get' any package $2 and install it to $1.
119-
define go-get-tool
120-
@[ -f $(1) ] || { \
121-
set -e ;\
122-
TMP_DIR=$$(mktemp -d) ;\
123-
cd $$TMP_DIR ;\
124-
go mod init tmp ;\
125-
echo "Downloading $(2)" ;\
126-
GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\
127-
rm -rf $$TMP_DIR ;\
128-
}
129-
endef
135+
.PHONY: controller-gen
136+
controller-gen: bin
137+
@GOBIN=$(PROJECT_DIR)/bin go install sigs.k8s.io/controller-tools/cmd/[email protected]

cmd/mpi-operator/app/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ func Run(opt *options.ServerOption) error {
207207
}
208208
}()
209209

210-
rl := &resourcelock.EndpointsLock{
211-
EndpointsMeta: metav1.ObjectMeta{
210+
rl := &resourcelock.LeaseLock{
211+
LeaseMeta: metav1.ObjectMeta{
212212
Namespace: opt.LockNamespace,
213213
Name: controllerName,
214214
},
215-
Client: leaderElectionClientSet.CoreV1(),
215+
Client: leaderElectionClientSet.CoordinationV1(),
216216
LockConfig: resourcelock.ResourceLockConfig{
217217
Identity: id,
218218
EventRecorder: recorder,

go.mod

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,78 @@ module github.com/kubeflow/mpi-operator/v2
33
go 1.19
44

55
require (
6-
github.com/go-openapi/spec v0.20.3
7-
github.com/google/go-cmp v0.5.6
8-
github.com/kubeflow/common v0.4.0
9-
github.com/onsi/ginkgo v1.14.1
10-
github.com/onsi/gomega v1.10.2
11-
github.com/prometheus/client_golang v1.10.0
12-
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e
13-
k8s.io/api v0.19.9
14-
k8s.io/apimachinery v0.19.9
15-
k8s.io/apiserver v0.19.9
16-
k8s.io/client-go v0.19.9
6+
github.com/google/go-cmp v0.5.8
7+
github.com/kubeflow/common v0.4.3
8+
github.com/onsi/ginkgo v1.16.5
9+
github.com/onsi/gomega v1.20.1
10+
github.com/prometheus/client_golang v1.12.2
11+
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
12+
k8s.io/api v0.25.5
13+
k8s.io/apimachinery v0.25.5
14+
k8s.io/apiserver v0.25.5
15+
k8s.io/client-go v0.25.5
16+
k8s.io/code-generator v0.25.5
1717
k8s.io/klog v1.0.0
18-
k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6
19-
k8s.io/sample-controller v0.19.9
20-
sigs.k8s.io/controller-runtime v0.7.2
21-
volcano.sh/apis v1.2.0-k8s1.19.6
18+
k8s.io/kube-openapi v0.0.0-20230109183929-3758b55a6596
19+
k8s.io/sample-controller v0.25.5
20+
sigs.k8s.io/controller-runtime v0.13.1
21+
volcano.sh/apis v1.7.0
2222
)
2323

2424
require (
25-
github.com/PuerkitoBio/purell v1.1.1 // indirect
26-
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
2725
github.com/beorn7/perks v1.0.1 // indirect
28-
github.com/blang/semver v3.5.0+incompatible // indirect
29-
github.com/cespare/xxhash/v2 v2.1.1 // indirect
26+
github.com/blang/semver/v4 v4.0.0 // indirect
27+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
3028
github.com/davecgh/go-spew v1.1.1 // indirect
31-
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
32-
github.com/evanphx/json-patch v4.9.0+incompatible // indirect
33-
github.com/fsnotify/fsnotify v1.4.9 // indirect
34-
github.com/go-logr/logr v0.3.0 // indirect
35-
github.com/go-openapi/jsonpointer v0.19.5 // indirect
36-
github.com/go-openapi/jsonreference v0.19.5 // indirect
37-
github.com/go-openapi/swag v0.19.14 // indirect
38-
github.com/gogo/protobuf v1.3.1 // indirect
39-
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7 // indirect
40-
github.com/golang/protobuf v1.4.3 // indirect
29+
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
30+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
31+
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
32+
github.com/fsnotify/fsnotify v1.5.4 // indirect
33+
github.com/go-logr/logr v1.2.3 // indirect
34+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
35+
github.com/go-openapi/jsonreference v0.20.1 // indirect
36+
github.com/go-openapi/swag v0.22.3 // indirect
37+
github.com/gogo/protobuf v1.3.2 // indirect
38+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
39+
github.com/golang/protobuf v1.5.2 // indirect
40+
github.com/google/gnostic v0.5.7-v3refs // indirect
4141
github.com/google/gofuzz v1.1.0 // indirect
42-
github.com/google/uuid v1.1.1 // indirect
43-
github.com/googleapis/gnostic v0.5.1 // indirect
44-
github.com/hashicorp/golang-lru v0.5.4 // indirect
45-
github.com/imdario/mergo v0.3.10 // indirect
42+
github.com/google/uuid v1.1.2 // indirect
43+
github.com/imdario/mergo v0.3.12 // indirect
4644
github.com/josharian/intern v1.0.0 // indirect
47-
github.com/json-iterator/go v1.1.10 // indirect
48-
github.com/mailru/easyjson v0.7.6 // indirect
45+
github.com/json-iterator/go v1.1.12 // indirect
46+
github.com/mailru/easyjson v0.7.7 // indirect
4947
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
5048
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
51-
github.com/modern-go/reflect2 v1.0.1 // indirect
52-
github.com/nxadm/tail v1.4.4 // indirect
49+
github.com/modern-go/reflect2 v1.0.2 // indirect
50+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
51+
github.com/nxadm/tail v1.4.8 // indirect
5352
github.com/pkg/errors v0.9.1 // indirect
5453
github.com/prometheus/client_model v0.2.0 // indirect
55-
github.com/prometheus/common v0.18.0 // indirect
56-
github.com/prometheus/procfs v0.6.0 // indirect
54+
github.com/prometheus/common v0.32.1 // indirect
55+
github.com/prometheus/procfs v0.7.3 // indirect
5756
github.com/spf13/pflag v1.0.5 // indirect
58-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
59-
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect
60-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
61-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
62-
golang.org/x/text v0.3.5 // indirect
63-
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
64-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
65-
gomodules.xyz/jsonpatch/v2 v2.1.0 // indirect
66-
google.golang.org/appengine v1.6.6 // indirect
67-
google.golang.org/protobuf v1.24.0 // indirect
57+
golang.org/x/mod v0.7.0 // indirect
58+
golang.org/x/net v0.4.0 // indirect
59+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect
60+
golang.org/x/sys v0.3.0 // indirect
61+
golang.org/x/term v0.3.0 // indirect
62+
golang.org/x/text v0.5.0 // indirect
63+
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
64+
golang.org/x/tools v0.4.0 // indirect
65+
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
66+
google.golang.org/appengine v1.6.7 // indirect
67+
google.golang.org/protobuf v1.28.0 // indirect
6868
gopkg.in/inf.v0 v0.9.1 // indirect
6969
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
7070
gopkg.in/yaml.v2 v2.4.0 // indirect
71-
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
72-
k8s.io/apiextensions-apiserver v0.19.2 // indirect
73-
k8s.io/component-base v0.19.9 // indirect
74-
k8s.io/klog/v2 v2.2.0 // indirect
75-
k8s.io/utils v0.0.0-20200912215256-4140de9c8800 // indirect
76-
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 // indirect
77-
sigs.k8s.io/yaml v1.2.0 // indirect
71+
gopkg.in/yaml.v3 v3.0.1 // indirect
72+
k8s.io/apiextensions-apiserver v0.25.0 // indirect
73+
k8s.io/component-base v0.25.5 // indirect
74+
k8s.io/gengo v0.0.0-20211129171323-c02415ce4185 // indirect
75+
k8s.io/klog/v2 v2.70.1 // indirect
76+
k8s.io/utils v0.0.0-20220728103510-ee6ede2d64ed // indirect
77+
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
78+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
79+
sigs.k8s.io/yaml v1.3.0 // indirect
7880
)
79-
80-
replace k8s.io/code-generator => k8s.io/code-generator v0.19.9

0 commit comments

Comments
 (0)