Skip to content

Commit e1e8d5e

Browse files
authored
Use k8s 1.34 client libs (#88)
Signed-off-by: Tamal Saha <[email protected]>
1 parent 0fb1bf8 commit e1e8d5e

File tree

1,537 files changed

+131213
-70185
lines changed

Some content is hidden

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

1,537 files changed

+131213
-70185
lines changed

.golangci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: "2"
2+
linters:
3+
default: standard
4+
enable:
5+
- unparam
6+
7+
formatters:
8+
enable:
9+
- gofmt
10+
- goimports
11+
settings:
12+
gofmt:
13+
rewrite-rules:
14+
- pattern: 'interface{}'
15+
replacement: 'any'
16+
17+
issues:
18+
max-same-issues: 100
19+
20+
exclude-files:
21+
- generated.*\\.go
22+
23+
exclude-dirs:
24+
- client
25+
- vendor
26+
27+
run:
28+
timeout: 10m

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ REPO := $(notdir $(shell pwd))
1919
BIN := webhook-runtime
2020

2121
# https://github.com/appscodelabs/gengo-builder
22-
CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.29
22+
CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.32
2323

2424
# This version-strategy uses git tags to set the version string
2525
git_branch := $(shell git rev-parse --abbrev-ref HEAD)
@@ -191,8 +191,6 @@ unit-tests: $(BUILD_DIRS)
191191
./hack/test.sh $(SRC_DIRS) \
192192
"
193193

194-
ADDTL_LINTERS := gofmt,goimports,unparam
195-
196194
.PHONY: lint
197195
lint: $(BUILD_DIRS)
198196
@echo "running linter"
@@ -210,7 +208,7 @@ lint: $(BUILD_DIRS)
210208
--env GO111MODULE=on \
211209
--env GOFLAGS="-mod=vendor" \
212210
$(BUILD_IMAGE) \
213-
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=10m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default
211+
golangci-lint run
214212

215213
$(BUILD_DIRS):
216214
@mkdir -p $@

client/workload/v1/workload.go

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -270,48 +270,48 @@ func (c *workloads) Update(ctx context.Context, w *v1.Workload, opts metav1.Upda
270270
func (c *workloads) Delete(ctx context.Context, obj runtime.Object, options metav1.DeleteOptions) error {
271271
switch t := obj.(type) {
272272
case *core.Pod:
273-
return c.kc.CoreV1().Pods(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
273+
return c.kc.CoreV1().Pods(c.ns).Delete(ctx, t.Name, options)
274274
// ReplicationController
275275
case *core.ReplicationController:
276-
return c.kc.CoreV1().ReplicationControllers(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
276+
return c.kc.CoreV1().ReplicationControllers(c.ns).Delete(ctx, t.Name, options)
277277
// Deployment
278278
case *extensions.Deployment:
279-
return c.kc.ExtensionsV1beta1().Deployments(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
279+
return c.kc.ExtensionsV1beta1().Deployments(c.ns).Delete(ctx, t.Name, options)
280280
case *appsv1beta1.Deployment:
281-
return c.kc.AppsV1beta1().Deployments(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
281+
return c.kc.AppsV1beta1().Deployments(c.ns).Delete(ctx, t.Name, options)
282282
case *appsv1beta2.Deployment:
283-
return c.kc.AppsV1beta2().Deployments(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
283+
return c.kc.AppsV1beta2().Deployments(c.ns).Delete(ctx, t.Name, options)
284284
case *appsv1.Deployment:
285-
return c.kc.AppsV1().Deployments(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
285+
return c.kc.AppsV1().Deployments(c.ns).Delete(ctx, t.Name, options)
286286
// DaemonSet
287287
case *extensions.DaemonSet:
288-
return c.kc.ExtensionsV1beta1().DaemonSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
288+
return c.kc.ExtensionsV1beta1().DaemonSets(c.ns).Delete(ctx, t.Name, options)
289289
case *appsv1beta2.DaemonSet:
290-
return c.kc.AppsV1beta2().DaemonSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
290+
return c.kc.AppsV1beta2().DaemonSets(c.ns).Delete(ctx, t.Name, options)
291291
case *appsv1.DaemonSet:
292-
return c.kc.AppsV1().DaemonSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
292+
return c.kc.AppsV1().DaemonSets(c.ns).Delete(ctx, t.Name, options)
293293
// ReplicaSet
294294
case *extensions.ReplicaSet:
295-
return c.kc.ExtensionsV1beta1().ReplicaSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
295+
return c.kc.ExtensionsV1beta1().ReplicaSets(c.ns).Delete(ctx, t.Name, options)
296296
case *appsv1beta2.ReplicaSet:
297-
return c.kc.AppsV1beta2().ReplicaSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
297+
return c.kc.AppsV1beta2().ReplicaSets(c.ns).Delete(ctx, t.Name, options)
298298
case *appsv1.ReplicaSet:
299-
return c.kc.AppsV1().ReplicaSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
299+
return c.kc.AppsV1().ReplicaSets(c.ns).Delete(ctx, t.Name, options)
300300
// StatefulSet
301301
case *appsv1beta1.StatefulSet:
302-
return c.kc.AppsV1beta1().StatefulSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
302+
return c.kc.AppsV1beta1().StatefulSets(c.ns).Delete(ctx, t.Name, options)
303303
case *appsv1beta2.StatefulSet:
304-
return c.kc.AppsV1beta2().StatefulSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
304+
return c.kc.AppsV1beta2().StatefulSets(c.ns).Delete(ctx, t.Name, options)
305305
case *appsv1.StatefulSet:
306-
return c.kc.AppsV1().StatefulSets(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
306+
return c.kc.AppsV1().StatefulSets(c.ns).Delete(ctx, t.Name, options)
307307
// Job
308308
case *batchv1.Job:
309-
return c.kc.BatchV1().Jobs(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
309+
return c.kc.BatchV1().Jobs(c.ns).Delete(ctx, t.Name, options)
310310
// CronJob
311311
case *batchv1beta1.CronJob:
312-
return c.kc.BatchV1beta1().CronJobs(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
312+
return c.kc.BatchV1beta1().CronJobs(c.ns).Delete(ctx, t.Name, options)
313313
case *ocapps.DeploymentConfig:
314-
return c.oc.AppsV1().DeploymentConfigs(c.ns).Delete(ctx, t.ObjectMeta.Name, options)
314+
return c.oc.AppsV1().DeploymentConfigs(c.ns).Delete(ctx, t.Name, options)
315315
default:
316316
return fmt.Errorf("the object is not a pod or does not have a pod template")
317317
}
@@ -322,48 +322,48 @@ func (c *workloads) Get(ctx context.Context, obj runtime.Object, opts metav1.Get
322322
var err error
323323
switch t := obj.(type) {
324324
case *core.Pod:
325-
out, err = c.kc.CoreV1().Pods(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
325+
out, err = c.kc.CoreV1().Pods(c.ns).Get(ctx, t.Name, opts)
326326
// ReplicationController
327327
case *core.ReplicationController:
328-
out, err = c.kc.CoreV1().ReplicationControllers(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
328+
out, err = c.kc.CoreV1().ReplicationControllers(c.ns).Get(ctx, t.Name, opts)
329329
// Deployment
330330
case *extensions.Deployment:
331-
out, err = c.kc.ExtensionsV1beta1().Deployments(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
331+
out, err = c.kc.ExtensionsV1beta1().Deployments(c.ns).Get(ctx, t.Name, opts)
332332
case *appsv1beta1.Deployment:
333-
out, err = c.kc.AppsV1beta1().Deployments(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
333+
out, err = c.kc.AppsV1beta1().Deployments(c.ns).Get(ctx, t.Name, opts)
334334
case *appsv1beta2.Deployment:
335-
out, err = c.kc.AppsV1beta2().Deployments(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
335+
out, err = c.kc.AppsV1beta2().Deployments(c.ns).Get(ctx, t.Name, opts)
336336
case *appsv1.Deployment:
337-
out, err = c.kc.AppsV1().Deployments(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
337+
out, err = c.kc.AppsV1().Deployments(c.ns).Get(ctx, t.Name, opts)
338338
// DaemonSet
339339
case *extensions.DaemonSet:
340-
out, err = c.kc.ExtensionsV1beta1().DaemonSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
340+
out, err = c.kc.ExtensionsV1beta1().DaemonSets(c.ns).Get(ctx, t.Name, opts)
341341
case *appsv1beta2.DaemonSet:
342-
out, err = c.kc.AppsV1beta2().DaemonSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
342+
out, err = c.kc.AppsV1beta2().DaemonSets(c.ns).Get(ctx, t.Name, opts)
343343
case *appsv1.DaemonSet:
344-
out, err = c.kc.AppsV1().DaemonSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
344+
out, err = c.kc.AppsV1().DaemonSets(c.ns).Get(ctx, t.Name, opts)
345345
// ReplicaSet
346346
case *extensions.ReplicaSet:
347-
out, err = c.kc.ExtensionsV1beta1().ReplicaSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
347+
out, err = c.kc.ExtensionsV1beta1().ReplicaSets(c.ns).Get(ctx, t.Name, opts)
348348
case *appsv1beta2.ReplicaSet:
349-
out, err = c.kc.AppsV1beta2().ReplicaSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
349+
out, err = c.kc.AppsV1beta2().ReplicaSets(c.ns).Get(ctx, t.Name, opts)
350350
case *appsv1.ReplicaSet:
351-
out, err = c.kc.AppsV1().ReplicaSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
351+
out, err = c.kc.AppsV1().ReplicaSets(c.ns).Get(ctx, t.Name, opts)
352352
// StatefulSet
353353
case *appsv1beta1.StatefulSet:
354-
out, err = c.kc.AppsV1beta1().StatefulSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
354+
out, err = c.kc.AppsV1beta1().StatefulSets(c.ns).Get(ctx, t.Name, opts)
355355
case *appsv1beta2.StatefulSet:
356-
out, err = c.kc.AppsV1beta2().StatefulSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
356+
out, err = c.kc.AppsV1beta2().StatefulSets(c.ns).Get(ctx, t.Name, opts)
357357
case *appsv1.StatefulSet:
358-
out, err = c.kc.AppsV1().StatefulSets(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
358+
out, err = c.kc.AppsV1().StatefulSets(c.ns).Get(ctx, t.Name, opts)
359359
// Job
360360
case *batchv1.Job:
361-
out, err = c.kc.BatchV1().Jobs(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
361+
out, err = c.kc.BatchV1().Jobs(c.ns).Get(ctx, t.Name, opts)
362362
// CronJob
363363
case *batchv1beta1.CronJob:
364-
out, err = c.kc.BatchV1beta1().CronJobs(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
364+
out, err = c.kc.BatchV1beta1().CronJobs(c.ns).Get(ctx, t.Name, opts)
365365
case *ocapps.DeploymentConfig:
366-
out, err = c.oc.AppsV1().DeploymentConfigs(c.ns).Get(ctx, t.ObjectMeta.Name, opts)
366+
out, err = c.oc.AppsV1().DeploymentConfigs(c.ns).Get(ctx, t.Name, opts)
367367
default:
368368
err = fmt.Errorf("the object is not a pod or does not have a pod template")
369369
}

go.mod

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
module kmodules.xyz/webhook-runtime
22

3-
go 1.23.0
4-
5-
toolchain go1.24.0
3+
go 1.24.0
64

75
require (
86
github.com/evanphx/json-patch v5.9.11+incompatible
97
github.com/json-iterator/go v1.1.12
108
gomodules.xyz/jsonpatch/v2 v2.5.0
11-
k8s.io/api v0.32.2
12-
k8s.io/apimachinery v0.32.2
13-
k8s.io/apiserver v0.32.2
14-
k8s.io/client-go v0.32.2
9+
k8s.io/api v0.34.3
10+
k8s.io/apimachinery v0.34.3
11+
k8s.io/apiserver v0.34.3
12+
k8s.io/client-go v0.34.3
1513
k8s.io/klog/v2 v2.130.1
16-
k8s.io/kubernetes v1.32.3
17-
kmodules.xyz/client-go v0.32.0
14+
k8s.io/kubernetes v1.34.3
15+
kmodules.xyz/client-go v0.34.2
1816
kmodules.xyz/openshift v0.29.0
19-
sigs.k8s.io/controller-runtime v0.20.2
17+
sigs.k8s.io/controller-runtime v0.22.4
2018
)
2119

2220
require (
@@ -26,65 +24,65 @@ require (
2624
github.com/cespare/xxhash/v2 v2.3.0 // indirect
2725
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
2826
github.com/distribution/reference v0.6.0 // indirect
29-
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
27+
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
3028
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
3129
github.com/fatih/structs v1.1.0 // indirect
32-
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
33-
github.com/go-logr/logr v1.4.2 // indirect
30+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
31+
github.com/go-logr/logr v1.4.3 // indirect
3432
github.com/go-openapi/jsonpointer v0.21.0 // indirect
3533
github.com/go-openapi/jsonreference v0.21.0 // indirect
3634
github.com/go-openapi/swag v0.23.0 // indirect
3735
github.com/gogo/protobuf v1.3.2 // indirect
38-
github.com/golang/protobuf v1.5.4 // indirect
39-
github.com/google/gnostic-models v0.6.9 // indirect
40-
github.com/google/go-cmp v0.6.0 // indirect
36+
github.com/google/gnostic-models v0.7.0 // indirect
37+
github.com/google/go-cmp v0.7.0 // indirect
4138
github.com/google/gofuzz v1.2.0 // indirect
4239
github.com/google/uuid v1.6.0 // indirect
4340
github.com/imdario/mergo v0.3.16 // indirect
44-
github.com/inconshreveable/mousetrap v1.1.0 // indirect
4541
github.com/josharian/intern v1.0.0 // indirect
46-
github.com/klauspost/compress v1.17.11 // indirect
4742
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
4843
github.com/mailru/easyjson v0.7.7 // indirect
4944
github.com/mattn/go-isatty v0.0.16 // indirect
5045
github.com/mitchellh/mapstructure v1.5.0 // indirect
5146
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
52-
github.com/modern-go/reflect2 v1.0.2 // indirect
47+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
5348
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
5449
github.com/nxadm/tail v1.4.11 // indirect
5550
github.com/opencontainers/go-digest v1.0.0 // indirect
5651
github.com/pkg/errors v0.9.1 // indirect
57-
github.com/prometheus/client_golang v1.20.5 // indirect
52+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
53+
github.com/prometheus/client_golang v1.22.0 // indirect
5854
github.com/prometheus/client_model v0.6.1 // indirect
59-
github.com/prometheus/common v0.55.0 // indirect
55+
github.com/prometheus/common v0.62.0 // indirect
6056
github.com/prometheus/procfs v0.15.1 // indirect
6157
github.com/sergi/go-diff v1.2.0 // indirect
62-
github.com/spf13/cobra v1.8.1 // indirect
6358
github.com/spf13/pflag v1.0.6 // indirect
6459
github.com/x448/float16 v0.8.4 // indirect
6560
github.com/yudai/gojsondiff v1.0.0 // indirect
6661
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
6762
github.com/zeebo/xxh3 v1.0.2 // indirect
68-
go.opentelemetry.io/otel v1.33.0 // indirect
69-
go.opentelemetry.io/otel/trace v1.33.0 // indirect
70-
golang.org/x/net v0.36.0 // indirect
71-
golang.org/x/oauth2 v0.27.0 // indirect
72-
golang.org/x/sys v0.30.0 // indirect
73-
golang.org/x/term v0.29.0 // indirect
74-
golang.org/x/text v0.22.0 // indirect
63+
go.opentelemetry.io/otel v1.36.0 // indirect
64+
go.opentelemetry.io/otel/trace v1.36.0 // indirect
65+
go.yaml.in/yaml/v2 v2.4.2 // indirect
66+
go.yaml.in/yaml/v3 v3.0.4 // indirect
67+
golang.org/x/net v0.47.0 // indirect
68+
golang.org/x/oauth2 v0.30.0 // indirect
69+
golang.org/x/sys v0.39.0 // indirect
70+
golang.org/x/term v0.38.0 // indirect
71+
golang.org/x/text v0.32.0 // indirect
7572
golang.org/x/time v0.10.0 // indirect
76-
google.golang.org/protobuf v1.36.3 // indirect
73+
google.golang.org/protobuf v1.36.5 // indirect
7774
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
7875
gopkg.in/inf.v0 v0.9.1 // indirect
7976
gopkg.in/yaml.v3 v3.0.1 // indirect
80-
k8s.io/apiextensions-apiserver v0.32.2 // indirect
81-
k8s.io/component-base v0.32.2 // indirect
82-
k8s.io/component-helpers v0.32.2 // indirect
83-
k8s.io/controller-manager v0.32.2 // indirect
84-
k8s.io/kube-openapi v0.0.0-20241212222426-2c72e554b1e7 // indirect
85-
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
77+
k8s.io/apiextensions-apiserver v0.34.3 // indirect
78+
k8s.io/component-base v0.34.3 // indirect
79+
k8s.io/component-helpers v0.34.3 // indirect
80+
k8s.io/controller-manager v0.34.3 // indirect
81+
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
82+
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect
8683
kmodules.xyz/apiversion v0.2.0 // indirect
87-
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
88-
sigs.k8s.io/structured-merge-diff/v4 v4.4.3 // indirect
89-
sigs.k8s.io/yaml v1.4.0 // indirect
84+
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
85+
sigs.k8s.io/randfill v1.0.0 // indirect
86+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
87+
sigs.k8s.io/yaml v1.6.0 // indirect
9088
)

0 commit comments

Comments
 (0)