Skip to content

Commit 5f520a2

Browse files
removed deprecated schema (#640)
* removed deprecated schema * migrated to kube_codegen * Add validation-gen to tools * Rerun codegen --------- Co-authored-by: David Simansky <dsimansk@redhat.com>
1 parent 824180b commit 5f520a2

64 files changed

Lines changed: 4379 additions & 7900 deletions

Some content is hidden

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

cmd/schema/main.go

Lines changed: 0 additions & 35 deletions
This file was deleted.

go.mod

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,34 @@ require (
88
github.com/google/go-cmp v0.7.0
99
github.com/google/uuid v1.6.0
1010
github.com/hashicorp/go-cleanhttp v0.5.2
11+
github.com/hashicorp/go-retryablehttp v0.7.7
1112
github.com/hashicorp/golang-lru v1.0.2
1213
github.com/kelseyhightower/envconfig v1.4.0
1314
github.com/nats-io/nats-server/v2 v2.11.6
1415
github.com/nats-io/nats.go v1.43.0
1516
github.com/nats-io/nkeys v0.4.11
1617
github.com/pkg/errors v0.9.1 // indirect
18+
github.com/rickb777/date v1.13.0
19+
github.com/stretchr/testify v1.10.0
1720
go.opencensus.io v0.24.0 // indirect
21+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0
22+
go.opentelemetry.io/otel v1.37.0
23+
go.opentelemetry.io/otel/metric v1.37.0
24+
go.opentelemetry.io/otel/sdk v1.37.0
25+
go.opentelemetry.io/otel/sdk/metric v1.37.0
26+
go.opentelemetry.io/otel/trace v1.37.0
1827
go.uber.org/zap v1.27.0
1928
k8s.io/api v0.33.1
2029
k8s.io/apimachinery v0.33.1
2130
k8s.io/client-go v0.33.1
31+
k8s.io/code-generator v0.33.1
2232
k8s.io/utils v0.0.0-20241210054802-24370beab758
2333
knative.dev/eventing v0.46.0
2434
knative.dev/hack v0.0.0-20250708013849-70d4b00da6ba
25-
knative.dev/hack/schema v0.0.0-20250708013849-70d4b00da6ba
2635
knative.dev/pkg v0.0.0-20250716115900-19d3cc2da0b9
2736
knative.dev/reconciler-test v0.0.0-20250716152301-806fb6ae0da7
2837
)
2938

30-
require (
31-
github.com/hashicorp/go-retryablehttp v0.7.7
32-
github.com/rickb777/date v1.13.0
33-
github.com/stretchr/testify v1.10.0
34-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.62.0
35-
go.opentelemetry.io/otel v1.37.0
36-
go.opentelemetry.io/otel/metric v1.37.0
37-
go.opentelemetry.io/otel/sdk v1.37.0
38-
go.opentelemetry.io/otel/sdk/metric v1.37.0
39-
go.opentelemetry.io/otel/trace v1.37.0
40-
)
41-
4239
require (
4340
contrib.go.opencensus.io/exporter/zipkin v0.1.2 // indirect
4441
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 // indirect
@@ -70,7 +67,6 @@ require (
7067
github.com/google/gnostic-models v0.6.9 // indirect
7168
github.com/google/go-tpm v0.9.5 // indirect
7269
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.1 // indirect
73-
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7470
github.com/josharian/intern v1.0.0 // indirect
7571
github.com/json-iterator/go v1.1.12 // indirect
7672
github.com/klauspost/compress v1.18.0 // indirect
@@ -89,7 +85,6 @@ require (
8985
github.com/prometheus/procfs v0.16.1 // indirect
9086
github.com/rickb777/plural v1.2.1 // indirect
9187
github.com/robfig/cron/v3 v3.0.1 // indirect
92-
github.com/spf13/cobra v1.8.1 // indirect
9388
github.com/spf13/pflag v1.0.6 // indirect
9489
github.com/valyala/bytebufferpool v1.0.0 // indirect
9590
github.com/x448/float16 v0.8.4 // indirect
@@ -128,7 +123,6 @@ require (
128123
gopkg.in/yaml.v3 v3.0.1 // indirect
129124
k8s.io/apiextensions-apiserver v0.33.1 // indirect
130125
k8s.io/apiserver v0.33.1 // indirect
131-
k8s.io/code-generator v0.33.1 // indirect
132126
k8s.io/gengo/v2 v2.0.0-20250207200755-1244d31929d7 // indirect
133127
k8s.io/klog/v2 v2.130.1 // indirect
134128
k8s.io/kube-openapi v0.0.0-20250318190949-c8a335a9a2ff // indirect

go.sum

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ github.com/coreos/go-oidc/v3 v3.9.0/go.mod h1:rTKz2PYwftcrtoCzV5g5kvfJoWcm0Mk8AF
125125
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
126126
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
127127
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
128-
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
129128
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
130129
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
131130
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
@@ -335,8 +334,6 @@ github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47
335334
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
336335
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
337336
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
338-
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
339-
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
340337
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
341338
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
342339
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
@@ -495,8 +492,6 @@ github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY52
495492
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
496493
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
497494
github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4=
498-
github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
499-
github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
500495
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
501496
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
502497
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
@@ -1113,8 +1108,6 @@ knative.dev/eventing v0.46.0 h1:DGkvUcZagkvvcRxf5jh/usdictP8BWa7kHgIocfT4MY=
11131108
knative.dev/eventing v0.46.0/go.mod h1:w5YnKVzZBuXXTJb8QN3POXTgXhM07d0tihBZYoSNF+I=
11141109
knative.dev/hack v0.0.0-20250708013849-70d4b00da6ba h1:PkOTBI8DRfvUKD8HTvYYT94NJ49J++llrDo3y0/ZAwc=
11151110
knative.dev/hack v0.0.0-20250708013849-70d4b00da6ba/go.mod h1:R0ritgYtjLDO9527h5vb5X6gfvt5LCrJ55BNbVDsWiY=
1116-
knative.dev/hack/schema v0.0.0-20250708013849-70d4b00da6ba h1:62Pntgfj10nhIt7ZlCfrt/5a96iTu8+ZeD6PhzzVdjY=
1117-
knative.dev/hack/schema v0.0.0-20250708013849-70d4b00da6ba/go.mod h1:KkibP1IazICP5ClxwN5D26LDSygsqbYnVGuGFTsHNOQ=
11181111
knative.dev/pkg v0.0.0-20250716115900-19d3cc2da0b9 h1:P9GFsqTmX4WokSVVUK1IbHOnbJLi8EW1pd4PvbUEodo=
11191112
knative.dev/pkg v0.0.0-20250716115900-19d3cc2da0b9/go.mod h1:Hq2y1gu4P/MWEk9zB8L/zrjJ19ywEnYgwXq8ZMjRl30=
11201113
knative.dev/reconciler-test v0.0.0-20250716152301-806fb6ae0da7 h1:GtFk++Z3XQKVn87+a1VXzcAuPkb0tdU9QJtlhsRKb5g=

hack/tools.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@ import (
2929

3030
// eventshub is a cloudevents sender/receiver utility for e2e testing.
3131
_ "knative.dev/reconciler-test/cmd/eventshub"
32+
33+
// K8s code generation tools
34+
_ "k8s.io/code-generator/cmd/validation-gen"
3235
)

hack/update-codegen.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -o nounset
1919
set -o pipefail
2020

2121
source $(dirname $0)/../vendor/knative.dev/hack/codegen-library.sh
22+
source "${CODEGEN_PKG}/kube_codegen.sh"
2223

2324
# If we run with -mod=vendor here, then generate-groups.sh looks for vendor files in the wrong place.
2425
export GOFLAGS=-mod=
@@ -27,16 +28,22 @@ echo "=== Update Codegen for $MODULE_NAME"
2728

2829
group "Kubernetes Codegen"
2930

30-
# NatssChannel
31+
# NatsJetStreamChannel
3132

3233
# generate the code with:
3334
# --output-base because this script should also be able to run inside the vendor dir of
3435
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir
3536
# instead of the $GOPATH directly. For normal projects this can be dropped.
36-
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
37-
"knative.dev/eventing-natss/pkg/client" "knative.dev/eventing-natss/pkg/apis" \
38-
"messaging:v1alpha1" \
39-
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate.go.txt
37+
kube::codegen::gen_helpers \
38+
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate.go.txt" \
39+
"${REPO_ROOT_DIR}/pkg/apis"
40+
41+
kube::codegen::gen_client \
42+
--boilerplate "${REPO_ROOT_DIR}/hack/boilerplate.go.txt" \
43+
--output-dir "${REPO_ROOT_DIR}/pkg/client" \
44+
--output-pkg "knative.dev/eventing-natss/pkg/client" \
45+
--with-watch \
46+
"${REPO_ROOT_DIR}/pkg/apis"
4047

4148
group "Knative Codegen"
4249

pkg/client/clientset/versioned/clientset.go

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

pkg/client/clientset/versioned/fake/clientset_generated.go

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

pkg/client/clientset/versioned/typed/messaging/v1alpha1/fake/fake_messaging_client.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/clientset/versioned/typed/messaging/v1alpha1/fake/fake_natsjetstreamchannel.go

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

0 commit comments

Comments
 (0)