Skip to content

Commit 68317e3

Browse files
authored
feat(platform): update client go to 1.24 (#2237)
* feat(platform): update client go to 1.24 * feat(platform): rollback some logic
1 parent 4f62a48 commit 68317e3

File tree

73 files changed

+12922
-9935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+12922
-9935
lines changed

api/openapi/zz_generated.openapi.go

Lines changed: 11863 additions & 9289 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/golang.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ endif
8585
.PHONY: go.lint
8686
go.lint: go.lint.verify
8787
@echo "===========> Run golangci to lint source codes"
88+
@ go version
8889
@golangci-lint run $(ROOT_DIR)/...
8990

9091
.PHONY: go.test.verify

cmd/tke-application-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4949
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5050
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5151
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, application.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5353
return err
5454
}
5555

cmd/tke-auth-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4949
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5050
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5151
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, auth.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5353
return err
5454
}
5555

cmd/tke-authz-controller/app/run.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"context"
2323
"os"
2424
"time"
25+
2526
"tkestack.io/tke/api/authz"
2627

2728
"k8s.io/apimachinery/pkg/util/uuid"
@@ -49,7 +50,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4950
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5051
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5152
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, authz.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
53+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5354
return err
5455
}
5556

cmd/tke-business-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4949
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5050
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5151
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, business.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5353
return err
5454
}
5555

cmd/tke-installer/app/installer/application.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ func (t *TKE) installApplication(ctx context.Context, expansionApp *types.Expans
147147

148148
app := &applicationv1.App{
149149
ObjectMeta: metav1.ObjectMeta{
150-
Namespace: chart.TargetNamespace,
151-
ClusterName: chart.TargetCluster,
150+
Namespace: chart.TargetNamespace,
151+
ZZZ_DeprecatedClusterName: chart.TargetCluster,
152152
},
153153
Spec: applicationv1.AppSpec{
154154
Type: constants.DefaultApplicationInstallDriverType,

cmd/tke-logagent-controller/app/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ package app
2020

2121
import (
2222
"context"
23-
"k8s.io/apimachinery/pkg/util/uuid"
24-
"k8s.io/apiserver/pkg/server/healthz"
2523
"os"
2624
"time"
25+
26+
"k8s.io/apimachinery/pkg/util/uuid"
27+
"k8s.io/apiserver/pkg/server/healthz"
2728
"tkestack.io/tke/api/notify"
2829
"tkestack.io/tke/cmd/tke-logagent-controller/app/config"
2930
"tkestack.io/tke/pkg/controller"
@@ -48,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4849
// serverMux is the handler for these controller *after* authn/authz filters have been applied
4950
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5051
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, notify.Codecs)
51-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5253
return err
5354
}
5455

cmd/tke-mesh-controller/app/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ package app
2121

2222
import (
2323
"context"
24-
"k8s.io/apimachinery/pkg/util/uuid"
25-
"k8s.io/apiserver/pkg/server/healthz"
2624
"os"
2725
"time"
26+
27+
"k8s.io/apimachinery/pkg/util/uuid"
28+
"k8s.io/apiserver/pkg/server/healthz"
2829
"tkestack.io/tke/api/mesh"
2930
"tkestack.io/tke/cmd/tke-mesh-controller/app/config"
3031
"tkestack.io/tke/pkg/controller"
@@ -49,7 +50,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4950
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5051
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5152
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, mesh.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
53+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5354
return err
5455
}
5556

cmd/tke-monitor-controller/app/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ package app
2020

2121
import (
2222
"context"
23-
"k8s.io/apimachinery/pkg/util/uuid"
24-
"k8s.io/apiserver/pkg/server/healthz"
2523
"os"
2624
"time"
25+
26+
"k8s.io/apimachinery/pkg/util/uuid"
27+
"k8s.io/apiserver/pkg/server/healthz"
2728
"tkestack.io/tke/api/monitor"
2829
"tkestack.io/tke/cmd/tke-monitor-controller/app/config"
2930
"tkestack.io/tke/pkg/controller"
@@ -48,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4849
// serverMux is the handler for these controller *after* authn/authz filters have been applied
4950
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5051
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, monitor.Codecs)
51-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5253
return err
5354
}
5455

cmd/tke-notify-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4949
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5050
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5151
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, notify.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5353
return err
5454
}
5555

cmd/tke-platform-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
5959
serverMux.HandleFunc("/mutate", webhook.Mutate)
6060
}
6161
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, platform.Codecs)
62-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
62+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
6363
return err
6464
}
6565

cmd/tke-registry-controller/app/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func Run(cfg *config.Config, stopCh <-chan struct{}) error {
4949
// serverMux is the handler for these controller *after* authn/authz filters have been applied
5050
serverMux := controller.NewBaseHandler(&cfg.Component.Debugging, checks...)
5151
handler := controller.BuildHandlerChain(serverMux, &cfg.Authorization, &cfg.Authentication, registry.Codecs)
52-
if _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
52+
if _, _, err := cfg.SecureServing.Serve(handler, 0, stopCh); err != nil {
5353
return err
5454
}
5555

go.mod

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ replace (
66
github.com/NetEase-Object-Storage/nos-golang-sdk => github.com/karuppiah7890/nos-golang-sdk v0.0.0-20191116042345-0792ba35abcc
77
github.com/chartmuseum/storage => github.com/leoryu/chartmuseum-storage v0.11.1-0.20211104032734-9da39e8f5170
88
github.com/deislabs/oras => github.com/deislabs/oras v0.8.0
9+
go.opentelemetry.io/contrib => go.opentelemetry.io/contrib v0.20.0
10+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0
11+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp => go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0
12+
go.opentelemetry.io/otel => go.opentelemetry.io/otel v0.20.0
13+
go.opentelemetry.io/otel/exporters/otlp => go.opentelemetry.io/otel/exporters/otlp v0.20.0
14+
go.opentelemetry.io/otel/metric => go.opentelemetry.io/otel/metric v0.20.0
15+
go.opentelemetry.io/otel/oteltest => go.opentelemetry.io/otel/oteltest v0.20.0
16+
go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v0.20.0
17+
go.opentelemetry.io/otel/sdk/export/metric => go.opentelemetry.io/otel/sdk/export/metric v0.20.0
18+
go.opentelemetry.io/otel/sdk/metric => go.opentelemetry.io/otel/sdk/metric v0.20.0
19+
go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v0.20.0
20+
go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v0.7.0
21+
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20211013025323-ce878158c4d4
922
google.golang.org/grpc => google.golang.org/grpc v1.38.0
10-
// this replace will be removed if https://github.com/kubernetes/kubernetes/pull/104920 is merged in 1.22
11-
k8s.io/apiserver => github.com/leoryu/k8s-apiserver v0.22.4-0.20211110063743-0341ac1e5801
12-
k8s.io/client-go => k8s.io/client-go v0.22.3
23+
k8s.io/client-go => k8s.io/client-go v0.24.0
1324
)
1425

1526
require (
@@ -27,20 +38,20 @@ require (
2738
github.com/clusternet/clusternet v0.6.0 // indirect
2839
github.com/coreos/go-oidc v2.2.1+incompatible
2940
github.com/coreos/prometheus-operator v0.38.1-0.20200506070354-4231c1d4b313
30-
github.com/cyphar/filepath-securejoin v0.2.2
41+
github.com/cyphar/filepath-securejoin v0.2.3
3142
github.com/deckarep/golang-set v1.7.1
3243
github.com/dexidp/dex v0.0.0-20210802203454-3fac2ab6bc3b
3344
github.com/dgrijalva/jwt-go v3.2.0+incompatible
34-
github.com/docker/distribution v2.7.2-0.20200708230840-70e0022e42fd+incompatible
45+
github.com/docker/distribution v2.8.1+incompatible
3546
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7
3647
github.com/emicklei/go-restful v2.11.1+incompatible
37-
github.com/evanphx/json-patch v4.11.0+incompatible
38-
github.com/fatih/color v1.7.0
39-
github.com/fsnotify/fsnotify v1.4.9
48+
github.com/evanphx/json-patch v4.12.0+incompatible
49+
github.com/fatih/color v1.13.0
50+
github.com/fsnotify/fsnotify v1.5.1
4051
github.com/garyburd/redigo v1.6.0 // indirect
4152
github.com/go-openapi/inflect v0.19.0
4253
github.com/gogo/protobuf v1.3.2
43-
github.com/google/gofuzz v1.1.0
54+
github.com/google/gofuzz v1.2.0
4455
github.com/gorilla/mux v1.8.0
4556
github.com/gorilla/websocket v1.4.2
4657
github.com/gosuri/uitable v0.0.4
@@ -51,37 +62,37 @@ require (
5162
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d
5263
github.com/jinzhu/configor v1.1.1
5364
github.com/joho/godotenv v1.3.0
54-
github.com/json-iterator/go v1.1.11
65+
github.com/json-iterator/go v1.1.12
5566
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
5667
github.com/moul/http2curl v1.0.0 // indirect
57-
github.com/onsi/ginkgo v1.16.4
58-
github.com/onsi/gomega v1.13.0
68+
github.com/onsi/ginkgo v1.16.5
69+
github.com/onsi/gomega v1.17.0
5970
github.com/parnurzeal/gorequest v0.2.15
6071
github.com/pkg/errors v0.9.1
6172
github.com/pkg/sftp v1.10.1
6273
github.com/prometheus/alertmanager v0.20.0
63-
github.com/prometheus/client_golang v1.11.0
64-
github.com/prometheus/common v0.26.0
74+
github.com/prometheus/client_golang v1.12.1
75+
github.com/prometheus/common v0.32.1
6576
github.com/rs/cors v1.6.0
6677
github.com/segmentio/ksuid v1.0.3
6778
github.com/sirupsen/logrus v1.8.1
6879
github.com/spf13/afero v1.6.0
69-
github.com/spf13/cobra v1.2.1
80+
github.com/spf13/cobra v1.4.0
7081
github.com/spf13/pflag v1.0.5
7182
github.com/spf13/viper v1.8.1
72-
github.com/stretchr/testify v1.7.0
83+
github.com/stretchr/testify v1.7.1
7384
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.194
7485
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.194
7586
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.194
7687
github.com/thoas/go-funk v0.4.0
77-
go.etcd.io/etcd/client/pkg/v3 v3.5.0
78-
go.etcd.io/etcd/client/v3 v3.5.0
79-
go.uber.org/zap v1.17.0
80-
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
81-
golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f
82-
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
83-
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
84-
google.golang.org/grpc v1.40.0
88+
go.etcd.io/etcd/client/pkg/v3 v3.5.1
89+
go.etcd.io/etcd/client/v3 v3.5.1
90+
go.uber.org/zap v1.19.1
91+
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
92+
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
93+
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
94+
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
95+
google.golang.org/grpc v1.43.0
8596
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
8697
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
8798
gopkg.in/go-playground/validator.v9 v9.29.1
@@ -91,24 +102,24 @@ require (
91102
gopkg.in/yaml.v2 v2.4.0
92103
gotest.tools v2.2.0+incompatible
93104
helm.sh/chartmuseum v0.13.1
94-
helm.sh/helm/v3 v3.7.1
105+
helm.sh/helm/v3 v3.9.0
95106
istio.io/api v0.0.0-20200715212100-dbf5277541ef
96107
istio.io/client-go v0.0.0-20200715214203-1ab538406cd1
97-
k8s.io/api v0.22.3
98-
k8s.io/apiextensions-apiserver v0.22.3
99-
k8s.io/apimachinery v0.22.3
100-
k8s.io/apiserver v0.22.3
101-
k8s.io/cli-runtime v0.22.3
108+
k8s.io/api v0.24.0
109+
k8s.io/apiextensions-apiserver v0.24.0
110+
k8s.io/apimachinery v0.24.0
111+
k8s.io/apiserver v0.24.0
112+
k8s.io/cli-runtime v0.24.0
102113
k8s.io/client-go v12.0.0+incompatible
103-
k8s.io/cluster-bootstrap v0.22.3
104-
k8s.io/component-base v0.22.3
114+
k8s.io/cluster-bootstrap v0.24.0
115+
k8s.io/component-base v0.24.0
105116
k8s.io/klog v1.0.0
106-
k8s.io/kube-aggregator v0.22.3
107-
k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e
108-
k8s.io/kubectl v0.22.3
109-
k8s.io/metrics v0.22.3
110-
k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a
111-
sigs.k8s.io/controller-runtime v0.9.3
112-
sigs.k8s.io/yaml v1.2.0
117+
k8s.io/kube-aggregator v0.24.0
118+
k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42
119+
k8s.io/kubectl v0.24.0
120+
k8s.io/metrics v0.24.0
121+
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
122+
sigs.k8s.io/controller-runtime v0.11.0
123+
sigs.k8s.io/yaml v1.3.0
113124
yunion.io/x/pkg v0.0.0-20200603123312-ad58e621aec0
114125
)

0 commit comments

Comments
 (0)