From 6923557cb7d04d1319160758571dd84279f77967 Mon Sep 17 00:00:00 2001 From: Tam Mach Date: Fri, 20 Sep 2024 18:59:16 +0700 Subject: [PATCH] golang: Enable type alias again for go 1.13 All files are re-generated again as there is change in generation tools. Relates: https://github.com/kubernetes/kubernetes/pull/127271 Relates: https://github.com/cilium/deepequal-gen/pull/7 Relates: https://github.com/kubernetes-sigs/controller-tools/pull/1061 Relates: 1d9d51f40f3e9ef5d82ec03f8f5a92e2a2697f5d Signed-off-by: Tam Mach --- Makefile | 6 +- Makefile.defs | 5 - go.mod | 14 +- go.sum | 32 +- .../v2/ciliumclusterwideenvoyconfigs.yaml | 2 +- .../v2/ciliumclusterwidenetworkpolicies.yaml | 2 +- .../crds/v2/ciliumegressgatewaypolicies.yaml | 2 +- .../client/crds/v2/ciliumendpoints.yaml | 2 +- .../client/crds/v2/ciliumenvoyconfigs.yaml | 2 +- .../crds/v2/ciliumexternalworkloads.yaml | 2 +- .../client/crds/v2/ciliumidentities.yaml | 2 +- .../crds/v2/ciliumlocalredirectpolicies.yaml | 2 +- .../client/crds/v2/ciliumnetworkpolicies.yaml | 2 +- .../client/crds/v2/ciliumnodeconfigs.yaml | 2 +- .../cilium.io/client/crds/v2/ciliumnodes.yaml | 2 +- .../v2alpha1/ciliumbgpadvertisements.yaml | 2 +- .../v2alpha1/ciliumbgpclusterconfigs.yaml | 2 +- .../ciliumbgpnodeconfigoverrides.yaml | 2 +- .../crds/v2alpha1/ciliumbgpnodeconfigs.yaml | 2 +- .../crds/v2alpha1/ciliumbgppeerconfigs.yaml | 2 +- .../v2alpha1/ciliumbgppeeringpolicies.yaml | 2 +- .../crds/v2alpha1/ciliumcidrgroups.yaml | 2 +- .../crds/v2alpha1/ciliumendpointslices.yaml | 2 +- .../ciliuml2announcementpolicies.yaml | 2 +- .../v2alpha1/ciliumloadbalancerippools.yaml | 2 +- .../crds/v2alpha1/ciliumpodippools.yaml | 2 +- .../client/clientset/versioned/clientset.go | 4 +- .../typed/cilium.io/v2/cilium.io_client.go | 8 +- .../v2/ciliumclusterwideenvoyconfig.go | 24 +- .../v2/ciliumclusterwidenetworkpolicy.go | 26 +- .../cilium.io/v2/ciliumegressgatewaypolicy.go | 22 +- .../typed/cilium.io/v2/ciliumendpoint.go | 24 +- .../typed/cilium.io/v2/ciliumenvoyconfig.go | 22 +- .../cilium.io/v2/ciliumexternalworkload.go | 24 +- .../typed/cilium.io/v2/ciliumidentity.go | 22 +- .../cilium.io/v2/ciliumlocalredirectpolicy.go | 24 +- .../typed/cilium.io/v2/ciliumnetworkpolicy.go | 24 +- .../typed/cilium.io/v2/ciliumnode.go | 24 +- .../typed/cilium.io/v2/ciliumnodeconfig.go | 22 +- .../fake/fake_ciliumclusterwideenvoyconfig.go | 2 +- .../fake_ciliumclusterwidenetworkpolicy.go | 2 +- .../v2/fake/fake_ciliumegressgatewaypolicy.go | 2 +- .../cilium.io/v2/fake/fake_ciliumendpoint.go | 2 +- .../v2/fake/fake_ciliumenvoyconfig.go | 2 +- .../v2/fake/fake_ciliumexternalworkload.go | 2 +- .../cilium.io/v2/fake/fake_ciliumidentity.go | 2 +- .../v2/fake/fake_ciliumlocalredirectpolicy.go | 2 +- .../v2/fake/fake_ciliumnetworkpolicy.go | 2 +- .../cilium.io/v2/fake/fake_ciliumnode.go | 2 +- .../v2/fake/fake_ciliumnodeconfig.go | 2 +- .../cilium.io/v2alpha1/cilium.io_client.go | 8 +- .../v2alpha1/ciliumbgpadvertisement.go | 24 +- .../v2alpha1/ciliumbgpclusterconfig.go | 24 +- .../cilium.io/v2alpha1/ciliumbgpnodeconfig.go | 24 +- .../v2alpha1/ciliumbgpnodeconfigoverride.go | 26 +- .../cilium.io/v2alpha1/ciliumbgppeerconfig.go | 22 +- .../v2alpha1/ciliumbgppeeringpolicy.go | 24 +- .../cilium.io/v2alpha1/ciliumcidrgroup.go | 22 +- .../cilium.io/v2alpha1/ciliumendpointslice.go | 22 +- .../v2alpha1/ciliuml2announcementpolicy.go | 28 +- .../v2alpha1/ciliumloadbalancerippool.go | 26 +- .../cilium.io/v2alpha1/ciliumnodeconfig.go | 22 +- .../cilium.io/v2alpha1/ciliumpodippool.go | 22 +- .../fake/fake_ciliumbgpadvertisement.go | 2 +- .../fake/fake_ciliumbgpclusterconfig.go | 2 +- .../v2alpha1/fake/fake_ciliumbgpnodeconfig.go | 2 +- .../fake/fake_ciliumbgpnodeconfigoverride.go | 2 +- .../v2alpha1/fake/fake_ciliumbgppeerconfig.go | 2 +- .../fake/fake_ciliumbgppeeringpolicy.go | 2 +- .../v2alpha1/fake/fake_ciliumcidrgroup.go | 2 +- .../v2alpha1/fake/fake_ciliumendpointslice.go | 2 +- .../fake/fake_ciliuml2announcementpolicy.go | 2 +- .../fake/fake_ciliumloadbalancerippool.go | 2 +- .../v2alpha1/fake/fake_ciliumnodeconfig.go | 2 +- .../v2alpha1/fake/fake_ciliumpodippool.go | 2 +- .../v2/ciliumclusterwideenvoyconfig.go | 16 +- .../v2/ciliumclusterwidenetworkpolicy.go | 16 +- .../cilium.io/v2/ciliumegressgatewaypolicy.go | 16 +- .../cilium.io/v2/ciliumendpoint.go | 16 +- .../cilium.io/v2/ciliumenvoyconfig.go | 16 +- .../cilium.io/v2/ciliumexternalworkload.go | 16 +- .../cilium.io/v2/ciliumidentity.go | 16 +- .../cilium.io/v2/ciliumlocalredirectpolicy.go | 16 +- .../cilium.io/v2/ciliumnetworkpolicy.go | 16 +- .../cilium.io/v2/ciliumnode.go | 16 +- .../cilium.io/v2/ciliumnodeconfig.go | 16 +- .../v2alpha1/ciliumbgpadvertisement.go | 16 +- .../v2alpha1/ciliumbgpclusterconfig.go | 16 +- .../cilium.io/v2alpha1/ciliumbgpnodeconfig.go | 16 +- .../v2alpha1/ciliumbgpnodeconfigoverride.go | 16 +- .../cilium.io/v2alpha1/ciliumbgppeerconfig.go | 16 +- .../v2alpha1/ciliumbgppeeringpolicy.go | 16 +- .../cilium.io/v2alpha1/ciliumcidrgroup.go | 16 +- .../cilium.io/v2alpha1/ciliumendpointslice.go | 16 +- .../v2alpha1/ciliuml2announcementpolicy.go | 16 +- .../v2alpha1/ciliumloadbalancerippool.go | 16 +- .../cilium.io/v2alpha1/ciliumnodeconfig.go | 16 +- .../cilium.io/v2alpha1/ciliumpodippool.go | 16 +- .../informers/externalversions/generic.go | 2 +- .../v2/ciliumclusterwideenvoyconfig.go | 16 +- .../v2/ciliumclusterwidenetworkpolicy.go | 16 +- .../cilium.io/v2/ciliumegressgatewaypolicy.go | 16 +- .../listers/cilium.io/v2/ciliumendpoint.go | 22 +- .../listers/cilium.io/v2/ciliumenvoyconfig.go | 22 +- .../cilium.io/v2/ciliumexternalworkload.go | 16 +- .../listers/cilium.io/v2/ciliumidentity.go | 16 +- .../cilium.io/v2/ciliumlocalredirectpolicy.go | 22 +- .../cilium.io/v2/ciliumnetworkpolicy.go | 22 +- .../client/listers/cilium.io/v2/ciliumnode.go | 16 +- .../listers/cilium.io/v2/ciliumnodeconfig.go | 22 +- .../v2alpha1/ciliumbgpadvertisement.go | 16 +- .../v2alpha1/ciliumbgpclusterconfig.go | 16 +- .../cilium.io/v2alpha1/ciliumbgpnodeconfig.go | 16 +- .../v2alpha1/ciliumbgpnodeconfigoverride.go | 16 +- .../cilium.io/v2alpha1/ciliumbgppeerconfig.go | 16 +- .../v2alpha1/ciliumbgppeeringpolicy.go | 16 +- .../cilium.io/v2alpha1/ciliumcidrgroup.go | 16 +- .../cilium.io/v2alpha1/ciliumendpointslice.go | 16 +- .../v2alpha1/ciliuml2announcementpolicy.go | 16 +- .../v2alpha1/ciliumloadbalancerippool.go | 16 +- .../cilium.io/v2alpha1/ciliumnodeconfig.go | 22 +- .../cilium.io/v2alpha1/ciliumpodippool.go | 16 +- .../clientset/versioned/clientset.go | 4 +- .../apiextensions/v1/apiextensions_client.go | 8 +- .../v1/customresourcedefinition.go | 24 +- .../v1/fake/fake_customresourcedefinition.go | 2 +- .../v1/customresourcedefinition.go | 16 +- .../informers/externalversions/generic.go | 2 +- .../v1/customresourcedefinition.go | 16 +- .../client/clientset/versioned/clientset.go | 4 +- .../versioned/typed/core/v1/core_client.go | 8 +- .../versioned/typed/core/v1/endpoints.go | 22 +- .../typed/core/v1/fake/fake_endpoints.go | 2 +- .../typed/core/v1/fake/fake_namespace.go | 2 +- .../versioned/typed/core/v1/fake/fake_node.go | 2 +- .../versioned/typed/core/v1/fake/fake_pod.go | 2 +- .../typed/core/v1/fake/fake_secret.go | 2 +- .../typed/core/v1/fake/fake_service.go | 2 +- .../versioned/typed/core/v1/namespace.go | 22 +- .../clientset/versioned/typed/core/v1/node.go | 24 +- .../clientset/versioned/typed/core/v1/pod.go | 30 +- .../versioned/typed/core/v1/secret.go | 22 +- .../versioned/typed/core/v1/service.go | 24 +- .../typed/discovery/v1/discovery_client.go | 8 +- .../typed/discovery/v1/endpointslice.go | 22 +- .../discovery/v1/fake/fake_endpointslice.go | 2 +- .../discovery/v1beta1/discovery_client.go | 8 +- .../typed/discovery/v1beta1/endpointslice.go | 22 +- .../v1beta1/fake/fake_endpointslice.go | 2 +- .../networking/v1/fake/fake_networkpolicy.go | 2 +- .../typed/networking/v1/networking_client.go | 8 +- .../typed/networking/v1/networkpolicy.go | 22 +- .../externalversions/core/v1/endpoints.go | 16 +- .../externalversions/core/v1/namespace.go | 16 +- .../externalversions/core/v1/node.go | 16 +- .../informers/externalversions/core/v1/pod.go | 16 +- .../externalversions/core/v1/secret.go | 16 +- .../externalversions/core/v1/service.go | 16 +- .../discovery/v1/endpointslice.go | 16 +- .../discovery/v1beta1/endpointslice.go | 16 +- .../informers/externalversions/generic.go | 2 +- .../networking/v1/networkpolicy.go | 16 +- .../k8s/client/listers/core/v1/endpoints.go | 22 +- .../k8s/client/listers/core/v1/namespace.go | 16 +- .../slim/k8s/client/listers/core/v1/node.go | 16 +- .../slim/k8s/client/listers/core/v1/pod.go | 22 +- .../slim/k8s/client/listers/core/v1/secret.go | 22 +- .../k8s/client/listers/core/v1/service.go | 22 +- .../listers/discovery/v1/endpointslice.go | 22 +- .../discovery/v1beta1/endpointslice.go | 22 +- .../listers/networking/v1/networkpolicy.go | 22 +- .../github.com/cilium/deepequal-gen/Makefile | 2 +- .../cilium/deepequal-gen/args/args.go | 42 + .../deepequal-gen/generators/deepequal.go | 105 +- .../github.com/cilium/deepequal-gen/main.go | 31 +- .../generators/applyconfiguration.go | 33 +- .../generators/internal.go | 6 +- .../generators/targets.go | 6 +- .../generators/types.go | 2 + .../client-gen/generators/client_generator.go | 8 +- .../generators/fake/fake_client_generator.go | 8 +- .../fake/generator_fake_for_clientset.go | 1 - .../fake/generator_fake_for_type.go | 44 +- .../generators/generator_for_clientset.go | 6 +- .../generators/generator_for_group.go | 47 +- .../generators/generator_for_type.go | 136 ++- .../conversion-gen/generators/conversion.go | 10 +- .../cmd/deepcopy-gen/generators/deepcopy.go | 14 +- .../cmd/defaulter-gen/generators/defaulter.go | 38 +- .../cmd/informer-gen/generators/generic.go | 4 +- .../cmd/informer-gen/generators/informer.go | 5 +- .../cmd/informer-gen/generators/targets.go | 12 +- .../cmd/informer-gen/generators/types.go | 2 + .../cmd/lister-gen/generators/lister.go | 34 +- .../cmd/register-gen/generators/targets.go | 2 +- vendor/k8s.io/gengo/LICENSE | 202 ---- vendor/k8s.io/gengo/args/args.go | 199 ---- .../gengo/examples/set-gen/sets/byte.go | 221 ----- .../k8s.io/gengo/examples/set-gen/sets/int.go | 221 ----- .../gengo/examples/set-gen/sets/int64.go | 221 ----- .../gengo/examples/set-gen/sets/string.go | 221 ----- .../gengo/generator/default_generator.go | 62 -- .../k8s.io/gengo/generator/default_package.go | 75 -- vendor/k8s.io/gengo/generator/doc.go | 31 - .../k8s.io/gengo/generator/error_tracker.go | 50 - vendor/k8s.io/gengo/generator/execute.go | 329 ------- vendor/k8s.io/gengo/generator/generator.go | 259 ----- .../k8s.io/gengo/generator/import_tracker.go | 89 -- .../k8s.io/gengo/generator/snippet_writer.go | 154 --- .../gengo/generator/transitive_closure.go | 65 -- vendor/k8s.io/gengo/namer/doc.go | 31 - vendor/k8s.io/gengo/namer/import_tracker.go | 121 --- vendor/k8s.io/gengo/namer/namer.go | 395 -------- vendor/k8s.io/gengo/namer/order.go | 72 -- vendor/k8s.io/gengo/namer/plural_namer.go | 120 --- vendor/k8s.io/gengo/parser/doc.go | 19 - vendor/k8s.io/gengo/parser/parse.go | 925 ------------------ vendor/k8s.io/gengo/types/comments.go | 82 -- vendor/k8s.io/gengo/types/doc.go | 19 - vendor/k8s.io/gengo/types/flatten.go | 57 -- vendor/k8s.io/gengo/types/types.go | 537 ---------- vendor/k8s.io/gengo/v2/Makefile | 14 + vendor/k8s.io/gengo/v2/generator/execute.go | 9 +- .../gengo/v2/generator/import_tracker.go | 15 +- .../gengo/v2/generator/snippet_writer.go | 38 +- vendor/k8s.io/gengo/v2/namer/namer.go | 16 +- vendor/k8s.io/gengo/v2/parser/parse.go | 65 +- .../sets/empty.go => v2/parser/parse_122.go} | 24 +- .../doc.go => v2/parser/parse_pre_122.go} | 20 +- vendor/k8s.io/gengo/v2/types/types.go | 20 +- .../kube-openapi/pkg/generators/markers.go | 187 +++- .../kube-openapi/pkg/generators/openapi.go | 119 ++- vendor/modules.txt | 24 +- .../controller-tools/pkg/crd/schema.go | 2 +- 234 files changed, 1894 insertions(+), 6187 deletions(-) create mode 100644 vendor/github.com/cilium/deepequal-gen/args/args.go delete mode 100644 vendor/k8s.io/gengo/LICENSE delete mode 100644 vendor/k8s.io/gengo/args/args.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/byte.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/int.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/int64.go delete mode 100644 vendor/k8s.io/gengo/examples/set-gen/sets/string.go delete mode 100644 vendor/k8s.io/gengo/generator/default_generator.go delete mode 100644 vendor/k8s.io/gengo/generator/default_package.go delete mode 100644 vendor/k8s.io/gengo/generator/doc.go delete mode 100644 vendor/k8s.io/gengo/generator/error_tracker.go delete mode 100644 vendor/k8s.io/gengo/generator/execute.go delete mode 100644 vendor/k8s.io/gengo/generator/generator.go delete mode 100644 vendor/k8s.io/gengo/generator/import_tracker.go delete mode 100644 vendor/k8s.io/gengo/generator/snippet_writer.go delete mode 100644 vendor/k8s.io/gengo/generator/transitive_closure.go delete mode 100644 vendor/k8s.io/gengo/namer/doc.go delete mode 100644 vendor/k8s.io/gengo/namer/import_tracker.go delete mode 100644 vendor/k8s.io/gengo/namer/namer.go delete mode 100644 vendor/k8s.io/gengo/namer/order.go delete mode 100644 vendor/k8s.io/gengo/namer/plural_namer.go delete mode 100644 vendor/k8s.io/gengo/parser/doc.go delete mode 100644 vendor/k8s.io/gengo/parser/parse.go delete mode 100644 vendor/k8s.io/gengo/types/comments.go delete mode 100644 vendor/k8s.io/gengo/types/doc.go delete mode 100644 vendor/k8s.io/gengo/types/flatten.go delete mode 100644 vendor/k8s.io/gengo/types/types.go create mode 100644 vendor/k8s.io/gengo/v2/Makefile rename vendor/k8s.io/gengo/{examples/set-gen/sets/empty.go => v2/parser/parse_122.go} (55%) rename vendor/k8s.io/gengo/{examples/set-gen/sets/doc.go => v2/parser/parse_pre_122.go} (62%) diff --git a/Makefile b/Makefile index bcb84fba3d060..c983a5287c534 100644 --- a/Makefile +++ b/Makefile @@ -292,10 +292,10 @@ generate-hubble-api: api/v1/flow/flow.proto api/v1/peer/peer.proto api/v1/observ define generate_deepequal $(GO) run github.com/cilium/deepequal-gen \ - --input-dirs $(subst $(space),$(comma),$(1)) \ --go-header-file "$$PWD/hack/custom-boilerplate.go.txt" \ - --output-file-base zz_generated.deepequal \ - --output-base $(2) + --output-file zz_generated.deepequal.go \ + --output-base $(2) \ + $(1) endef define generate_k8s_protobuf diff --git a/Makefile.defs b/Makefile.defs index a69376a51fb49..2dc15496d021a 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -84,11 +84,6 @@ GO_BUILD_LDFLAGS ?= # go build/test -tags values GO_TAGS_FLAGS += osusergo -# Keep the Go <=1.22 semantics for parsing type aliases. -# This is needed for code generation (k8s protobuf, deep*) until 'gengo' has been fixed. -GODEBUG += gotypesalias=0 -export GODEBUG - # This is declared here as it is needed to change the covermode depending on if # RACE is specified. GOTEST_COVER_OPTS = diff --git a/go.mod b/go.mod index e614739ac2ecf..e7a475cace9d6 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/bombsimon/logrusr/v4 v4.1.0 github.com/cilium/charts v0.0.0-20240926142256-e20f2b5f5344 github.com/cilium/coverbee v0.3.3-0.20240723084546-664438750fce - github.com/cilium/deepequal-gen v0.0.0-20231116094812-0d6c075c335f + github.com/cilium/deepequal-gen v0.0.0-20241002105916-4c4165f47b6c github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a github.com/cilium/ebpf v0.16.0 github.com/cilium/endpointslice-controller v0.0.0-20240409203012-75cb5d61db1b @@ -132,7 +132,7 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 sigs.k8s.io/controller-runtime v0.19.0 - sigs.k8s.io/controller-tools v0.16.3 + sigs.k8s.io/controller-tools v0.16.4-0.20240923084800-3b70a40398f4 sigs.k8s.io/gateway-api v1.2.0-rc1.0.20240923191000-5c5fc388829d sigs.k8s.io/mcs-api v0.1.1-0.20240919125245-7bbb5990134a sigs.k8s.io/yaml v1.4.0 @@ -319,9 +319,8 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gotest.tools/v3 v3.5.0 // indirect k8s.io/apiserver v0.31.1 // indirect - k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 // indirect - k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect - k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 // indirect + k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 // indirect + k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 // indirect k8s.io/kubectl v0.31.0 // indirect oras.land/oras-go v1.2.5 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect @@ -333,7 +332,10 @@ require ( replace ( go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20220829170633-5d7dfb1129f7 + k8s.io/code-generator => k8s.io/code-generator v0.30.0-alpha.3.0.20240920005538-61df8a8f0355 + // Using private fork of controller-tools. See commit msg for more context // as to why we are using a private fork. - sigs.k8s.io/controller-tools => github.com/cilium/controller-tools v0.16.1-1 + // For testing purpose, use another fork to include https://github.com/kubernetes-sigs/controller-tools#1061 + sigs.k8s.io/controller-tools => github.com/sayboras/controller-tools v0.0.0-20240925150353-20695830368c ) diff --git a/go.sum b/go.sum index c5584ede550a9..397ee8b9c8ac3 100644 --- a/go.sum +++ b/go.sum @@ -145,12 +145,10 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cilium/charts v0.0.0-20240926142256-e20f2b5f5344 h1:biAN1Y6c+77q59tDU74YzXB8ffZoe2KyryMU12PWB3k= github.com/cilium/charts v0.0.0-20240926142256-e20f2b5f5344/go.mod h1:M3C9VOlFvRzuV+a01t07Tw4uFLSfkCH3L542IWjf6BU= -github.com/cilium/controller-tools v0.16.1-1 h1:ICJKl0ci+ZG41BZwL1axxh5Ji7hielbEOTD/arMOAck= -github.com/cilium/controller-tools v0.16.1-1/go.mod h1:0I0xqjR65YTfoO12iR+mZR6s6UAVcUARgXRlsu0ljB0= github.com/cilium/coverbee v0.3.3-0.20240723084546-664438750fce h1:gqzXY3NuHllVVDw9vD49mlXx+9bYFPlg23rdrkQNFDM= github.com/cilium/coverbee v0.3.3-0.20240723084546-664438750fce/go.mod h1:6RGqSqaXtkBGjm7na2bKFi52BeeGUuiT3178zeje4Ik= -github.com/cilium/deepequal-gen v0.0.0-20231116094812-0d6c075c335f h1:t1A8nGkbZcjLACtNGIkfhfnKgG7V83+Tzr1pMeoPuA8= -github.com/cilium/deepequal-gen v0.0.0-20231116094812-0d6c075c335f/go.mod h1:O4ERd4TTIfE/EKtiqESR2OQEiLwkDwBTW3zrbcQ4S3M= +github.com/cilium/deepequal-gen v0.0.0-20241002105916-4c4165f47b6c h1:cFlj+4DrlaHr69c/EBj1lOcysSWSbhg1LzAvL8srW+4= +github.com/cilium/deepequal-gen v0.0.0-20241002105916-4c4165f47b6c/go.mod h1:9EU8oWNwEP6f98xJz/YjWw7yOLHK7p90MKmaPu1wBcE= github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a h1:PRGN7B+72mj3OtLL2DM3F/9jp+ItgqgNS7mecgCmwsQ= github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a/go.mod h1:/7LC2GOgyXJ7maupZlaVIumYQiGPIgllSf6mA9sg6RU= github.com/cilium/ebpf v0.16.0 h1:+BiEnHL6Z7lXnlGUsXQPPAE7+kenAd4ES8MQ5min0Ok= @@ -294,7 +292,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -403,7 +400,6 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/go-replayers/httpreplay v1.2.0 h1:VM1wEyyjaoU53BwrOnaf9VhAyQQEEioJvFYxYcLRKzk= github.com/google/go-replayers/httpreplay v1.2.0/go.mod h1:WahEFFZZ7a1P4VM1qEeHy+tME4bwyqPcwWbNlUI1Mcg= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gops v0.3.28 h1:2Xr57tqKAmQYRAfG12E+yLcoa2Y42UJo2lOrUFL9ark= @@ -412,8 +408,8 @@ github.com/google/licenseclassifier/v2 v2.0.0 h1:1Y57HHILNf4m0ABuMVb6xk4vAJYEUO0 github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af h1:kmjWCqn2qkEml422C2Rrd27c3VGxi6a/6HNq8QmHRKM= -github.com/google/pprof v0.0.0-20240525223248-4bfdf5a9a2af/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= +github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg= github.com/google/renameio/v2 v2.0.0/go.mod h1:BtmJXm5YlszgC+TD4HOEEUFgkJP3nLxehU6hfe7jRt4= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= @@ -504,7 +500,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -689,6 +684,8 @@ github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sayboras/controller-tools v0.0.0-20240925150353-20695830368c h1:ICXieiDvv1KInwkcs82q7XCMtkhz/Ft13xqNujIoqUo= +github.com/sayboras/controller-tools v0.0.0-20240925150353-20695830368c/go.mod h1:0I0xqjR65YTfoO12iR+mZR6s6UAVcUARgXRlsu0ljB0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= @@ -999,7 +996,6 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1106,21 +1102,18 @@ k8s.io/cli-runtime v0.31.1 h1:/ZmKhmZ6hNqDM+yf9s3Y4KEYakNXUn5sod2LWGGwCuk= k8s.io/cli-runtime v0.31.1/go.mod h1:pKv1cDIaq7ehWGuXQ+A//1OIF+7DI+xudXtExMCbe9U= k8s.io/client-go v0.31.1 h1:f0ugtWSbWpxHR7sjVpQwuvw9a3ZKLXX0u0itkFXufb0= k8s.io/client-go v0.31.1/go.mod h1:sKI8871MJN2OyeqRlmA4W4KM9KBdBUpDLu/43eGemCg= -k8s.io/code-generator v0.31.1 h1:GvkRZEP2g2UnB2QKT2Dgc/kYxIkDxCHENv2Q1itioVs= -k8s.io/code-generator v0.31.1/go.mod h1:oL2ky46L48osNqqZAeOcWWy0S5BXj50vVdwOtTefqIs= +k8s.io/code-generator v0.30.0-alpha.3.0.20240920005538-61df8a8f0355 h1:SQN+BXQKTpySN1sfv4XDMTLX7mTNI8WZRubtGpdY80w= +k8s.io/code-generator v0.30.0-alpha.3.0.20240920005538-61df8a8f0355/go.mod h1:2HXQ0xA0yPH06uoIjaZfcHSXIsyk8B63QfiQJD+fM50= k8s.io/component-base v0.31.1 h1:UpOepcrX3rQ3ab5NB6g5iP0tvsgJWzxTyAo20sgYSy8= k8s.io/component-base v0.31.1/go.mod h1:WGeaw7t/kTsqpVTaCoVEtillbqAhF2/JgvO0LDOMa0w= k8s.io/endpointslice v0.31.1 h1:bCzN47Fd+hei2mjwarMMBnFjRa7Sbth/zGnxBFI+/ik= k8s.io/endpointslice v0.31.1/go.mod h1:L+6WZHF9A8DV4T5146E5nR+quxAOYGZ6X0Vlofdkxw8= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= -k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 h1:si3PfKm8dDYxgfbeA6orqrtLkvvIeH8UqffFJDl0bz4= +k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9/go.mod h1:EJykeLsmFC60UQbYJezXkEsG2FLrt0GPNkU5iK5GWxU= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= -k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 h1:Q8Z7VlGhcJgBHJHYugJ/K/7iB8a2eSxCyxdVjJp+lLY= -k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 h1:GKE9U8BH16uynoxQii0auTjmmmuZ3O0LFMN6S0lPPhI= +k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2/go.mod h1:coRQXBK9NxO98XUv3ZD6AK3xzHCxV6+b7lrquKwaKzA= k8s.io/kubectl v0.31.0 h1:kANwAAPVY02r4U4jARP/C+Q1sssCcN/1p9Nk+7BQKVg= k8s.io/kubectl v0.31.0/go.mod h1:pB47hhFypGsaHAPjlwrNbvhXgmuAr01ZBvAIIUaI8d4= k8s.io/utils v0.0.0-20240921022957-49e7df575cb6 h1:MDF6h2H/h4tbzmtIKTuctcwZmY0tY9mD9fNT47QO6HI= @@ -1146,6 +1139,5 @@ sigs.k8s.io/mcs-api v0.1.1-0.20240919125245-7bbb5990134a h1:R2c2r4UrW0aDTc79y4ML sigs.k8s.io/mcs-api v0.1.1-0.20240919125245-7bbb5990134a/go.mod h1:x0rgWQwGd3FJzrb94BNn3Nu7YxUwBWcgjVRbkrkVy2A= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwideenvoyconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwideenvoyconfigs.yaml index 1dbb3e9327746..70f7ac9a9b53f 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwideenvoyconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwideenvoyconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumclusterwideenvoyconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml index 13845ba50913c..aff80699469ad 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumclusterwidenetworkpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumclusterwidenetworkpolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumegressgatewaypolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumegressgatewaypolicies.yaml index 14b17921b3a4b..8984c1e3282ad 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumegressgatewaypolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumegressgatewaypolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumegressgatewaypolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumendpoints.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumendpoints.yaml index fb849f87db5c6..faac27cfea580 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumendpoints.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumendpoints.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumendpoints.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumenvoyconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumenvoyconfigs.yaml index 43c4b208c1222..ec98c76d65905 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumenvoyconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumenvoyconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumenvoyconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumexternalworkloads.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumexternalworkloads.yaml index 9a80d3a5b6961..ef6d5b005981a 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumexternalworkloads.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumexternalworkloads.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumexternalworkloads.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumidentities.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumidentities.yaml index f5c0ad3144b02..4d68813087c85 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumidentities.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumidentities.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumidentities.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumlocalredirectpolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumlocalredirectpolicies.yaml index 5fed8276abcb3..22648d8482122 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumlocalredirectpolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumlocalredirectpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumlocalredirectpolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml index 2533419ea5731..444e41522214e 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnetworkpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumnetworkpolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodeconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodeconfigs.yaml index 46bd469216a7b..34b14b8562893 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodeconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodeconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumnodeconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml index b3eae363e4728..f1b9f44047faa 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2/ciliumnodes.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumnodes.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpadvertisements.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpadvertisements.yaml index 73a0a53c50b58..8a43fde1c85b2 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpadvertisements.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpadvertisements.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgpadvertisements.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpclusterconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpclusterconfigs.yaml index 9a89d74d268b4..15c2f3d65f050 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpclusterconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpclusterconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgpclusterconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigoverrides.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigoverrides.yaml index 5077a4cfd5490..35d3de29f9fa9 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigoverrides.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigoverrides.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgpnodeconfigoverrides.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigs.yaml index 53c50c753ffdf..4de8f88475f33 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgpnodeconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgpnodeconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeerconfigs.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeerconfigs.yaml index d59b3292f6334..33c3aec6990e4 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeerconfigs.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeerconfigs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgppeerconfigs.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeeringpolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeeringpolicies.yaml index cd2cf3776dc33..5c32d550fbbe2 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeeringpolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumbgppeeringpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumbgppeeringpolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumcidrgroups.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumcidrgroups.yaml index 6d2deb57c89f5..443d5ab04043a 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumcidrgroups.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumcidrgroups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumcidrgroups.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumendpointslices.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumendpointslices.yaml index acf3563cc97c6..dcd8a56a8c259 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumendpointslices.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumendpointslices.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumendpointslices.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliuml2announcementpolicies.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliuml2announcementpolicies.yaml index 4ea83978daed2..e6704ed5c2ef6 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliuml2announcementpolicies.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliuml2announcementpolicies.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliuml2announcementpolicies.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml index 63e034997cf92..4d9c450cd571e 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumloadbalancerippools.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumloadbalancerippools.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumpodippools.yaml b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumpodippools.yaml index e44151b47ad4d..db66a140c366f 100644 --- a/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumpodippools.yaml +++ b/pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumpodippools.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.3 + controller-gen.kubebuilder.io/version: v0.16.4-0.20240923084800-3b70a40398f4 name: ciliumpodippools.cilium.io spec: group: cilium.io diff --git a/pkg/k8s/client/clientset/versioned/clientset.go b/pkg/k8s/client/clientset/versioned/clientset.go index 720686010ac90..bd6b644e13d05 100644 --- a/pkg/k8s/client/clientset/versioned/clientset.go +++ b/pkg/k8s/client/clientset/versioned/clientset.go @@ -6,8 +6,8 @@ package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" ciliumv2 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2" ciliumv2alpha1 "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/cilium.io_client.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/cilium.io_client.go index cb6567440ebd6..c19b3f1dbcf30 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/cilium.io_client.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/cilium.io_client.go @@ -6,10 +6,10 @@ package v2 import ( - "net/http" + http "net/http" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -122,7 +122,7 @@ func New(c rest.Interface) *CiliumV2Client { } func setConfigDefaults(config *rest.Config) error { - gv := v2.SchemeGroupVersion + gv := ciliumiov2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwideenvoyconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwideenvoyconfig.go index b5903aef732dd..5e8ff1656182e 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwideenvoyconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwideenvoyconfig.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,33 @@ type CiliumClusterwideEnvoyConfigsGetter interface { // CiliumClusterwideEnvoyConfigInterface has methods to work with CiliumClusterwideEnvoyConfig resources. type CiliumClusterwideEnvoyConfigInterface interface { - Create(ctx context.Context, ciliumClusterwideEnvoyConfig *v2.CiliumClusterwideEnvoyConfig, opts v1.CreateOptions) (*v2.CiliumClusterwideEnvoyConfig, error) - Update(ctx context.Context, ciliumClusterwideEnvoyConfig *v2.CiliumClusterwideEnvoyConfig, opts v1.UpdateOptions) (*v2.CiliumClusterwideEnvoyConfig, error) + Create(ctx context.Context, ciliumClusterwideEnvoyConfig *ciliumiov2.CiliumClusterwideEnvoyConfig, opts v1.CreateOptions) (*ciliumiov2.CiliumClusterwideEnvoyConfig, error) + Update(ctx context.Context, ciliumClusterwideEnvoyConfig *ciliumiov2.CiliumClusterwideEnvoyConfig, opts v1.UpdateOptions) (*ciliumiov2.CiliumClusterwideEnvoyConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumClusterwideEnvoyConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumClusterwideEnvoyConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumClusterwideEnvoyConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumClusterwideEnvoyConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumClusterwideEnvoyConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumClusterwideEnvoyConfig, err error) CiliumClusterwideEnvoyConfigExpansion } // ciliumClusterwideEnvoyConfigs implements CiliumClusterwideEnvoyConfigInterface type ciliumClusterwideEnvoyConfigs struct { - *gentype.ClientWithList[*v2.CiliumClusterwideEnvoyConfig, *v2.CiliumClusterwideEnvoyConfigList] + *gentype.ClientWithList[*ciliumiov2.CiliumClusterwideEnvoyConfig, *ciliumiov2.CiliumClusterwideEnvoyConfigList] } // newCiliumClusterwideEnvoyConfigs returns a CiliumClusterwideEnvoyConfigs func newCiliumClusterwideEnvoyConfigs(c *CiliumV2Client) *ciliumClusterwideEnvoyConfigs { return &ciliumClusterwideEnvoyConfigs{ - gentype.NewClientWithList[*v2.CiliumClusterwideEnvoyConfig, *v2.CiliumClusterwideEnvoyConfigList]( + gentype.NewClientWithList[*ciliumiov2.CiliumClusterwideEnvoyConfig, *ciliumiov2.CiliumClusterwideEnvoyConfigList]( "ciliumclusterwideenvoyconfigs", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumClusterwideEnvoyConfig { return &v2.CiliumClusterwideEnvoyConfig{} }, - func() *v2.CiliumClusterwideEnvoyConfigList { return &v2.CiliumClusterwideEnvoyConfigList{} }), + func() *ciliumiov2.CiliumClusterwideEnvoyConfig { return &ciliumiov2.CiliumClusterwideEnvoyConfig{} }, + func() *ciliumiov2.CiliumClusterwideEnvoyConfigList { + return &ciliumiov2.CiliumClusterwideEnvoyConfigList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwidenetworkpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwidenetworkpolicy.go index c39e8cfc2b236..837b26354f8db 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwidenetworkpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumclusterwidenetworkpolicy.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,35 @@ type CiliumClusterwideNetworkPoliciesGetter interface { // CiliumClusterwideNetworkPolicyInterface has methods to work with CiliumClusterwideNetworkPolicy resources. type CiliumClusterwideNetworkPolicyInterface interface { - Create(ctx context.Context, ciliumClusterwideNetworkPolicy *v2.CiliumClusterwideNetworkPolicy, opts v1.CreateOptions) (*v2.CiliumClusterwideNetworkPolicy, error) - Update(ctx context.Context, ciliumClusterwideNetworkPolicy *v2.CiliumClusterwideNetworkPolicy, opts v1.UpdateOptions) (*v2.CiliumClusterwideNetworkPolicy, error) + Create(ctx context.Context, ciliumClusterwideNetworkPolicy *ciliumiov2.CiliumClusterwideNetworkPolicy, opts v1.CreateOptions) (*ciliumiov2.CiliumClusterwideNetworkPolicy, error) + Update(ctx context.Context, ciliumClusterwideNetworkPolicy *ciliumiov2.CiliumClusterwideNetworkPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumClusterwideNetworkPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumClusterwideNetworkPolicy *v2.CiliumClusterwideNetworkPolicy, opts v1.UpdateOptions) (*v2.CiliumClusterwideNetworkPolicy, error) + UpdateStatus(ctx context.Context, ciliumClusterwideNetworkPolicy *ciliumiov2.CiliumClusterwideNetworkPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumClusterwideNetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumClusterwideNetworkPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumClusterwideNetworkPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumClusterwideNetworkPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumClusterwideNetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumClusterwideNetworkPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumClusterwideNetworkPolicy, err error) CiliumClusterwideNetworkPolicyExpansion } // ciliumClusterwideNetworkPolicies implements CiliumClusterwideNetworkPolicyInterface type ciliumClusterwideNetworkPolicies struct { - *gentype.ClientWithList[*v2.CiliumClusterwideNetworkPolicy, *v2.CiliumClusterwideNetworkPolicyList] + *gentype.ClientWithList[*ciliumiov2.CiliumClusterwideNetworkPolicy, *ciliumiov2.CiliumClusterwideNetworkPolicyList] } // newCiliumClusterwideNetworkPolicies returns a CiliumClusterwideNetworkPolicies func newCiliumClusterwideNetworkPolicies(c *CiliumV2Client) *ciliumClusterwideNetworkPolicies { return &ciliumClusterwideNetworkPolicies{ - gentype.NewClientWithList[*v2.CiliumClusterwideNetworkPolicy, *v2.CiliumClusterwideNetworkPolicyList]( + gentype.NewClientWithList[*ciliumiov2.CiliumClusterwideNetworkPolicy, *ciliumiov2.CiliumClusterwideNetworkPolicyList]( "ciliumclusterwidenetworkpolicies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumClusterwideNetworkPolicy { return &v2.CiliumClusterwideNetworkPolicy{} }, - func() *v2.CiliumClusterwideNetworkPolicyList { return &v2.CiliumClusterwideNetworkPolicyList{} }), + func() *ciliumiov2.CiliumClusterwideNetworkPolicy { return &ciliumiov2.CiliumClusterwideNetworkPolicy{} }, + func() *ciliumiov2.CiliumClusterwideNetworkPolicyList { + return &ciliumiov2.CiliumClusterwideNetworkPolicyList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumegressgatewaypolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumegressgatewaypolicy.go index b7ce13b0a68fe..72678522e7a24 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumegressgatewaypolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumegressgatewaypolicy.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumEgressGatewayPoliciesGetter interface { // CiliumEgressGatewayPolicyInterface has methods to work with CiliumEgressGatewayPolicy resources. type CiliumEgressGatewayPolicyInterface interface { - Create(ctx context.Context, ciliumEgressGatewayPolicy *v2.CiliumEgressGatewayPolicy, opts v1.CreateOptions) (*v2.CiliumEgressGatewayPolicy, error) - Update(ctx context.Context, ciliumEgressGatewayPolicy *v2.CiliumEgressGatewayPolicy, opts v1.UpdateOptions) (*v2.CiliumEgressGatewayPolicy, error) + Create(ctx context.Context, ciliumEgressGatewayPolicy *ciliumiov2.CiliumEgressGatewayPolicy, opts v1.CreateOptions) (*ciliumiov2.CiliumEgressGatewayPolicy, error) + Update(ctx context.Context, ciliumEgressGatewayPolicy *ciliumiov2.CiliumEgressGatewayPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumEgressGatewayPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumEgressGatewayPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumEgressGatewayPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumEgressGatewayPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumEgressGatewayPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumEgressGatewayPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumEgressGatewayPolicy, err error) CiliumEgressGatewayPolicyExpansion } // ciliumEgressGatewayPolicies implements CiliumEgressGatewayPolicyInterface type ciliumEgressGatewayPolicies struct { - *gentype.ClientWithList[*v2.CiliumEgressGatewayPolicy, *v2.CiliumEgressGatewayPolicyList] + *gentype.ClientWithList[*ciliumiov2.CiliumEgressGatewayPolicy, *ciliumiov2.CiliumEgressGatewayPolicyList] } // newCiliumEgressGatewayPolicies returns a CiliumEgressGatewayPolicies func newCiliumEgressGatewayPolicies(c *CiliumV2Client) *ciliumEgressGatewayPolicies { return &ciliumEgressGatewayPolicies{ - gentype.NewClientWithList[*v2.CiliumEgressGatewayPolicy, *v2.CiliumEgressGatewayPolicyList]( + gentype.NewClientWithList[*ciliumiov2.CiliumEgressGatewayPolicy, *ciliumiov2.CiliumEgressGatewayPolicyList]( "ciliumegressgatewaypolicies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumEgressGatewayPolicy { return &v2.CiliumEgressGatewayPolicy{} }, - func() *v2.CiliumEgressGatewayPolicyList { return &v2.CiliumEgressGatewayPolicyList{} }), + func() *ciliumiov2.CiliumEgressGatewayPolicy { return &ciliumiov2.CiliumEgressGatewayPolicy{} }, + func() *ciliumiov2.CiliumEgressGatewayPolicyList { return &ciliumiov2.CiliumEgressGatewayPolicyList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumendpoint.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumendpoint.go index 69aecf1f97333..465fbcb313b36 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumendpoint.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumendpoint.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumEndpointsGetter interface { // CiliumEndpointInterface has methods to work with CiliumEndpoint resources. type CiliumEndpointInterface interface { - Create(ctx context.Context, ciliumEndpoint *v2.CiliumEndpoint, opts v1.CreateOptions) (*v2.CiliumEndpoint, error) - Update(ctx context.Context, ciliumEndpoint *v2.CiliumEndpoint, opts v1.UpdateOptions) (*v2.CiliumEndpoint, error) + Create(ctx context.Context, ciliumEndpoint *ciliumiov2.CiliumEndpoint, opts v1.CreateOptions) (*ciliumiov2.CiliumEndpoint, error) + Update(ctx context.Context, ciliumEndpoint *ciliumiov2.CiliumEndpoint, opts v1.UpdateOptions) (*ciliumiov2.CiliumEndpoint, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumEndpoint *v2.CiliumEndpoint, opts v1.UpdateOptions) (*v2.CiliumEndpoint, error) + UpdateStatus(ctx context.Context, ciliumEndpoint *ciliumiov2.CiliumEndpoint, opts v1.UpdateOptions) (*ciliumiov2.CiliumEndpoint, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumEndpoint, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumEndpointList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumEndpoint, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumEndpointList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumEndpoint, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumEndpoint, err error) CiliumEndpointExpansion } // ciliumEndpoints implements CiliumEndpointInterface type ciliumEndpoints struct { - *gentype.ClientWithList[*v2.CiliumEndpoint, *v2.CiliumEndpointList] + *gentype.ClientWithList[*ciliumiov2.CiliumEndpoint, *ciliumiov2.CiliumEndpointList] } // newCiliumEndpoints returns a CiliumEndpoints func newCiliumEndpoints(c *CiliumV2Client, namespace string) *ciliumEndpoints { return &ciliumEndpoints{ - gentype.NewClientWithList[*v2.CiliumEndpoint, *v2.CiliumEndpointList]( + gentype.NewClientWithList[*ciliumiov2.CiliumEndpoint, *ciliumiov2.CiliumEndpointList]( "ciliumendpoints", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2.CiliumEndpoint { return &v2.CiliumEndpoint{} }, - func() *v2.CiliumEndpointList { return &v2.CiliumEndpointList{} }), + func() *ciliumiov2.CiliumEndpoint { return &ciliumiov2.CiliumEndpoint{} }, + func() *ciliumiov2.CiliumEndpointList { return &ciliumiov2.CiliumEndpointList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumenvoyconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumenvoyconfig.go index 17ff408629d08..0689645fb3123 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumenvoyconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumenvoyconfig.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumEnvoyConfigsGetter interface { // CiliumEnvoyConfigInterface has methods to work with CiliumEnvoyConfig resources. type CiliumEnvoyConfigInterface interface { - Create(ctx context.Context, ciliumEnvoyConfig *v2.CiliumEnvoyConfig, opts v1.CreateOptions) (*v2.CiliumEnvoyConfig, error) - Update(ctx context.Context, ciliumEnvoyConfig *v2.CiliumEnvoyConfig, opts v1.UpdateOptions) (*v2.CiliumEnvoyConfig, error) + Create(ctx context.Context, ciliumEnvoyConfig *ciliumiov2.CiliumEnvoyConfig, opts v1.CreateOptions) (*ciliumiov2.CiliumEnvoyConfig, error) + Update(ctx context.Context, ciliumEnvoyConfig *ciliumiov2.CiliumEnvoyConfig, opts v1.UpdateOptions) (*ciliumiov2.CiliumEnvoyConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumEnvoyConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumEnvoyConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumEnvoyConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumEnvoyConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumEnvoyConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumEnvoyConfig, err error) CiliumEnvoyConfigExpansion } // ciliumEnvoyConfigs implements CiliumEnvoyConfigInterface type ciliumEnvoyConfigs struct { - *gentype.ClientWithList[*v2.CiliumEnvoyConfig, *v2.CiliumEnvoyConfigList] + *gentype.ClientWithList[*ciliumiov2.CiliumEnvoyConfig, *ciliumiov2.CiliumEnvoyConfigList] } // newCiliumEnvoyConfigs returns a CiliumEnvoyConfigs func newCiliumEnvoyConfigs(c *CiliumV2Client, namespace string) *ciliumEnvoyConfigs { return &ciliumEnvoyConfigs{ - gentype.NewClientWithList[*v2.CiliumEnvoyConfig, *v2.CiliumEnvoyConfigList]( + gentype.NewClientWithList[*ciliumiov2.CiliumEnvoyConfig, *ciliumiov2.CiliumEnvoyConfigList]( "ciliumenvoyconfigs", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2.CiliumEnvoyConfig { return &v2.CiliumEnvoyConfig{} }, - func() *v2.CiliumEnvoyConfigList { return &v2.CiliumEnvoyConfigList{} }), + func() *ciliumiov2.CiliumEnvoyConfig { return &ciliumiov2.CiliumEnvoyConfig{} }, + func() *ciliumiov2.CiliumEnvoyConfigList { return &ciliumiov2.CiliumEnvoyConfigList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumexternalworkload.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumexternalworkload.go index 17e04520c94eb..a6accef90d806 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumexternalworkload.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumexternalworkload.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumExternalWorkloadsGetter interface { // CiliumExternalWorkloadInterface has methods to work with CiliumExternalWorkload resources. type CiliumExternalWorkloadInterface interface { - Create(ctx context.Context, ciliumExternalWorkload *v2.CiliumExternalWorkload, opts v1.CreateOptions) (*v2.CiliumExternalWorkload, error) - Update(ctx context.Context, ciliumExternalWorkload *v2.CiliumExternalWorkload, opts v1.UpdateOptions) (*v2.CiliumExternalWorkload, error) + Create(ctx context.Context, ciliumExternalWorkload *ciliumiov2.CiliumExternalWorkload, opts v1.CreateOptions) (*ciliumiov2.CiliumExternalWorkload, error) + Update(ctx context.Context, ciliumExternalWorkload *ciliumiov2.CiliumExternalWorkload, opts v1.UpdateOptions) (*ciliumiov2.CiliumExternalWorkload, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumExternalWorkload *v2.CiliumExternalWorkload, opts v1.UpdateOptions) (*v2.CiliumExternalWorkload, error) + UpdateStatus(ctx context.Context, ciliumExternalWorkload *ciliumiov2.CiliumExternalWorkload, opts v1.UpdateOptions) (*ciliumiov2.CiliumExternalWorkload, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumExternalWorkload, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumExternalWorkloadList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumExternalWorkload, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumExternalWorkloadList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumExternalWorkload, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumExternalWorkload, err error) CiliumExternalWorkloadExpansion } // ciliumExternalWorkloads implements CiliumExternalWorkloadInterface type ciliumExternalWorkloads struct { - *gentype.ClientWithList[*v2.CiliumExternalWorkload, *v2.CiliumExternalWorkloadList] + *gentype.ClientWithList[*ciliumiov2.CiliumExternalWorkload, *ciliumiov2.CiliumExternalWorkloadList] } // newCiliumExternalWorkloads returns a CiliumExternalWorkloads func newCiliumExternalWorkloads(c *CiliumV2Client) *ciliumExternalWorkloads { return &ciliumExternalWorkloads{ - gentype.NewClientWithList[*v2.CiliumExternalWorkload, *v2.CiliumExternalWorkloadList]( + gentype.NewClientWithList[*ciliumiov2.CiliumExternalWorkload, *ciliumiov2.CiliumExternalWorkloadList]( "ciliumexternalworkloads", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumExternalWorkload { return &v2.CiliumExternalWorkload{} }, - func() *v2.CiliumExternalWorkloadList { return &v2.CiliumExternalWorkloadList{} }), + func() *ciliumiov2.CiliumExternalWorkload { return &ciliumiov2.CiliumExternalWorkload{} }, + func() *ciliumiov2.CiliumExternalWorkloadList { return &ciliumiov2.CiliumExternalWorkloadList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumidentity.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumidentity.go index a57453fa1bdfa..be8706d3b9c82 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumidentity.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumidentity.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumIdentitiesGetter interface { // CiliumIdentityInterface has methods to work with CiliumIdentity resources. type CiliumIdentityInterface interface { - Create(ctx context.Context, ciliumIdentity *v2.CiliumIdentity, opts v1.CreateOptions) (*v2.CiliumIdentity, error) - Update(ctx context.Context, ciliumIdentity *v2.CiliumIdentity, opts v1.UpdateOptions) (*v2.CiliumIdentity, error) + Create(ctx context.Context, ciliumIdentity *ciliumiov2.CiliumIdentity, opts v1.CreateOptions) (*ciliumiov2.CiliumIdentity, error) + Update(ctx context.Context, ciliumIdentity *ciliumiov2.CiliumIdentity, opts v1.UpdateOptions) (*ciliumiov2.CiliumIdentity, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumIdentity, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumIdentityList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumIdentity, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumIdentityList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumIdentity, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumIdentity, err error) CiliumIdentityExpansion } // ciliumIdentities implements CiliumIdentityInterface type ciliumIdentities struct { - *gentype.ClientWithList[*v2.CiliumIdentity, *v2.CiliumIdentityList] + *gentype.ClientWithList[*ciliumiov2.CiliumIdentity, *ciliumiov2.CiliumIdentityList] } // newCiliumIdentities returns a CiliumIdentities func newCiliumIdentities(c *CiliumV2Client) *ciliumIdentities { return &ciliumIdentities{ - gentype.NewClientWithList[*v2.CiliumIdentity, *v2.CiliumIdentityList]( + gentype.NewClientWithList[*ciliumiov2.CiliumIdentity, *ciliumiov2.CiliumIdentityList]( "ciliumidentities", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumIdentity { return &v2.CiliumIdentity{} }, - func() *v2.CiliumIdentityList { return &v2.CiliumIdentityList{} }), + func() *ciliumiov2.CiliumIdentity { return &ciliumiov2.CiliumIdentity{} }, + func() *ciliumiov2.CiliumIdentityList { return &ciliumiov2.CiliumIdentityList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumlocalredirectpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumlocalredirectpolicy.go index df1fe7c13ef01..9f5667fa9eb61 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumlocalredirectpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumlocalredirectpolicy.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumLocalRedirectPoliciesGetter interface { // CiliumLocalRedirectPolicyInterface has methods to work with CiliumLocalRedirectPolicy resources. type CiliumLocalRedirectPolicyInterface interface { - Create(ctx context.Context, ciliumLocalRedirectPolicy *v2.CiliumLocalRedirectPolicy, opts v1.CreateOptions) (*v2.CiliumLocalRedirectPolicy, error) - Update(ctx context.Context, ciliumLocalRedirectPolicy *v2.CiliumLocalRedirectPolicy, opts v1.UpdateOptions) (*v2.CiliumLocalRedirectPolicy, error) + Create(ctx context.Context, ciliumLocalRedirectPolicy *ciliumiov2.CiliumLocalRedirectPolicy, opts v1.CreateOptions) (*ciliumiov2.CiliumLocalRedirectPolicy, error) + Update(ctx context.Context, ciliumLocalRedirectPolicy *ciliumiov2.CiliumLocalRedirectPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumLocalRedirectPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumLocalRedirectPolicy *v2.CiliumLocalRedirectPolicy, opts v1.UpdateOptions) (*v2.CiliumLocalRedirectPolicy, error) + UpdateStatus(ctx context.Context, ciliumLocalRedirectPolicy *ciliumiov2.CiliumLocalRedirectPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumLocalRedirectPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumLocalRedirectPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumLocalRedirectPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumLocalRedirectPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumLocalRedirectPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumLocalRedirectPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumLocalRedirectPolicy, err error) CiliumLocalRedirectPolicyExpansion } // ciliumLocalRedirectPolicies implements CiliumLocalRedirectPolicyInterface type ciliumLocalRedirectPolicies struct { - *gentype.ClientWithList[*v2.CiliumLocalRedirectPolicy, *v2.CiliumLocalRedirectPolicyList] + *gentype.ClientWithList[*ciliumiov2.CiliumLocalRedirectPolicy, *ciliumiov2.CiliumLocalRedirectPolicyList] } // newCiliumLocalRedirectPolicies returns a CiliumLocalRedirectPolicies func newCiliumLocalRedirectPolicies(c *CiliumV2Client, namespace string) *ciliumLocalRedirectPolicies { return &ciliumLocalRedirectPolicies{ - gentype.NewClientWithList[*v2.CiliumLocalRedirectPolicy, *v2.CiliumLocalRedirectPolicyList]( + gentype.NewClientWithList[*ciliumiov2.CiliumLocalRedirectPolicy, *ciliumiov2.CiliumLocalRedirectPolicyList]( "ciliumlocalredirectpolicies", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2.CiliumLocalRedirectPolicy { return &v2.CiliumLocalRedirectPolicy{} }, - func() *v2.CiliumLocalRedirectPolicyList { return &v2.CiliumLocalRedirectPolicyList{} }), + func() *ciliumiov2.CiliumLocalRedirectPolicy { return &ciliumiov2.CiliumLocalRedirectPolicy{} }, + func() *ciliumiov2.CiliumLocalRedirectPolicyList { return &ciliumiov2.CiliumLocalRedirectPolicyList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnetworkpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnetworkpolicy.go index dc955aad0e67a..465f8e5485586 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnetworkpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnetworkpolicy.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumNetworkPoliciesGetter interface { // CiliumNetworkPolicyInterface has methods to work with CiliumNetworkPolicy resources. type CiliumNetworkPolicyInterface interface { - Create(ctx context.Context, ciliumNetworkPolicy *v2.CiliumNetworkPolicy, opts v1.CreateOptions) (*v2.CiliumNetworkPolicy, error) - Update(ctx context.Context, ciliumNetworkPolicy *v2.CiliumNetworkPolicy, opts v1.UpdateOptions) (*v2.CiliumNetworkPolicy, error) + Create(ctx context.Context, ciliumNetworkPolicy *ciliumiov2.CiliumNetworkPolicy, opts v1.CreateOptions) (*ciliumiov2.CiliumNetworkPolicy, error) + Update(ctx context.Context, ciliumNetworkPolicy *ciliumiov2.CiliumNetworkPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumNetworkPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumNetworkPolicy *v2.CiliumNetworkPolicy, opts v1.UpdateOptions) (*v2.CiliumNetworkPolicy, error) + UpdateStatus(ctx context.Context, ciliumNetworkPolicy *ciliumiov2.CiliumNetworkPolicy, opts v1.UpdateOptions) (*ciliumiov2.CiliumNetworkPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumNetworkPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumNetworkPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumNetworkPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumNetworkPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumNetworkPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumNetworkPolicy, err error) CiliumNetworkPolicyExpansion } // ciliumNetworkPolicies implements CiliumNetworkPolicyInterface type ciliumNetworkPolicies struct { - *gentype.ClientWithList[*v2.CiliumNetworkPolicy, *v2.CiliumNetworkPolicyList] + *gentype.ClientWithList[*ciliumiov2.CiliumNetworkPolicy, *ciliumiov2.CiliumNetworkPolicyList] } // newCiliumNetworkPolicies returns a CiliumNetworkPolicies func newCiliumNetworkPolicies(c *CiliumV2Client, namespace string) *ciliumNetworkPolicies { return &ciliumNetworkPolicies{ - gentype.NewClientWithList[*v2.CiliumNetworkPolicy, *v2.CiliumNetworkPolicyList]( + gentype.NewClientWithList[*ciliumiov2.CiliumNetworkPolicy, *ciliumiov2.CiliumNetworkPolicyList]( "ciliumnetworkpolicies", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2.CiliumNetworkPolicy { return &v2.CiliumNetworkPolicy{} }, - func() *v2.CiliumNetworkPolicyList { return &v2.CiliumNetworkPolicyList{} }), + func() *ciliumiov2.CiliumNetworkPolicy { return &ciliumiov2.CiliumNetworkPolicy{} }, + func() *ciliumiov2.CiliumNetworkPolicyList { return &ciliumiov2.CiliumNetworkPolicyList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnode.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnode.go index 7b4efd08c2ce1..c0137acc0adf9 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnode.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnode.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumNodesGetter interface { // CiliumNodeInterface has methods to work with CiliumNode resources. type CiliumNodeInterface interface { - Create(ctx context.Context, ciliumNode *v2.CiliumNode, opts v1.CreateOptions) (*v2.CiliumNode, error) - Update(ctx context.Context, ciliumNode *v2.CiliumNode, opts v1.UpdateOptions) (*v2.CiliumNode, error) + Create(ctx context.Context, ciliumNode *ciliumiov2.CiliumNode, opts v1.CreateOptions) (*ciliumiov2.CiliumNode, error) + Update(ctx context.Context, ciliumNode *ciliumiov2.CiliumNode, opts v1.UpdateOptions) (*ciliumiov2.CiliumNode, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumNode *v2.CiliumNode, opts v1.UpdateOptions) (*v2.CiliumNode, error) + UpdateStatus(ctx context.Context, ciliumNode *ciliumiov2.CiliumNode, opts v1.UpdateOptions) (*ciliumiov2.CiliumNode, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumNode, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumNodeList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumNode, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumNodeList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumNode, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumNode, err error) CiliumNodeExpansion } // ciliumNodes implements CiliumNodeInterface type ciliumNodes struct { - *gentype.ClientWithList[*v2.CiliumNode, *v2.CiliumNodeList] + *gentype.ClientWithList[*ciliumiov2.CiliumNode, *ciliumiov2.CiliumNodeList] } // newCiliumNodes returns a CiliumNodes func newCiliumNodes(c *CiliumV2Client) *ciliumNodes { return &ciliumNodes{ - gentype.NewClientWithList[*v2.CiliumNode, *v2.CiliumNodeList]( + gentype.NewClientWithList[*ciliumiov2.CiliumNode, *ciliumiov2.CiliumNodeList]( "ciliumnodes", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2.CiliumNode { return &v2.CiliumNode{} }, - func() *v2.CiliumNodeList { return &v2.CiliumNodeList{} }), + func() *ciliumiov2.CiliumNode { return &ciliumiov2.CiliumNode{} }, + func() *ciliumiov2.CiliumNodeList { return &ciliumiov2.CiliumNodeList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnodeconfig.go index 41352afcd1849..bade390b810e7 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/ciliumnodeconfig.go @@ -6,9 +6,9 @@ package v2 import ( - "context" + context "context" - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumNodeConfigsGetter interface { // CiliumNodeConfigInterface has methods to work with CiliumNodeConfig resources. type CiliumNodeConfigInterface interface { - Create(ctx context.Context, ciliumNodeConfig *v2.CiliumNodeConfig, opts v1.CreateOptions) (*v2.CiliumNodeConfig, error) - Update(ctx context.Context, ciliumNodeConfig *v2.CiliumNodeConfig, opts v1.UpdateOptions) (*v2.CiliumNodeConfig, error) + Create(ctx context.Context, ciliumNodeConfig *ciliumiov2.CiliumNodeConfig, opts v1.CreateOptions) (*ciliumiov2.CiliumNodeConfig, error) + Update(ctx context.Context, ciliumNodeConfig *ciliumiov2.CiliumNodeConfig, opts v1.UpdateOptions) (*ciliumiov2.CiliumNodeConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.CiliumNodeConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2.CiliumNodeConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2.CiliumNodeConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2.CiliumNodeConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.CiliumNodeConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2.CiliumNodeConfig, err error) CiliumNodeConfigExpansion } // ciliumNodeConfigs implements CiliumNodeConfigInterface type ciliumNodeConfigs struct { - *gentype.ClientWithList[*v2.CiliumNodeConfig, *v2.CiliumNodeConfigList] + *gentype.ClientWithList[*ciliumiov2.CiliumNodeConfig, *ciliumiov2.CiliumNodeConfigList] } // newCiliumNodeConfigs returns a CiliumNodeConfigs func newCiliumNodeConfigs(c *CiliumV2Client, namespace string) *ciliumNodeConfigs { return &ciliumNodeConfigs{ - gentype.NewClientWithList[*v2.CiliumNodeConfig, *v2.CiliumNodeConfigList]( + gentype.NewClientWithList[*ciliumiov2.CiliumNodeConfig, *ciliumiov2.CiliumNodeConfigList]( "ciliumnodeconfigs", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2.CiliumNodeConfig { return &v2.CiliumNodeConfig{} }, - func() *v2.CiliumNodeConfigList { return &v2.CiliumNodeConfigList{} }), + func() *ciliumiov2.CiliumNodeConfig { return &ciliumiov2.CiliumNodeConfig{} }, + func() *ciliumiov2.CiliumNodeConfigList { return &ciliumiov2.CiliumNodeConfigList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwideenvoyconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwideenvoyconfig.go index 118437894283f..1011b0b23ec11 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwideenvoyconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwideenvoyconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwidenetworkpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwidenetworkpolicy.go index d01302fc9b952..33f2d414c9f44 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwidenetworkpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumclusterwidenetworkpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumegressgatewaypolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumegressgatewaypolicy.go index c764e1bbc2c7d..516906ba67441 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumegressgatewaypolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumegressgatewaypolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumendpoint.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumendpoint.go index 8e03928026b4a..bac3a8c083e8f 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumendpoint.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumendpoint.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumenvoyconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumenvoyconfig.go index dbc7e396c121f..503a36d38a03c 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumenvoyconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumenvoyconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumexternalworkload.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumexternalworkload.go index d025ad416f851..36f78eb5720b3 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumexternalworkload.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumexternalworkload.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumidentity.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumidentity.go index e809859c57802..26eeca5e3fb95 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumidentity.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumidentity.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumlocalredirectpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumlocalredirectpolicy.go index 1942cf4dd4662..065593df5f9e6 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumlocalredirectpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumlocalredirectpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnetworkpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnetworkpolicy.go index 27b29b2d6dbe0..fc348be7961a7 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnetworkpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnetworkpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnode.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnode.go index 8e9f2b84fc14a..0f31a4834390a 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnode.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnode.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnodeconfig.go index 9a12d89a081b5..28693ed0e401f 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2/fake/fake_ciliumnodeconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/cilium.io_client.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/cilium.io_client.go index a217d05b8e0da..0a1b9b796bdd0 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/cilium.io_client.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/cilium.io_client.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - "net/http" + http "net/http" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -127,7 +127,7 @@ func New(c rest.Interface) *CiliumV2alpha1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v2alpha1.SchemeGroupVersion + gv := ciliumiov2alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpadvertisement.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpadvertisement.go index 67901294880f0..4b0569a824b5a 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpadvertisement.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpadvertisement.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,33 @@ type CiliumBGPAdvertisementsGetter interface { // CiliumBGPAdvertisementInterface has methods to work with CiliumBGPAdvertisement resources. type CiliumBGPAdvertisementInterface interface { - Create(ctx context.Context, ciliumBGPAdvertisement *v2alpha1.CiliumBGPAdvertisement, opts v1.CreateOptions) (*v2alpha1.CiliumBGPAdvertisement, error) - Update(ctx context.Context, ciliumBGPAdvertisement *v2alpha1.CiliumBGPAdvertisement, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPAdvertisement, error) + Create(ctx context.Context, ciliumBGPAdvertisement *ciliumiov2alpha1.CiliumBGPAdvertisement, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPAdvertisement, error) + Update(ctx context.Context, ciliumBGPAdvertisement *ciliumiov2alpha1.CiliumBGPAdvertisement, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPAdvertisement, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPAdvertisement, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPAdvertisementList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPAdvertisement, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPAdvertisementList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPAdvertisement, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPAdvertisement, err error) CiliumBGPAdvertisementExpansion } // ciliumBGPAdvertisements implements CiliumBGPAdvertisementInterface type ciliumBGPAdvertisements struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPAdvertisement, *v2alpha1.CiliumBGPAdvertisementList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPAdvertisement, *ciliumiov2alpha1.CiliumBGPAdvertisementList] } // newCiliumBGPAdvertisements returns a CiliumBGPAdvertisements func newCiliumBGPAdvertisements(c *CiliumV2alpha1Client) *ciliumBGPAdvertisements { return &ciliumBGPAdvertisements{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPAdvertisement, *v2alpha1.CiliumBGPAdvertisementList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPAdvertisement, *ciliumiov2alpha1.CiliumBGPAdvertisementList]( "ciliumbgpadvertisements", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPAdvertisement { return &v2alpha1.CiliumBGPAdvertisement{} }, - func() *v2alpha1.CiliumBGPAdvertisementList { return &v2alpha1.CiliumBGPAdvertisementList{} }), + func() *ciliumiov2alpha1.CiliumBGPAdvertisement { return &ciliumiov2alpha1.CiliumBGPAdvertisement{} }, + func() *ciliumiov2alpha1.CiliumBGPAdvertisementList { + return &ciliumiov2alpha1.CiliumBGPAdvertisementList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpclusterconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpclusterconfig.go index 95fe53344f8c9..7e93f0ca88826 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpclusterconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpclusterconfig.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,33 @@ type CiliumBGPClusterConfigsGetter interface { // CiliumBGPClusterConfigInterface has methods to work with CiliumBGPClusterConfig resources. type CiliumBGPClusterConfigInterface interface { - Create(ctx context.Context, ciliumBGPClusterConfig *v2alpha1.CiliumBGPClusterConfig, opts v1.CreateOptions) (*v2alpha1.CiliumBGPClusterConfig, error) - Update(ctx context.Context, ciliumBGPClusterConfig *v2alpha1.CiliumBGPClusterConfig, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPClusterConfig, error) + Create(ctx context.Context, ciliumBGPClusterConfig *ciliumiov2alpha1.CiliumBGPClusterConfig, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPClusterConfig, error) + Update(ctx context.Context, ciliumBGPClusterConfig *ciliumiov2alpha1.CiliumBGPClusterConfig, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPClusterConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPClusterConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPClusterConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPClusterConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPClusterConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPClusterConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPClusterConfig, err error) CiliumBGPClusterConfigExpansion } // ciliumBGPClusterConfigs implements CiliumBGPClusterConfigInterface type ciliumBGPClusterConfigs struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPClusterConfig, *v2alpha1.CiliumBGPClusterConfigList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPClusterConfig, *ciliumiov2alpha1.CiliumBGPClusterConfigList] } // newCiliumBGPClusterConfigs returns a CiliumBGPClusterConfigs func newCiliumBGPClusterConfigs(c *CiliumV2alpha1Client) *ciliumBGPClusterConfigs { return &ciliumBGPClusterConfigs{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPClusterConfig, *v2alpha1.CiliumBGPClusterConfigList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPClusterConfig, *ciliumiov2alpha1.CiliumBGPClusterConfigList]( "ciliumbgpclusterconfigs", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPClusterConfig { return &v2alpha1.CiliumBGPClusterConfig{} }, - func() *v2alpha1.CiliumBGPClusterConfigList { return &v2alpha1.CiliumBGPClusterConfigList{} }), + func() *ciliumiov2alpha1.CiliumBGPClusterConfig { return &ciliumiov2alpha1.CiliumBGPClusterConfig{} }, + func() *ciliumiov2alpha1.CiliumBGPClusterConfigList { + return &ciliumiov2alpha1.CiliumBGPClusterConfigList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfig.go index 15b1aa0337efb..64f715676c3f4 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfig.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type CiliumBGPNodeConfigsGetter interface { // CiliumBGPNodeConfigInterface has methods to work with CiliumBGPNodeConfig resources. type CiliumBGPNodeConfigInterface interface { - Create(ctx context.Context, ciliumBGPNodeConfig *v2alpha1.CiliumBGPNodeConfig, opts v1.CreateOptions) (*v2alpha1.CiliumBGPNodeConfig, error) - Update(ctx context.Context, ciliumBGPNodeConfig *v2alpha1.CiliumBGPNodeConfig, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPNodeConfig, error) + Create(ctx context.Context, ciliumBGPNodeConfig *ciliumiov2alpha1.CiliumBGPNodeConfig, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfig, error) + Update(ctx context.Context, ciliumBGPNodeConfig *ciliumiov2alpha1.CiliumBGPNodeConfig, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfig, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumBGPNodeConfig *v2alpha1.CiliumBGPNodeConfig, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPNodeConfig, error) + UpdateStatus(ctx context.Context, ciliumBGPNodeConfig *ciliumiov2alpha1.CiliumBGPNodeConfig, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPNodeConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPNodeConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPNodeConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPNodeConfig, err error) CiliumBGPNodeConfigExpansion } // ciliumBGPNodeConfigs implements CiliumBGPNodeConfigInterface type ciliumBGPNodeConfigs struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPNodeConfig, *v2alpha1.CiliumBGPNodeConfigList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPNodeConfig, *ciliumiov2alpha1.CiliumBGPNodeConfigList] } // newCiliumBGPNodeConfigs returns a CiliumBGPNodeConfigs func newCiliumBGPNodeConfigs(c *CiliumV2alpha1Client) *ciliumBGPNodeConfigs { return &ciliumBGPNodeConfigs{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPNodeConfig, *v2alpha1.CiliumBGPNodeConfigList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPNodeConfig, *ciliumiov2alpha1.CiliumBGPNodeConfigList]( "ciliumbgpnodeconfigs", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPNodeConfig { return &v2alpha1.CiliumBGPNodeConfig{} }, - func() *v2alpha1.CiliumBGPNodeConfigList { return &v2alpha1.CiliumBGPNodeConfigList{} }), + func() *ciliumiov2alpha1.CiliumBGPNodeConfig { return &ciliumiov2alpha1.CiliumBGPNodeConfig{} }, + func() *ciliumiov2alpha1.CiliumBGPNodeConfigList { return &ciliumiov2alpha1.CiliumBGPNodeConfigList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go index eb9bfa1b01b90..6c01aea7da820 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,35 @@ type CiliumBGPNodeConfigOverridesGetter interface { // CiliumBGPNodeConfigOverrideInterface has methods to work with CiliumBGPNodeConfigOverride resources. type CiliumBGPNodeConfigOverrideInterface interface { - Create(ctx context.Context, ciliumBGPNodeConfigOverride *v2alpha1.CiliumBGPNodeConfigOverride, opts v1.CreateOptions) (*v2alpha1.CiliumBGPNodeConfigOverride, error) - Update(ctx context.Context, ciliumBGPNodeConfigOverride *v2alpha1.CiliumBGPNodeConfigOverride, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPNodeConfigOverride, error) + Create(ctx context.Context, ciliumBGPNodeConfigOverride *ciliumiov2alpha1.CiliumBGPNodeConfigOverride, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, error) + Update(ctx context.Context, ciliumBGPNodeConfigOverride *ciliumiov2alpha1.CiliumBGPNodeConfigOverride, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPNodeConfigOverride, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPNodeConfigOverrideList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPNodeConfigOverrideList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPNodeConfigOverride, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPNodeConfigOverride, err error) CiliumBGPNodeConfigOverrideExpansion } // ciliumBGPNodeConfigOverrides implements CiliumBGPNodeConfigOverrideInterface type ciliumBGPNodeConfigOverrides struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPNodeConfigOverride, *v2alpha1.CiliumBGPNodeConfigOverrideList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, *ciliumiov2alpha1.CiliumBGPNodeConfigOverrideList] } // newCiliumBGPNodeConfigOverrides returns a CiliumBGPNodeConfigOverrides func newCiliumBGPNodeConfigOverrides(c *CiliumV2alpha1Client) *ciliumBGPNodeConfigOverrides { return &ciliumBGPNodeConfigOverrides{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPNodeConfigOverride, *v2alpha1.CiliumBGPNodeConfigOverrideList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, *ciliumiov2alpha1.CiliumBGPNodeConfigOverrideList]( "ciliumbgpnodeconfigoverrides", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPNodeConfigOverride { return &v2alpha1.CiliumBGPNodeConfigOverride{} }, - func() *v2alpha1.CiliumBGPNodeConfigOverrideList { return &v2alpha1.CiliumBGPNodeConfigOverrideList{} }), + func() *ciliumiov2alpha1.CiliumBGPNodeConfigOverride { + return &ciliumiov2alpha1.CiliumBGPNodeConfigOverride{} + }, + func() *ciliumiov2alpha1.CiliumBGPNodeConfigOverrideList { + return &ciliumiov2alpha1.CiliumBGPNodeConfigOverrideList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeerconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeerconfig.go index 8b5c9f3ce9fca..d3c60bdcb47fe 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeerconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeerconfig.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumBGPPeerConfigsGetter interface { // CiliumBGPPeerConfigInterface has methods to work with CiliumBGPPeerConfig resources. type CiliumBGPPeerConfigInterface interface { - Create(ctx context.Context, ciliumBGPPeerConfig *v2alpha1.CiliumBGPPeerConfig, opts v1.CreateOptions) (*v2alpha1.CiliumBGPPeerConfig, error) - Update(ctx context.Context, ciliumBGPPeerConfig *v2alpha1.CiliumBGPPeerConfig, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPPeerConfig, error) + Create(ctx context.Context, ciliumBGPPeerConfig *ciliumiov2alpha1.CiliumBGPPeerConfig, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPPeerConfig, error) + Update(ctx context.Context, ciliumBGPPeerConfig *ciliumiov2alpha1.CiliumBGPPeerConfig, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPPeerConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPPeerConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPPeerConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPPeerConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPPeerConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPPeerConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPPeerConfig, err error) CiliumBGPPeerConfigExpansion } // ciliumBGPPeerConfigs implements CiliumBGPPeerConfigInterface type ciliumBGPPeerConfigs struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPPeerConfig, *v2alpha1.CiliumBGPPeerConfigList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPPeerConfig, *ciliumiov2alpha1.CiliumBGPPeerConfigList] } // newCiliumBGPPeerConfigs returns a CiliumBGPPeerConfigs func newCiliumBGPPeerConfigs(c *CiliumV2alpha1Client) *ciliumBGPPeerConfigs { return &ciliumBGPPeerConfigs{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPPeerConfig, *v2alpha1.CiliumBGPPeerConfigList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPPeerConfig, *ciliumiov2alpha1.CiliumBGPPeerConfigList]( "ciliumbgppeerconfigs", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPPeerConfig { return &v2alpha1.CiliumBGPPeerConfig{} }, - func() *v2alpha1.CiliumBGPPeerConfigList { return &v2alpha1.CiliumBGPPeerConfigList{} }), + func() *ciliumiov2alpha1.CiliumBGPPeerConfig { return &ciliumiov2alpha1.CiliumBGPPeerConfig{} }, + func() *ciliumiov2alpha1.CiliumBGPPeerConfigList { return &ciliumiov2alpha1.CiliumBGPPeerConfigList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go index 38810278854a9..13c96bbcc4a41 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,33 @@ type CiliumBGPPeeringPoliciesGetter interface { // CiliumBGPPeeringPolicyInterface has methods to work with CiliumBGPPeeringPolicy resources. type CiliumBGPPeeringPolicyInterface interface { - Create(ctx context.Context, ciliumBGPPeeringPolicy *v2alpha1.CiliumBGPPeeringPolicy, opts v1.CreateOptions) (*v2alpha1.CiliumBGPPeeringPolicy, error) - Update(ctx context.Context, ciliumBGPPeeringPolicy *v2alpha1.CiliumBGPPeeringPolicy, opts v1.UpdateOptions) (*v2alpha1.CiliumBGPPeeringPolicy, error) + Create(ctx context.Context, ciliumBGPPeeringPolicy *ciliumiov2alpha1.CiliumBGPPeeringPolicy, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumBGPPeeringPolicy, error) + Update(ctx context.Context, ciliumBGPPeeringPolicy *ciliumiov2alpha1.CiliumBGPPeeringPolicy, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumBGPPeeringPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumBGPPeeringPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumBGPPeeringPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumBGPPeeringPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumBGPPeeringPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumBGPPeeringPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumBGPPeeringPolicy, err error) CiliumBGPPeeringPolicyExpansion } // ciliumBGPPeeringPolicies implements CiliumBGPPeeringPolicyInterface type ciliumBGPPeeringPolicies struct { - *gentype.ClientWithList[*v2alpha1.CiliumBGPPeeringPolicy, *v2alpha1.CiliumBGPPeeringPolicyList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumBGPPeeringPolicy, *ciliumiov2alpha1.CiliumBGPPeeringPolicyList] } // newCiliumBGPPeeringPolicies returns a CiliumBGPPeeringPolicies func newCiliumBGPPeeringPolicies(c *CiliumV2alpha1Client) *ciliumBGPPeeringPolicies { return &ciliumBGPPeeringPolicies{ - gentype.NewClientWithList[*v2alpha1.CiliumBGPPeeringPolicy, *v2alpha1.CiliumBGPPeeringPolicyList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumBGPPeeringPolicy, *ciliumiov2alpha1.CiliumBGPPeeringPolicyList]( "ciliumbgppeeringpolicies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumBGPPeeringPolicy { return &v2alpha1.CiliumBGPPeeringPolicy{} }, - func() *v2alpha1.CiliumBGPPeeringPolicyList { return &v2alpha1.CiliumBGPPeeringPolicyList{} }), + func() *ciliumiov2alpha1.CiliumBGPPeeringPolicy { return &ciliumiov2alpha1.CiliumBGPPeeringPolicy{} }, + func() *ciliumiov2alpha1.CiliumBGPPeeringPolicyList { + return &ciliumiov2alpha1.CiliumBGPPeeringPolicyList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumcidrgroup.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumcidrgroup.go index 57f13d70cc13f..74c10b86ce198 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumcidrgroup.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumcidrgroup.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumCIDRGroupsGetter interface { // CiliumCIDRGroupInterface has methods to work with CiliumCIDRGroup resources. type CiliumCIDRGroupInterface interface { - Create(ctx context.Context, ciliumCIDRGroup *v2alpha1.CiliumCIDRGroup, opts v1.CreateOptions) (*v2alpha1.CiliumCIDRGroup, error) - Update(ctx context.Context, ciliumCIDRGroup *v2alpha1.CiliumCIDRGroup, opts v1.UpdateOptions) (*v2alpha1.CiliumCIDRGroup, error) + Create(ctx context.Context, ciliumCIDRGroup *ciliumiov2alpha1.CiliumCIDRGroup, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumCIDRGroup, error) + Update(ctx context.Context, ciliumCIDRGroup *ciliumiov2alpha1.CiliumCIDRGroup, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumCIDRGroup, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumCIDRGroup, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumCIDRGroupList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumCIDRGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumCIDRGroupList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumCIDRGroup, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumCIDRGroup, err error) CiliumCIDRGroupExpansion } // ciliumCIDRGroups implements CiliumCIDRGroupInterface type ciliumCIDRGroups struct { - *gentype.ClientWithList[*v2alpha1.CiliumCIDRGroup, *v2alpha1.CiliumCIDRGroupList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumCIDRGroup, *ciliumiov2alpha1.CiliumCIDRGroupList] } // newCiliumCIDRGroups returns a CiliumCIDRGroups func newCiliumCIDRGroups(c *CiliumV2alpha1Client) *ciliumCIDRGroups { return &ciliumCIDRGroups{ - gentype.NewClientWithList[*v2alpha1.CiliumCIDRGroup, *v2alpha1.CiliumCIDRGroupList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumCIDRGroup, *ciliumiov2alpha1.CiliumCIDRGroupList]( "ciliumcidrgroups", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumCIDRGroup { return &v2alpha1.CiliumCIDRGroup{} }, - func() *v2alpha1.CiliumCIDRGroupList { return &v2alpha1.CiliumCIDRGroupList{} }), + func() *ciliumiov2alpha1.CiliumCIDRGroup { return &ciliumiov2alpha1.CiliumCIDRGroup{} }, + func() *ciliumiov2alpha1.CiliumCIDRGroupList { return &ciliumiov2alpha1.CiliumCIDRGroupList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumendpointslice.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumendpointslice.go index fe1444a53e94a..0fb1a99183e88 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumendpointslice.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumendpointslice.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumEndpointSlicesGetter interface { // CiliumEndpointSliceInterface has methods to work with CiliumEndpointSlice resources. type CiliumEndpointSliceInterface interface { - Create(ctx context.Context, ciliumEndpointSlice *v2alpha1.CiliumEndpointSlice, opts v1.CreateOptions) (*v2alpha1.CiliumEndpointSlice, error) - Update(ctx context.Context, ciliumEndpointSlice *v2alpha1.CiliumEndpointSlice, opts v1.UpdateOptions) (*v2alpha1.CiliumEndpointSlice, error) + Create(ctx context.Context, ciliumEndpointSlice *ciliumiov2alpha1.CiliumEndpointSlice, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumEndpointSlice, error) + Update(ctx context.Context, ciliumEndpointSlice *ciliumiov2alpha1.CiliumEndpointSlice, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumEndpointSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumEndpointSlice, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumEndpointSliceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumEndpointSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumEndpointSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumEndpointSlice, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumEndpointSlice, err error) CiliumEndpointSliceExpansion } // ciliumEndpointSlices implements CiliumEndpointSliceInterface type ciliumEndpointSlices struct { - *gentype.ClientWithList[*v2alpha1.CiliumEndpointSlice, *v2alpha1.CiliumEndpointSliceList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumEndpointSlice, *ciliumiov2alpha1.CiliumEndpointSliceList] } // newCiliumEndpointSlices returns a CiliumEndpointSlices func newCiliumEndpointSlices(c *CiliumV2alpha1Client) *ciliumEndpointSlices { return &ciliumEndpointSlices{ - gentype.NewClientWithList[*v2alpha1.CiliumEndpointSlice, *v2alpha1.CiliumEndpointSliceList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumEndpointSlice, *ciliumiov2alpha1.CiliumEndpointSliceList]( "ciliumendpointslices", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumEndpointSlice { return &v2alpha1.CiliumEndpointSlice{} }, - func() *v2alpha1.CiliumEndpointSliceList { return &v2alpha1.CiliumEndpointSliceList{} }), + func() *ciliumiov2alpha1.CiliumEndpointSlice { return &ciliumiov2alpha1.CiliumEndpointSlice{} }, + func() *ciliumiov2alpha1.CiliumEndpointSliceList { return &ciliumiov2alpha1.CiliumEndpointSliceList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliuml2announcementpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliuml2announcementpolicy.go index 30bb485d90115..f07a4d7f175b8 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliuml2announcementpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliuml2announcementpolicy.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,37 @@ type CiliumL2AnnouncementPoliciesGetter interface { // CiliumL2AnnouncementPolicyInterface has methods to work with CiliumL2AnnouncementPolicy resources. type CiliumL2AnnouncementPolicyInterface interface { - Create(ctx context.Context, ciliumL2AnnouncementPolicy *v2alpha1.CiliumL2AnnouncementPolicy, opts v1.CreateOptions) (*v2alpha1.CiliumL2AnnouncementPolicy, error) - Update(ctx context.Context, ciliumL2AnnouncementPolicy *v2alpha1.CiliumL2AnnouncementPolicy, opts v1.UpdateOptions) (*v2alpha1.CiliumL2AnnouncementPolicy, error) + Create(ctx context.Context, ciliumL2AnnouncementPolicy *ciliumiov2alpha1.CiliumL2AnnouncementPolicy, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, error) + Update(ctx context.Context, ciliumL2AnnouncementPolicy *ciliumiov2alpha1.CiliumL2AnnouncementPolicy, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumL2AnnouncementPolicy *v2alpha1.CiliumL2AnnouncementPolicy, opts v1.UpdateOptions) (*v2alpha1.CiliumL2AnnouncementPolicy, error) + UpdateStatus(ctx context.Context, ciliumL2AnnouncementPolicy *ciliumiov2alpha1.CiliumL2AnnouncementPolicy, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumL2AnnouncementPolicy, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumL2AnnouncementPolicyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicyList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumL2AnnouncementPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumL2AnnouncementPolicy, err error) CiliumL2AnnouncementPolicyExpansion } // ciliumL2AnnouncementPolicies implements CiliumL2AnnouncementPolicyInterface type ciliumL2AnnouncementPolicies struct { - *gentype.ClientWithList[*v2alpha1.CiliumL2AnnouncementPolicy, *v2alpha1.CiliumL2AnnouncementPolicyList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, *ciliumiov2alpha1.CiliumL2AnnouncementPolicyList] } // newCiliumL2AnnouncementPolicies returns a CiliumL2AnnouncementPolicies func newCiliumL2AnnouncementPolicies(c *CiliumV2alpha1Client) *ciliumL2AnnouncementPolicies { return &ciliumL2AnnouncementPolicies{ - gentype.NewClientWithList[*v2alpha1.CiliumL2AnnouncementPolicy, *v2alpha1.CiliumL2AnnouncementPolicyList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, *ciliumiov2alpha1.CiliumL2AnnouncementPolicyList]( "ciliuml2announcementpolicies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumL2AnnouncementPolicy { return &v2alpha1.CiliumL2AnnouncementPolicy{} }, - func() *v2alpha1.CiliumL2AnnouncementPolicyList { return &v2alpha1.CiliumL2AnnouncementPolicyList{} }), + func() *ciliumiov2alpha1.CiliumL2AnnouncementPolicy { + return &ciliumiov2alpha1.CiliumL2AnnouncementPolicy{} + }, + func() *ciliumiov2alpha1.CiliumL2AnnouncementPolicyList { + return &ciliumiov2alpha1.CiliumL2AnnouncementPolicyList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumloadbalancerippool.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumloadbalancerippool.go index 8c27774fe9d89..16e0894e652b3 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumloadbalancerippool.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumloadbalancerippool.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,35 @@ type CiliumLoadBalancerIPPoolsGetter interface { // CiliumLoadBalancerIPPoolInterface has methods to work with CiliumLoadBalancerIPPool resources. type CiliumLoadBalancerIPPoolInterface interface { - Create(ctx context.Context, ciliumLoadBalancerIPPool *v2alpha1.CiliumLoadBalancerIPPool, opts v1.CreateOptions) (*v2alpha1.CiliumLoadBalancerIPPool, error) - Update(ctx context.Context, ciliumLoadBalancerIPPool *v2alpha1.CiliumLoadBalancerIPPool, opts v1.UpdateOptions) (*v2alpha1.CiliumLoadBalancerIPPool, error) + Create(ctx context.Context, ciliumLoadBalancerIPPool *ciliumiov2alpha1.CiliumLoadBalancerIPPool, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumLoadBalancerIPPool, error) + Update(ctx context.Context, ciliumLoadBalancerIPPool *ciliumiov2alpha1.CiliumLoadBalancerIPPool, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumLoadBalancerIPPool, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, ciliumLoadBalancerIPPool *v2alpha1.CiliumLoadBalancerIPPool, opts v1.UpdateOptions) (*v2alpha1.CiliumLoadBalancerIPPool, error) + UpdateStatus(ctx context.Context, ciliumLoadBalancerIPPool *ciliumiov2alpha1.CiliumLoadBalancerIPPool, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumLoadBalancerIPPool, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumLoadBalancerIPPool, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumLoadBalancerIPPoolList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumLoadBalancerIPPool, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumLoadBalancerIPPoolList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumLoadBalancerIPPool, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumLoadBalancerIPPool, err error) CiliumLoadBalancerIPPoolExpansion } // ciliumLoadBalancerIPPools implements CiliumLoadBalancerIPPoolInterface type ciliumLoadBalancerIPPools struct { - *gentype.ClientWithList[*v2alpha1.CiliumLoadBalancerIPPool, *v2alpha1.CiliumLoadBalancerIPPoolList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumLoadBalancerIPPool, *ciliumiov2alpha1.CiliumLoadBalancerIPPoolList] } // newCiliumLoadBalancerIPPools returns a CiliumLoadBalancerIPPools func newCiliumLoadBalancerIPPools(c *CiliumV2alpha1Client) *ciliumLoadBalancerIPPools { return &ciliumLoadBalancerIPPools{ - gentype.NewClientWithList[*v2alpha1.CiliumLoadBalancerIPPool, *v2alpha1.CiliumLoadBalancerIPPoolList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumLoadBalancerIPPool, *ciliumiov2alpha1.CiliumLoadBalancerIPPoolList]( "ciliumloadbalancerippools", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumLoadBalancerIPPool { return &v2alpha1.CiliumLoadBalancerIPPool{} }, - func() *v2alpha1.CiliumLoadBalancerIPPoolList { return &v2alpha1.CiliumLoadBalancerIPPoolList{} }), + func() *ciliumiov2alpha1.CiliumLoadBalancerIPPool { return &ciliumiov2alpha1.CiliumLoadBalancerIPPool{} }, + func() *ciliumiov2alpha1.CiliumLoadBalancerIPPoolList { + return &ciliumiov2alpha1.CiliumLoadBalancerIPPoolList{} + }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumnodeconfig.go index 21f48ff578722..0751c2c497d22 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumnodeconfig.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumNodeConfigsGetter interface { // CiliumNodeConfigInterface has methods to work with CiliumNodeConfig resources. type CiliumNodeConfigInterface interface { - Create(ctx context.Context, ciliumNodeConfig *v2alpha1.CiliumNodeConfig, opts v1.CreateOptions) (*v2alpha1.CiliumNodeConfig, error) - Update(ctx context.Context, ciliumNodeConfig *v2alpha1.CiliumNodeConfig, opts v1.UpdateOptions) (*v2alpha1.CiliumNodeConfig, error) + Create(ctx context.Context, ciliumNodeConfig *ciliumiov2alpha1.CiliumNodeConfig, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumNodeConfig, error) + Update(ctx context.Context, ciliumNodeConfig *ciliumiov2alpha1.CiliumNodeConfig, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumNodeConfig, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumNodeConfig, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumNodeConfigList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumNodeConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumNodeConfigList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumNodeConfig, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumNodeConfig, err error) CiliumNodeConfigExpansion } // ciliumNodeConfigs implements CiliumNodeConfigInterface type ciliumNodeConfigs struct { - *gentype.ClientWithList[*v2alpha1.CiliumNodeConfig, *v2alpha1.CiliumNodeConfigList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumNodeConfig, *ciliumiov2alpha1.CiliumNodeConfigList] } // newCiliumNodeConfigs returns a CiliumNodeConfigs func newCiliumNodeConfigs(c *CiliumV2alpha1Client, namespace string) *ciliumNodeConfigs { return &ciliumNodeConfigs{ - gentype.NewClientWithList[*v2alpha1.CiliumNodeConfig, *v2alpha1.CiliumNodeConfigList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumNodeConfig, *ciliumiov2alpha1.CiliumNodeConfigList]( "ciliumnodeconfigs", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v2alpha1.CiliumNodeConfig { return &v2alpha1.CiliumNodeConfig{} }, - func() *v2alpha1.CiliumNodeConfigList { return &v2alpha1.CiliumNodeConfigList{} }), + func() *ciliumiov2alpha1.CiliumNodeConfig { return &ciliumiov2alpha1.CiliumNodeConfig{} }, + func() *ciliumiov2alpha1.CiliumNodeConfigList { return &ciliumiov2alpha1.CiliumNodeConfigList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumpodippool.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumpodippool.go index d5886904ccd64..b32eca9148e80 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumpodippool.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/ciliumpodippool.go @@ -6,9 +6,9 @@ package v2alpha1 import ( - "context" + context "context" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" scheme "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type CiliumPodIPPoolsGetter interface { // CiliumPodIPPoolInterface has methods to work with CiliumPodIPPool resources. type CiliumPodIPPoolInterface interface { - Create(ctx context.Context, ciliumPodIPPool *v2alpha1.CiliumPodIPPool, opts v1.CreateOptions) (*v2alpha1.CiliumPodIPPool, error) - Update(ctx context.Context, ciliumPodIPPool *v2alpha1.CiliumPodIPPool, opts v1.UpdateOptions) (*v2alpha1.CiliumPodIPPool, error) + Create(ctx context.Context, ciliumPodIPPool *ciliumiov2alpha1.CiliumPodIPPool, opts v1.CreateOptions) (*ciliumiov2alpha1.CiliumPodIPPool, error) + Update(ctx context.Context, ciliumPodIPPool *ciliumiov2alpha1.CiliumPodIPPool, opts v1.UpdateOptions) (*ciliumiov2alpha1.CiliumPodIPPool, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CiliumPodIPPool, error) - List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CiliumPodIPPoolList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*ciliumiov2alpha1.CiliumPodIPPool, error) + List(ctx context.Context, opts v1.ListOptions) (*ciliumiov2alpha1.CiliumPodIPPoolList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CiliumPodIPPool, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *ciliumiov2alpha1.CiliumPodIPPool, err error) CiliumPodIPPoolExpansion } // ciliumPodIPPools implements CiliumPodIPPoolInterface type ciliumPodIPPools struct { - *gentype.ClientWithList[*v2alpha1.CiliumPodIPPool, *v2alpha1.CiliumPodIPPoolList] + *gentype.ClientWithList[*ciliumiov2alpha1.CiliumPodIPPool, *ciliumiov2alpha1.CiliumPodIPPoolList] } // newCiliumPodIPPools returns a CiliumPodIPPools func newCiliumPodIPPools(c *CiliumV2alpha1Client) *ciliumPodIPPools { return &ciliumPodIPPools{ - gentype.NewClientWithList[*v2alpha1.CiliumPodIPPool, *v2alpha1.CiliumPodIPPoolList]( + gentype.NewClientWithList[*ciliumiov2alpha1.CiliumPodIPPool, *ciliumiov2alpha1.CiliumPodIPPoolList]( "ciliumpodippools", c.RESTClient(), scheme.ParameterCodec, "", - func() *v2alpha1.CiliumPodIPPool { return &v2alpha1.CiliumPodIPPool{} }, - func() *v2alpha1.CiliumPodIPPoolList { return &v2alpha1.CiliumPodIPPoolList{} }), + func() *ciliumiov2alpha1.CiliumPodIPPool { return &ciliumiov2alpha1.CiliumPodIPPool{} }, + func() *ciliumiov2alpha1.CiliumPodIPPoolList { return &ciliumiov2alpha1.CiliumPodIPPoolList{} }), } } diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpadvertisement.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpadvertisement.go index 632ad328c7ee6..870f67b046e8f 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpadvertisement.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpadvertisement.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpclusterconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpclusterconfig.go index c45f25cf1c5a3..c9c2ec49d1ebf 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpclusterconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpclusterconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfig.go index 4ab45f62a0626..ac4adef455f84 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfigoverride.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfigoverride.go index 1bd76eee62f8a..e4a9b33025a7a 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfigoverride.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgpnodeconfigoverride.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeerconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeerconfig.go index 650a69554fa4b..4e79d5e70328b 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeerconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeerconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeeringpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeeringpolicy.go index 7de7d6ee3d6ab..ec210452122fa 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeeringpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumbgppeeringpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumcidrgroup.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumcidrgroup.go index a610e44bc7d6a..12e3005c7da29 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumcidrgroup.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumcidrgroup.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumendpointslice.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumendpointslice.go index 78d0ea99bdbe8..f56cbfb49fe5d 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumendpointslice.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumendpointslice.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliuml2announcementpolicy.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliuml2announcementpolicy.go index 06ddc9e6ace86..042d007583e33 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliuml2announcementpolicy.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliuml2announcementpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumloadbalancerippool.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumloadbalancerippool.go index fd1a6ae957233..4c13050a6b889 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumloadbalancerippool.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumloadbalancerippool.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumnodeconfig.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumnodeconfig.go index 9af0a60ae45ea..9b22fdd01f292 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumnodeconfig.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumnodeconfig.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumpodippool.go b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumpodippool.go index 0e84fab8c72e0..dbdb96eb10359 100644 --- a/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumpodippool.go +++ b/pkg/k8s/client/clientset/versioned/typed/cilium.io/v2alpha1/fake/fake_ciliumpodippool.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwideenvoyconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwideenvoyconfig.go index ab11f76feb806..a0a66bbca1e8c 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwideenvoyconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwideenvoyconfig.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumClusterwideEnvoyConfigs. type CiliumClusterwideEnvoyConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumClusterwideEnvoyConfigLister + Lister() ciliumiov2.CiliumClusterwideEnvoyConfigLister } type ciliumClusterwideEnvoyConfigInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumClusterwideEnvoyConfigInformer(client versioned.Interface, return client.CiliumV2().CiliumClusterwideEnvoyConfigs().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumClusterwideEnvoyConfig{}, + &apisciliumiov2.CiliumClusterwideEnvoyConfig{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumClusterwideEnvoyConfigInformer) defaultInformer(client versioned. } func (f *ciliumClusterwideEnvoyConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumClusterwideEnvoyConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumClusterwideEnvoyConfig{}, f.defaultInformer) } -func (f *ciliumClusterwideEnvoyConfigInformer) Lister() v2.CiliumClusterwideEnvoyConfigLister { - return v2.NewCiliumClusterwideEnvoyConfigLister(f.Informer().GetIndexer()) +func (f *ciliumClusterwideEnvoyConfigInformer) Lister() ciliumiov2.CiliumClusterwideEnvoyConfigLister { + return ciliumiov2.NewCiliumClusterwideEnvoyConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwidenetworkpolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwidenetworkpolicy.go index 68db1b7413ddd..60a32547eaa27 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwidenetworkpolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumclusterwidenetworkpolicy.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumClusterwideNetworkPolicies. type CiliumClusterwideNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumClusterwideNetworkPolicyLister + Lister() ciliumiov2.CiliumClusterwideNetworkPolicyLister } type ciliumClusterwideNetworkPolicyInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumClusterwideNetworkPolicyInformer(client versioned.Interfac return client.CiliumV2().CiliumClusterwideNetworkPolicies().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumClusterwideNetworkPolicy{}, + &apisciliumiov2.CiliumClusterwideNetworkPolicy{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumClusterwideNetworkPolicyInformer) defaultInformer(client versione } func (f *ciliumClusterwideNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumClusterwideNetworkPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumClusterwideNetworkPolicy{}, f.defaultInformer) } -func (f *ciliumClusterwideNetworkPolicyInformer) Lister() v2.CiliumClusterwideNetworkPolicyLister { - return v2.NewCiliumClusterwideNetworkPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumClusterwideNetworkPolicyInformer) Lister() ciliumiov2.CiliumClusterwideNetworkPolicyLister { + return ciliumiov2.NewCiliumClusterwideNetworkPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumegressgatewaypolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumegressgatewaypolicy.go index 0fc551c08ca2e..0a60eda9d85aa 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumegressgatewaypolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumegressgatewaypolicy.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumEgressGatewayPolicies. type CiliumEgressGatewayPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumEgressGatewayPolicyLister + Lister() ciliumiov2.CiliumEgressGatewayPolicyLister } type ciliumEgressGatewayPolicyInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumEgressGatewayPolicyInformer(client versioned.Interface, re return client.CiliumV2().CiliumEgressGatewayPolicies().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumEgressGatewayPolicy{}, + &apisciliumiov2.CiliumEgressGatewayPolicy{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumEgressGatewayPolicyInformer) defaultInformer(client versioned.Int } func (f *ciliumEgressGatewayPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumEgressGatewayPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumEgressGatewayPolicy{}, f.defaultInformer) } -func (f *ciliumEgressGatewayPolicyInformer) Lister() v2.CiliumEgressGatewayPolicyLister { - return v2.NewCiliumEgressGatewayPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumEgressGatewayPolicyInformer) Lister() ciliumiov2.CiliumEgressGatewayPolicyLister { + return ciliumiov2.NewCiliumEgressGatewayPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumendpoint.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumendpoint.go index 6c4aae1657bd2..e754ad71cb67f 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumendpoint.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumendpoint.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumEndpoints. type CiliumEndpointInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumEndpointLister + Lister() ciliumiov2.CiliumEndpointLister } type ciliumEndpointInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumEndpointInformer(client versioned.Interface, namespace str return client.CiliumV2().CiliumEndpoints(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumEndpoint{}, + &apisciliumiov2.CiliumEndpoint{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumEndpointInformer) defaultInformer(client versioned.Interface, res } func (f *ciliumEndpointInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumEndpoint{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumEndpoint{}, f.defaultInformer) } -func (f *ciliumEndpointInformer) Lister() v2.CiliumEndpointLister { - return v2.NewCiliumEndpointLister(f.Informer().GetIndexer()) +func (f *ciliumEndpointInformer) Lister() ciliumiov2.CiliumEndpointLister { + return ciliumiov2.NewCiliumEndpointLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumenvoyconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumenvoyconfig.go index 9d2b06ddc9140..03883a2148c43 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumenvoyconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumenvoyconfig.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumEnvoyConfigs. type CiliumEnvoyConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumEnvoyConfigLister + Lister() ciliumiov2.CiliumEnvoyConfigLister } type ciliumEnvoyConfigInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumEnvoyConfigInformer(client versioned.Interface, namespace return client.CiliumV2().CiliumEnvoyConfigs(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumEnvoyConfig{}, + &apisciliumiov2.CiliumEnvoyConfig{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumEnvoyConfigInformer) defaultInformer(client versioned.Interface, } func (f *ciliumEnvoyConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumEnvoyConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumEnvoyConfig{}, f.defaultInformer) } -func (f *ciliumEnvoyConfigInformer) Lister() v2.CiliumEnvoyConfigLister { - return v2.NewCiliumEnvoyConfigLister(f.Informer().GetIndexer()) +func (f *ciliumEnvoyConfigInformer) Lister() ciliumiov2.CiliumEnvoyConfigLister { + return ciliumiov2.NewCiliumEnvoyConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumexternalworkload.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumexternalworkload.go index 39755c67d2aeb..06a682179a174 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumexternalworkload.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumexternalworkload.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumExternalWorkloads. type CiliumExternalWorkloadInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumExternalWorkloadLister + Lister() ciliumiov2.CiliumExternalWorkloadLister } type ciliumExternalWorkloadInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumExternalWorkloadInformer(client versioned.Interface, resyn return client.CiliumV2().CiliumExternalWorkloads().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumExternalWorkload{}, + &apisciliumiov2.CiliumExternalWorkload{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumExternalWorkloadInformer) defaultInformer(client versioned.Interf } func (f *ciliumExternalWorkloadInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumExternalWorkload{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumExternalWorkload{}, f.defaultInformer) } -func (f *ciliumExternalWorkloadInformer) Lister() v2.CiliumExternalWorkloadLister { - return v2.NewCiliumExternalWorkloadLister(f.Informer().GetIndexer()) +func (f *ciliumExternalWorkloadInformer) Lister() ciliumiov2.CiliumExternalWorkloadLister { + return ciliumiov2.NewCiliumExternalWorkloadLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumidentity.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumidentity.go index 4d092419376f8..e15c251adb08d 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumidentity.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumidentity.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumIdentities. type CiliumIdentityInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumIdentityLister + Lister() ciliumiov2.CiliumIdentityLister } type ciliumIdentityInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumIdentityInformer(client versioned.Interface, resyncPeriod return client.CiliumV2().CiliumIdentities().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumIdentity{}, + &apisciliumiov2.CiliumIdentity{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumIdentityInformer) defaultInformer(client versioned.Interface, res } func (f *ciliumIdentityInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumIdentity{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumIdentity{}, f.defaultInformer) } -func (f *ciliumIdentityInformer) Lister() v2.CiliumIdentityLister { - return v2.NewCiliumIdentityLister(f.Informer().GetIndexer()) +func (f *ciliumIdentityInformer) Lister() ciliumiov2.CiliumIdentityLister { + return ciliumiov2.NewCiliumIdentityLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumlocalredirectpolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumlocalredirectpolicy.go index 23c7bd60c9ae7..f9913fe052a88 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumlocalredirectpolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumlocalredirectpolicy.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumLocalRedirectPolicies. type CiliumLocalRedirectPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumLocalRedirectPolicyLister + Lister() ciliumiov2.CiliumLocalRedirectPolicyLister } type ciliumLocalRedirectPolicyInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumLocalRedirectPolicyInformer(client versioned.Interface, na return client.CiliumV2().CiliumLocalRedirectPolicies(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumLocalRedirectPolicy{}, + &apisciliumiov2.CiliumLocalRedirectPolicy{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumLocalRedirectPolicyInformer) defaultInformer(client versioned.Int } func (f *ciliumLocalRedirectPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumLocalRedirectPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumLocalRedirectPolicy{}, f.defaultInformer) } -func (f *ciliumLocalRedirectPolicyInformer) Lister() v2.CiliumLocalRedirectPolicyLister { - return v2.NewCiliumLocalRedirectPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumLocalRedirectPolicyInformer) Lister() ciliumiov2.CiliumLocalRedirectPolicyLister { + return ciliumiov2.NewCiliumLocalRedirectPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnetworkpolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnetworkpolicy.go index 84812f67d2aad..b011c4fc76919 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnetworkpolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnetworkpolicy.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumNetworkPolicies. type CiliumNetworkPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumNetworkPolicyLister + Lister() ciliumiov2.CiliumNetworkPolicyLister } type ciliumNetworkPolicyInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumNetworkPolicyInformer(client versioned.Interface, namespac return client.CiliumV2().CiliumNetworkPolicies(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumNetworkPolicy{}, + &apisciliumiov2.CiliumNetworkPolicy{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumNetworkPolicyInformer) defaultInformer(client versioned.Interface } func (f *ciliumNetworkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumNetworkPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumNetworkPolicy{}, f.defaultInformer) } -func (f *ciliumNetworkPolicyInformer) Lister() v2.CiliumNetworkPolicyLister { - return v2.NewCiliumNetworkPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumNetworkPolicyInformer) Lister() ciliumiov2.CiliumNetworkPolicyLister { + return ciliumiov2.NewCiliumNetworkPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnode.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnode.go index c040b33069750..b5b3315f29504 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnode.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnode.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumNodes. type CiliumNodeInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumNodeLister + Lister() ciliumiov2.CiliumNodeLister } type ciliumNodeInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumNodeInformer(client versioned.Interface, resyncPeriod time return client.CiliumV2().CiliumNodes().Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumNode{}, + &apisciliumiov2.CiliumNode{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumNodeInformer) defaultInformer(client versioned.Interface, resyncP } func (f *ciliumNodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumNode{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumNode{}, f.defaultInformer) } -func (f *ciliumNodeInformer) Lister() v2.CiliumNodeLister { - return v2.NewCiliumNodeLister(f.Informer().GetIndexer()) +func (f *ciliumNodeInformer) Lister() ciliumiov2.CiliumNodeLister { + return ciliumiov2.NewCiliumNodeLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnodeconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnodeconfig.go index 9254cfa990608..3d589a48f2de6 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnodeconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2/ciliumnodeconfig.go @@ -6,13 +6,13 @@ package v2 import ( - "context" + context "context" time "time" - ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + apisciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumNodeConfigs. type CiliumNodeConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2.CiliumNodeConfigLister + Lister() ciliumiov2.CiliumNodeConfigLister } type ciliumNodeConfigInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumNodeConfigInformer(client versioned.Interface, namespace s return client.CiliumV2().CiliumNodeConfigs(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2.CiliumNodeConfig{}, + &apisciliumiov2.CiliumNodeConfig{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumNodeConfigInformer) defaultInformer(client versioned.Interface, r } func (f *ciliumNodeConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2.CiliumNodeConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2.CiliumNodeConfig{}, f.defaultInformer) } -func (f *ciliumNodeConfigInformer) Lister() v2.CiliumNodeConfigLister { - return v2.NewCiliumNodeConfigLister(f.Informer().GetIndexer()) +func (f *ciliumNodeConfigInformer) Lister() ciliumiov2.CiliumNodeConfigLister { + return ciliumiov2.NewCiliumNodeConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpadvertisement.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpadvertisement.go index 80132f6348433..ffcbede089bd1 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpadvertisement.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpadvertisement.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPAdvertisements. type CiliumBGPAdvertisementInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPAdvertisementLister + Lister() ciliumiov2alpha1.CiliumBGPAdvertisementLister } type ciliumBGPAdvertisementInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPAdvertisementInformer(client versioned.Interface, resyn return client.CiliumV2alpha1().CiliumBGPAdvertisements().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPAdvertisement{}, + &apisciliumiov2alpha1.CiliumBGPAdvertisement{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPAdvertisementInformer) defaultInformer(client versioned.Interf } func (f *ciliumBGPAdvertisementInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPAdvertisement{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPAdvertisement{}, f.defaultInformer) } -func (f *ciliumBGPAdvertisementInformer) Lister() v2alpha1.CiliumBGPAdvertisementLister { - return v2alpha1.NewCiliumBGPAdvertisementLister(f.Informer().GetIndexer()) +func (f *ciliumBGPAdvertisementInformer) Lister() ciliumiov2alpha1.CiliumBGPAdvertisementLister { + return ciliumiov2alpha1.NewCiliumBGPAdvertisementLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpclusterconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpclusterconfig.go index 9afb488fe9b2d..5de8c28386fc9 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpclusterconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpclusterconfig.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPClusterConfigs. type CiliumBGPClusterConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPClusterConfigLister + Lister() ciliumiov2alpha1.CiliumBGPClusterConfigLister } type ciliumBGPClusterConfigInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPClusterConfigInformer(client versioned.Interface, resyn return client.CiliumV2alpha1().CiliumBGPClusterConfigs().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPClusterConfig{}, + &apisciliumiov2alpha1.CiliumBGPClusterConfig{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPClusterConfigInformer) defaultInformer(client versioned.Interf } func (f *ciliumBGPClusterConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPClusterConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPClusterConfig{}, f.defaultInformer) } -func (f *ciliumBGPClusterConfigInformer) Lister() v2alpha1.CiliumBGPClusterConfigLister { - return v2alpha1.NewCiliumBGPClusterConfigLister(f.Informer().GetIndexer()) +func (f *ciliumBGPClusterConfigInformer) Lister() ciliumiov2alpha1.CiliumBGPClusterConfigLister { + return ciliumiov2alpha1.NewCiliumBGPClusterConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfig.go index 9fb6f9806ac47..807e6da8d5b8b 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfig.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPNodeConfigs. type CiliumBGPNodeConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPNodeConfigLister + Lister() ciliumiov2alpha1.CiliumBGPNodeConfigLister } type ciliumBGPNodeConfigInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPNodeConfigInformer(client versioned.Interface, resyncPe return client.CiliumV2alpha1().CiliumBGPNodeConfigs().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPNodeConfig{}, + &apisciliumiov2alpha1.CiliumBGPNodeConfig{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPNodeConfigInformer) defaultInformer(client versioned.Interface } func (f *ciliumBGPNodeConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPNodeConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPNodeConfig{}, f.defaultInformer) } -func (f *ciliumBGPNodeConfigInformer) Lister() v2alpha1.CiliumBGPNodeConfigLister { - return v2alpha1.NewCiliumBGPNodeConfigLister(f.Informer().GetIndexer()) +func (f *ciliumBGPNodeConfigInformer) Lister() ciliumiov2alpha1.CiliumBGPNodeConfigLister { + return ciliumiov2alpha1.NewCiliumBGPNodeConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go index 6f010f350ccff..e9ae86f54af5f 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPNodeConfigOverrides. type CiliumBGPNodeConfigOverrideInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPNodeConfigOverrideLister + Lister() ciliumiov2alpha1.CiliumBGPNodeConfigOverrideLister } type ciliumBGPNodeConfigOverrideInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPNodeConfigOverrideInformer(client versioned.Interface, return client.CiliumV2alpha1().CiliumBGPNodeConfigOverrides().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPNodeConfigOverride{}, + &apisciliumiov2alpha1.CiliumBGPNodeConfigOverride{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPNodeConfigOverrideInformer) defaultInformer(client versioned.I } func (f *ciliumBGPNodeConfigOverrideInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPNodeConfigOverride{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPNodeConfigOverride{}, f.defaultInformer) } -func (f *ciliumBGPNodeConfigOverrideInformer) Lister() v2alpha1.CiliumBGPNodeConfigOverrideLister { - return v2alpha1.NewCiliumBGPNodeConfigOverrideLister(f.Informer().GetIndexer()) +func (f *ciliumBGPNodeConfigOverrideInformer) Lister() ciliumiov2alpha1.CiliumBGPNodeConfigOverrideLister { + return ciliumiov2alpha1.NewCiliumBGPNodeConfigOverrideLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeerconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeerconfig.go index 958fc765cc86f..0a103c1f5c6ff 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeerconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeerconfig.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPPeerConfigs. type CiliumBGPPeerConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPPeerConfigLister + Lister() ciliumiov2alpha1.CiliumBGPPeerConfigLister } type ciliumBGPPeerConfigInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPPeerConfigInformer(client versioned.Interface, resyncPe return client.CiliumV2alpha1().CiliumBGPPeerConfigs().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPPeerConfig{}, + &apisciliumiov2alpha1.CiliumBGPPeerConfig{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPPeerConfigInformer) defaultInformer(client versioned.Interface } func (f *ciliumBGPPeerConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPPeerConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPPeerConfig{}, f.defaultInformer) } -func (f *ciliumBGPPeerConfigInformer) Lister() v2alpha1.CiliumBGPPeerConfigLister { - return v2alpha1.NewCiliumBGPPeerConfigLister(f.Informer().GetIndexer()) +func (f *ciliumBGPPeerConfigInformer) Lister() ciliumiov2alpha1.CiliumBGPPeerConfigLister { + return ciliumiov2alpha1.NewCiliumBGPPeerConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go index d046ac8d3ad9b..bdd7dca05814f 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumBGPPeeringPolicies. type CiliumBGPPeeringPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumBGPPeeringPolicyLister + Lister() ciliumiov2alpha1.CiliumBGPPeeringPolicyLister } type ciliumBGPPeeringPolicyInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumBGPPeeringPolicyInformer(client versioned.Interface, resyn return client.CiliumV2alpha1().CiliumBGPPeeringPolicies().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumBGPPeeringPolicy{}, + &apisciliumiov2alpha1.CiliumBGPPeeringPolicy{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumBGPPeeringPolicyInformer) defaultInformer(client versioned.Interf } func (f *ciliumBGPPeeringPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumBGPPeeringPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumBGPPeeringPolicy{}, f.defaultInformer) } -func (f *ciliumBGPPeeringPolicyInformer) Lister() v2alpha1.CiliumBGPPeeringPolicyLister { - return v2alpha1.NewCiliumBGPPeeringPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumBGPPeeringPolicyInformer) Lister() ciliumiov2alpha1.CiliumBGPPeeringPolicyLister { + return ciliumiov2alpha1.NewCiliumBGPPeeringPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumcidrgroup.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumcidrgroup.go index 94d6c59b5e669..9b7576a0d9d49 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumcidrgroup.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumcidrgroup.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumCIDRGroups. type CiliumCIDRGroupInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumCIDRGroupLister + Lister() ciliumiov2alpha1.CiliumCIDRGroupLister } type ciliumCIDRGroupInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumCIDRGroupInformer(client versioned.Interface, resyncPeriod return client.CiliumV2alpha1().CiliumCIDRGroups().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumCIDRGroup{}, + &apisciliumiov2alpha1.CiliumCIDRGroup{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumCIDRGroupInformer) defaultInformer(client versioned.Interface, re } func (f *ciliumCIDRGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumCIDRGroup{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumCIDRGroup{}, f.defaultInformer) } -func (f *ciliumCIDRGroupInformer) Lister() v2alpha1.CiliumCIDRGroupLister { - return v2alpha1.NewCiliumCIDRGroupLister(f.Informer().GetIndexer()) +func (f *ciliumCIDRGroupInformer) Lister() ciliumiov2alpha1.CiliumCIDRGroupLister { + return ciliumiov2alpha1.NewCiliumCIDRGroupLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumendpointslice.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumendpointslice.go index 0c2768da1001c..ab657d6d6eb7c 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumendpointslice.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumendpointslice.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumEndpointSlices. type CiliumEndpointSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumEndpointSliceLister + Lister() ciliumiov2alpha1.CiliumEndpointSliceLister } type ciliumEndpointSliceInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumEndpointSliceInformer(client versioned.Interface, resyncPe return client.CiliumV2alpha1().CiliumEndpointSlices().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumEndpointSlice{}, + &apisciliumiov2alpha1.CiliumEndpointSlice{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumEndpointSliceInformer) defaultInformer(client versioned.Interface } func (f *ciliumEndpointSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumEndpointSlice{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumEndpointSlice{}, f.defaultInformer) } -func (f *ciliumEndpointSliceInformer) Lister() v2alpha1.CiliumEndpointSliceLister { - return v2alpha1.NewCiliumEndpointSliceLister(f.Informer().GetIndexer()) +func (f *ciliumEndpointSliceInformer) Lister() ciliumiov2alpha1.CiliumEndpointSliceLister { + return ciliumiov2alpha1.NewCiliumEndpointSliceLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliuml2announcementpolicy.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliuml2announcementpolicy.go index 932096e554275..88ad3b1e82cdc 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliuml2announcementpolicy.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliuml2announcementpolicy.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumL2AnnouncementPolicies. type CiliumL2AnnouncementPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumL2AnnouncementPolicyLister + Lister() ciliumiov2alpha1.CiliumL2AnnouncementPolicyLister } type ciliumL2AnnouncementPolicyInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumL2AnnouncementPolicyInformer(client versioned.Interface, r return client.CiliumV2alpha1().CiliumL2AnnouncementPolicies().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumL2AnnouncementPolicy{}, + &apisciliumiov2alpha1.CiliumL2AnnouncementPolicy{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumL2AnnouncementPolicyInformer) defaultInformer(client versioned.In } func (f *ciliumL2AnnouncementPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumL2AnnouncementPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumL2AnnouncementPolicy{}, f.defaultInformer) } -func (f *ciliumL2AnnouncementPolicyInformer) Lister() v2alpha1.CiliumL2AnnouncementPolicyLister { - return v2alpha1.NewCiliumL2AnnouncementPolicyLister(f.Informer().GetIndexer()) +func (f *ciliumL2AnnouncementPolicyInformer) Lister() ciliumiov2alpha1.CiliumL2AnnouncementPolicyLister { + return ciliumiov2alpha1.NewCiliumL2AnnouncementPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumloadbalancerippool.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumloadbalancerippool.go index 122ef626c52e7..303a37bd35a80 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumloadbalancerippool.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumloadbalancerippool.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumLoadBalancerIPPools. type CiliumLoadBalancerIPPoolInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumLoadBalancerIPPoolLister + Lister() ciliumiov2alpha1.CiliumLoadBalancerIPPoolLister } type ciliumLoadBalancerIPPoolInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumLoadBalancerIPPoolInformer(client versioned.Interface, res return client.CiliumV2alpha1().CiliumLoadBalancerIPPools().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumLoadBalancerIPPool{}, + &apisciliumiov2alpha1.CiliumLoadBalancerIPPool{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumLoadBalancerIPPoolInformer) defaultInformer(client versioned.Inte } func (f *ciliumLoadBalancerIPPoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumLoadBalancerIPPool{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumLoadBalancerIPPool{}, f.defaultInformer) } -func (f *ciliumLoadBalancerIPPoolInformer) Lister() v2alpha1.CiliumLoadBalancerIPPoolLister { - return v2alpha1.NewCiliumLoadBalancerIPPoolLister(f.Informer().GetIndexer()) +func (f *ciliumLoadBalancerIPPoolInformer) Lister() ciliumiov2alpha1.CiliumLoadBalancerIPPoolLister { + return ciliumiov2alpha1.NewCiliumLoadBalancerIPPoolLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumnodeconfig.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumnodeconfig.go index 25a605ddc0b52..e1cde017d454c 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumnodeconfig.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumnodeconfig.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumNodeConfigs. type CiliumNodeConfigInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumNodeConfigLister + Lister() ciliumiov2alpha1.CiliumNodeConfigLister } type ciliumNodeConfigInformer struct { @@ -58,7 +58,7 @@ func NewFilteredCiliumNodeConfigInformer(client versioned.Interface, namespace s return client.CiliumV2alpha1().CiliumNodeConfigs(namespace).Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumNodeConfig{}, + &apisciliumiov2alpha1.CiliumNodeConfig{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *ciliumNodeConfigInformer) defaultInformer(client versioned.Interface, r } func (f *ciliumNodeConfigInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumNodeConfig{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumNodeConfig{}, f.defaultInformer) } -func (f *ciliumNodeConfigInformer) Lister() v2alpha1.CiliumNodeConfigLister { - return v2alpha1.NewCiliumNodeConfigLister(f.Informer().GetIndexer()) +func (f *ciliumNodeConfigInformer) Lister() ciliumiov2alpha1.CiliumNodeConfigLister { + return ciliumiov2alpha1.NewCiliumNodeConfigLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumpodippool.go b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumpodippool.go index 4995488207f73..751365f078834 100644 --- a/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumpodippool.go +++ b/pkg/k8s/client/informers/externalversions/cilium.io/v2alpha1/ciliumpodippool.go @@ -6,13 +6,13 @@ package v2alpha1 import ( - "context" + context "context" time "time" - ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + apisciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" versioned "github.com/cilium/cilium/pkg/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/client/informers/externalversions/internalinterfaces" - v2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/client/listers/cilium.io/v2alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CiliumPodIPPools. type CiliumPodIPPoolInformer interface { Informer() cache.SharedIndexInformer - Lister() v2alpha1.CiliumPodIPPoolLister + Lister() ciliumiov2alpha1.CiliumPodIPPoolLister } type ciliumPodIPPoolInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCiliumPodIPPoolInformer(client versioned.Interface, resyncPeriod return client.CiliumV2alpha1().CiliumPodIPPools().Watch(context.TODO(), options) }, }, - &ciliumiov2alpha1.CiliumPodIPPool{}, + &apisciliumiov2alpha1.CiliumPodIPPool{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *ciliumPodIPPoolInformer) defaultInformer(client versioned.Interface, re } func (f *ciliumPodIPPoolInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&ciliumiov2alpha1.CiliumPodIPPool{}, f.defaultInformer) + return f.factory.InformerFor(&apisciliumiov2alpha1.CiliumPodIPPool{}, f.defaultInformer) } -func (f *ciliumPodIPPoolInformer) Lister() v2alpha1.CiliumPodIPPoolLister { - return v2alpha1.NewCiliumPodIPPoolLister(f.Informer().GetIndexer()) +func (f *ciliumPodIPPoolInformer) Lister() ciliumiov2alpha1.CiliumPodIPPoolLister { + return ciliumiov2alpha1.NewCiliumPodIPPoolLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/client/informers/externalversions/generic.go b/pkg/k8s/client/informers/externalversions/generic.go index 613086be0597f..71493201ee0e0 100644 --- a/pkg/k8s/client/informers/externalversions/generic.go +++ b/pkg/k8s/client/informers/externalversions/generic.go @@ -6,7 +6,7 @@ package externalversions import ( - "fmt" + fmt "fmt" v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwideenvoyconfig.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwideenvoyconfig.go index df6a79f0e8ca8..ff0ddedf98ebd 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwideenvoyconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwideenvoyconfig.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumClusterwideEnvoyConfigLister helps list CiliumClusterwideEnvoyConfigs. @@ -17,19 +17,19 @@ import ( type CiliumClusterwideEnvoyConfigLister interface { // List lists all CiliumClusterwideEnvoyConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumClusterwideEnvoyConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumClusterwideEnvoyConfig, err error) // Get retrieves the CiliumClusterwideEnvoyConfig from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumClusterwideEnvoyConfig, error) + Get(name string) (*ciliumiov2.CiliumClusterwideEnvoyConfig, error) CiliumClusterwideEnvoyConfigListerExpansion } // ciliumClusterwideEnvoyConfigLister implements the CiliumClusterwideEnvoyConfigLister interface. type ciliumClusterwideEnvoyConfigLister struct { - listers.ResourceIndexer[*v2.CiliumClusterwideEnvoyConfig] + listers.ResourceIndexer[*ciliumiov2.CiliumClusterwideEnvoyConfig] } // NewCiliumClusterwideEnvoyConfigLister returns a new CiliumClusterwideEnvoyConfigLister. func NewCiliumClusterwideEnvoyConfigLister(indexer cache.Indexer) CiliumClusterwideEnvoyConfigLister { - return &ciliumClusterwideEnvoyConfigLister{listers.New[*v2.CiliumClusterwideEnvoyConfig](indexer, v2.Resource("ciliumclusterwideenvoyconfig"))} + return &ciliumClusterwideEnvoyConfigLister{listers.New[*ciliumiov2.CiliumClusterwideEnvoyConfig](indexer, ciliumiov2.Resource("ciliumclusterwideenvoyconfig"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwidenetworkpolicy.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwidenetworkpolicy.go index 7f870b0c9eab8..3a39a6e76eaa9 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwidenetworkpolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumclusterwidenetworkpolicy.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumClusterwideNetworkPolicyLister helps list CiliumClusterwideNetworkPolicies. @@ -17,19 +17,19 @@ import ( type CiliumClusterwideNetworkPolicyLister interface { // List lists all CiliumClusterwideNetworkPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumClusterwideNetworkPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumClusterwideNetworkPolicy, err error) // Get retrieves the CiliumClusterwideNetworkPolicy from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumClusterwideNetworkPolicy, error) + Get(name string) (*ciliumiov2.CiliumClusterwideNetworkPolicy, error) CiliumClusterwideNetworkPolicyListerExpansion } // ciliumClusterwideNetworkPolicyLister implements the CiliumClusterwideNetworkPolicyLister interface. type ciliumClusterwideNetworkPolicyLister struct { - listers.ResourceIndexer[*v2.CiliumClusterwideNetworkPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumClusterwideNetworkPolicy] } // NewCiliumClusterwideNetworkPolicyLister returns a new CiliumClusterwideNetworkPolicyLister. func NewCiliumClusterwideNetworkPolicyLister(indexer cache.Indexer) CiliumClusterwideNetworkPolicyLister { - return &ciliumClusterwideNetworkPolicyLister{listers.New[*v2.CiliumClusterwideNetworkPolicy](indexer, v2.Resource("ciliumclusterwidenetworkpolicy"))} + return &ciliumClusterwideNetworkPolicyLister{listers.New[*ciliumiov2.CiliumClusterwideNetworkPolicy](indexer, ciliumiov2.Resource("ciliumclusterwidenetworkpolicy"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumegressgatewaypolicy.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumegressgatewaypolicy.go index 01169e1c04fc5..3733bb9eb4f94 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumegressgatewaypolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumegressgatewaypolicy.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumEgressGatewayPolicyLister helps list CiliumEgressGatewayPolicies. @@ -17,19 +17,19 @@ import ( type CiliumEgressGatewayPolicyLister interface { // List lists all CiliumEgressGatewayPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumEgressGatewayPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumEgressGatewayPolicy, err error) // Get retrieves the CiliumEgressGatewayPolicy from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumEgressGatewayPolicy, error) + Get(name string) (*ciliumiov2.CiliumEgressGatewayPolicy, error) CiliumEgressGatewayPolicyListerExpansion } // ciliumEgressGatewayPolicyLister implements the CiliumEgressGatewayPolicyLister interface. type ciliumEgressGatewayPolicyLister struct { - listers.ResourceIndexer[*v2.CiliumEgressGatewayPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumEgressGatewayPolicy] } // NewCiliumEgressGatewayPolicyLister returns a new CiliumEgressGatewayPolicyLister. func NewCiliumEgressGatewayPolicyLister(indexer cache.Indexer) CiliumEgressGatewayPolicyLister { - return &ciliumEgressGatewayPolicyLister{listers.New[*v2.CiliumEgressGatewayPolicy](indexer, v2.Resource("ciliumegressgatewaypolicy"))} + return &ciliumEgressGatewayPolicyLister{listers.New[*ciliumiov2.CiliumEgressGatewayPolicy](indexer, ciliumiov2.Resource("ciliumegressgatewaypolicy"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumendpoint.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumendpoint.go index 26116f7930999..6d3c3b26bf53d 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumendpoint.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumendpoint.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumEndpointLister helps list CiliumEndpoints. @@ -17,7 +17,7 @@ import ( type CiliumEndpointLister interface { // List lists all CiliumEndpoints in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumEndpoint, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumEndpoint, err error) // CiliumEndpoints returns an object that can list and get CiliumEndpoints. CiliumEndpoints(namespace string) CiliumEndpointNamespaceLister CiliumEndpointListerExpansion @@ -25,17 +25,17 @@ type CiliumEndpointLister interface { // ciliumEndpointLister implements the CiliumEndpointLister interface. type ciliumEndpointLister struct { - listers.ResourceIndexer[*v2.CiliumEndpoint] + listers.ResourceIndexer[*ciliumiov2.CiliumEndpoint] } // NewCiliumEndpointLister returns a new CiliumEndpointLister. func NewCiliumEndpointLister(indexer cache.Indexer) CiliumEndpointLister { - return &ciliumEndpointLister{listers.New[*v2.CiliumEndpoint](indexer, v2.Resource("ciliumendpoint"))} + return &ciliumEndpointLister{listers.New[*ciliumiov2.CiliumEndpoint](indexer, ciliumiov2.Resource("ciliumendpoint"))} } // CiliumEndpoints returns an object that can list and get CiliumEndpoints. func (s *ciliumEndpointLister) CiliumEndpoints(namespace string) CiliumEndpointNamespaceLister { - return ciliumEndpointNamespaceLister{listers.NewNamespaced[*v2.CiliumEndpoint](s.ResourceIndexer, namespace)} + return ciliumEndpointNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumEndpoint](s.ResourceIndexer, namespace)} } // CiliumEndpointNamespaceLister helps list and get CiliumEndpoints. @@ -43,15 +43,15 @@ func (s *ciliumEndpointLister) CiliumEndpoints(namespace string) CiliumEndpointN type CiliumEndpointNamespaceLister interface { // List lists all CiliumEndpoints in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumEndpoint, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumEndpoint, err error) // Get retrieves the CiliumEndpoint from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumEndpoint, error) + Get(name string) (*ciliumiov2.CiliumEndpoint, error) CiliumEndpointNamespaceListerExpansion } // ciliumEndpointNamespaceLister implements the CiliumEndpointNamespaceLister // interface. type ciliumEndpointNamespaceLister struct { - listers.ResourceIndexer[*v2.CiliumEndpoint] + listers.ResourceIndexer[*ciliumiov2.CiliumEndpoint] } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumenvoyconfig.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumenvoyconfig.go index 13357782362f5..bd29a2f6ff5bc 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumenvoyconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumenvoyconfig.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumEnvoyConfigLister helps list CiliumEnvoyConfigs. @@ -17,7 +17,7 @@ import ( type CiliumEnvoyConfigLister interface { // List lists all CiliumEnvoyConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumEnvoyConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumEnvoyConfig, err error) // CiliumEnvoyConfigs returns an object that can list and get CiliumEnvoyConfigs. CiliumEnvoyConfigs(namespace string) CiliumEnvoyConfigNamespaceLister CiliumEnvoyConfigListerExpansion @@ -25,17 +25,17 @@ type CiliumEnvoyConfigLister interface { // ciliumEnvoyConfigLister implements the CiliumEnvoyConfigLister interface. type ciliumEnvoyConfigLister struct { - listers.ResourceIndexer[*v2.CiliumEnvoyConfig] + listers.ResourceIndexer[*ciliumiov2.CiliumEnvoyConfig] } // NewCiliumEnvoyConfigLister returns a new CiliumEnvoyConfigLister. func NewCiliumEnvoyConfigLister(indexer cache.Indexer) CiliumEnvoyConfigLister { - return &ciliumEnvoyConfigLister{listers.New[*v2.CiliumEnvoyConfig](indexer, v2.Resource("ciliumenvoyconfig"))} + return &ciliumEnvoyConfigLister{listers.New[*ciliumiov2.CiliumEnvoyConfig](indexer, ciliumiov2.Resource("ciliumenvoyconfig"))} } // CiliumEnvoyConfigs returns an object that can list and get CiliumEnvoyConfigs. func (s *ciliumEnvoyConfigLister) CiliumEnvoyConfigs(namespace string) CiliumEnvoyConfigNamespaceLister { - return ciliumEnvoyConfigNamespaceLister{listers.NewNamespaced[*v2.CiliumEnvoyConfig](s.ResourceIndexer, namespace)} + return ciliumEnvoyConfigNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumEnvoyConfig](s.ResourceIndexer, namespace)} } // CiliumEnvoyConfigNamespaceLister helps list and get CiliumEnvoyConfigs. @@ -43,15 +43,15 @@ func (s *ciliumEnvoyConfigLister) CiliumEnvoyConfigs(namespace string) CiliumEnv type CiliumEnvoyConfigNamespaceLister interface { // List lists all CiliumEnvoyConfigs in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumEnvoyConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumEnvoyConfig, err error) // Get retrieves the CiliumEnvoyConfig from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumEnvoyConfig, error) + Get(name string) (*ciliumiov2.CiliumEnvoyConfig, error) CiliumEnvoyConfigNamespaceListerExpansion } // ciliumEnvoyConfigNamespaceLister implements the CiliumEnvoyConfigNamespaceLister // interface. type ciliumEnvoyConfigNamespaceLister struct { - listers.ResourceIndexer[*v2.CiliumEnvoyConfig] + listers.ResourceIndexer[*ciliumiov2.CiliumEnvoyConfig] } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumexternalworkload.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumexternalworkload.go index c40043d6ce4b8..723958964a114 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumexternalworkload.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumexternalworkload.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumExternalWorkloadLister helps list CiliumExternalWorkloads. @@ -17,19 +17,19 @@ import ( type CiliumExternalWorkloadLister interface { // List lists all CiliumExternalWorkloads in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumExternalWorkload, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumExternalWorkload, err error) // Get retrieves the CiliumExternalWorkload from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumExternalWorkload, error) + Get(name string) (*ciliumiov2.CiliumExternalWorkload, error) CiliumExternalWorkloadListerExpansion } // ciliumExternalWorkloadLister implements the CiliumExternalWorkloadLister interface. type ciliumExternalWorkloadLister struct { - listers.ResourceIndexer[*v2.CiliumExternalWorkload] + listers.ResourceIndexer[*ciliumiov2.CiliumExternalWorkload] } // NewCiliumExternalWorkloadLister returns a new CiliumExternalWorkloadLister. func NewCiliumExternalWorkloadLister(indexer cache.Indexer) CiliumExternalWorkloadLister { - return &ciliumExternalWorkloadLister{listers.New[*v2.CiliumExternalWorkload](indexer, v2.Resource("ciliumexternalworkload"))} + return &ciliumExternalWorkloadLister{listers.New[*ciliumiov2.CiliumExternalWorkload](indexer, ciliumiov2.Resource("ciliumexternalworkload"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumidentity.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumidentity.go index 34ed811aa46f9..01e53a2c3bf2b 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumidentity.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumidentity.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumIdentityLister helps list CiliumIdentities. @@ -17,19 +17,19 @@ import ( type CiliumIdentityLister interface { // List lists all CiliumIdentities in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumIdentity, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumIdentity, err error) // Get retrieves the CiliumIdentity from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumIdentity, error) + Get(name string) (*ciliumiov2.CiliumIdentity, error) CiliumIdentityListerExpansion } // ciliumIdentityLister implements the CiliumIdentityLister interface. type ciliumIdentityLister struct { - listers.ResourceIndexer[*v2.CiliumIdentity] + listers.ResourceIndexer[*ciliumiov2.CiliumIdentity] } // NewCiliumIdentityLister returns a new CiliumIdentityLister. func NewCiliumIdentityLister(indexer cache.Indexer) CiliumIdentityLister { - return &ciliumIdentityLister{listers.New[*v2.CiliumIdentity](indexer, v2.Resource("ciliumidentity"))} + return &ciliumIdentityLister{listers.New[*ciliumiov2.CiliumIdentity](indexer, ciliumiov2.Resource("ciliumidentity"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumlocalredirectpolicy.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumlocalredirectpolicy.go index eead34a7b92f5..db68fc3ef041f 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumlocalredirectpolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumlocalredirectpolicy.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumLocalRedirectPolicyLister helps list CiliumLocalRedirectPolicies. @@ -17,7 +17,7 @@ import ( type CiliumLocalRedirectPolicyLister interface { // List lists all CiliumLocalRedirectPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumLocalRedirectPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumLocalRedirectPolicy, err error) // CiliumLocalRedirectPolicies returns an object that can list and get CiliumLocalRedirectPolicies. CiliumLocalRedirectPolicies(namespace string) CiliumLocalRedirectPolicyNamespaceLister CiliumLocalRedirectPolicyListerExpansion @@ -25,17 +25,17 @@ type CiliumLocalRedirectPolicyLister interface { // ciliumLocalRedirectPolicyLister implements the CiliumLocalRedirectPolicyLister interface. type ciliumLocalRedirectPolicyLister struct { - listers.ResourceIndexer[*v2.CiliumLocalRedirectPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumLocalRedirectPolicy] } // NewCiliumLocalRedirectPolicyLister returns a new CiliumLocalRedirectPolicyLister. func NewCiliumLocalRedirectPolicyLister(indexer cache.Indexer) CiliumLocalRedirectPolicyLister { - return &ciliumLocalRedirectPolicyLister{listers.New[*v2.CiliumLocalRedirectPolicy](indexer, v2.Resource("ciliumlocalredirectpolicy"))} + return &ciliumLocalRedirectPolicyLister{listers.New[*ciliumiov2.CiliumLocalRedirectPolicy](indexer, ciliumiov2.Resource("ciliumlocalredirectpolicy"))} } // CiliumLocalRedirectPolicies returns an object that can list and get CiliumLocalRedirectPolicies. func (s *ciliumLocalRedirectPolicyLister) CiliumLocalRedirectPolicies(namespace string) CiliumLocalRedirectPolicyNamespaceLister { - return ciliumLocalRedirectPolicyNamespaceLister{listers.NewNamespaced[*v2.CiliumLocalRedirectPolicy](s.ResourceIndexer, namespace)} + return ciliumLocalRedirectPolicyNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumLocalRedirectPolicy](s.ResourceIndexer, namespace)} } // CiliumLocalRedirectPolicyNamespaceLister helps list and get CiliumLocalRedirectPolicies. @@ -43,15 +43,15 @@ func (s *ciliumLocalRedirectPolicyLister) CiliumLocalRedirectPolicies(namespace type CiliumLocalRedirectPolicyNamespaceLister interface { // List lists all CiliumLocalRedirectPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumLocalRedirectPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumLocalRedirectPolicy, err error) // Get retrieves the CiliumLocalRedirectPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumLocalRedirectPolicy, error) + Get(name string) (*ciliumiov2.CiliumLocalRedirectPolicy, error) CiliumLocalRedirectPolicyNamespaceListerExpansion } // ciliumLocalRedirectPolicyNamespaceLister implements the CiliumLocalRedirectPolicyNamespaceLister // interface. type ciliumLocalRedirectPolicyNamespaceLister struct { - listers.ResourceIndexer[*v2.CiliumLocalRedirectPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumLocalRedirectPolicy] } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumnetworkpolicy.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumnetworkpolicy.go index e46c6a22f98e6..5747872b415ac 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumnetworkpolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumnetworkpolicy.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumNetworkPolicyLister helps list CiliumNetworkPolicies. @@ -17,7 +17,7 @@ import ( type CiliumNetworkPolicyLister interface { // List lists all CiliumNetworkPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumNetworkPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumNetworkPolicy, err error) // CiliumNetworkPolicies returns an object that can list and get CiliumNetworkPolicies. CiliumNetworkPolicies(namespace string) CiliumNetworkPolicyNamespaceLister CiliumNetworkPolicyListerExpansion @@ -25,17 +25,17 @@ type CiliumNetworkPolicyLister interface { // ciliumNetworkPolicyLister implements the CiliumNetworkPolicyLister interface. type ciliumNetworkPolicyLister struct { - listers.ResourceIndexer[*v2.CiliumNetworkPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumNetworkPolicy] } // NewCiliumNetworkPolicyLister returns a new CiliumNetworkPolicyLister. func NewCiliumNetworkPolicyLister(indexer cache.Indexer) CiliumNetworkPolicyLister { - return &ciliumNetworkPolicyLister{listers.New[*v2.CiliumNetworkPolicy](indexer, v2.Resource("ciliumnetworkpolicy"))} + return &ciliumNetworkPolicyLister{listers.New[*ciliumiov2.CiliumNetworkPolicy](indexer, ciliumiov2.Resource("ciliumnetworkpolicy"))} } // CiliumNetworkPolicies returns an object that can list and get CiliumNetworkPolicies. func (s *ciliumNetworkPolicyLister) CiliumNetworkPolicies(namespace string) CiliumNetworkPolicyNamespaceLister { - return ciliumNetworkPolicyNamespaceLister{listers.NewNamespaced[*v2.CiliumNetworkPolicy](s.ResourceIndexer, namespace)} + return ciliumNetworkPolicyNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumNetworkPolicy](s.ResourceIndexer, namespace)} } // CiliumNetworkPolicyNamespaceLister helps list and get CiliumNetworkPolicies. @@ -43,15 +43,15 @@ func (s *ciliumNetworkPolicyLister) CiliumNetworkPolicies(namespace string) Cili type CiliumNetworkPolicyNamespaceLister interface { // List lists all CiliumNetworkPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumNetworkPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumNetworkPolicy, err error) // Get retrieves the CiliumNetworkPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumNetworkPolicy, error) + Get(name string) (*ciliumiov2.CiliumNetworkPolicy, error) CiliumNetworkPolicyNamespaceListerExpansion } // ciliumNetworkPolicyNamespaceLister implements the CiliumNetworkPolicyNamespaceLister // interface. type ciliumNetworkPolicyNamespaceLister struct { - listers.ResourceIndexer[*v2.CiliumNetworkPolicy] + listers.ResourceIndexer[*ciliumiov2.CiliumNetworkPolicy] } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumnode.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumnode.go index 8ddb721da6a48..32e01fab8b6fb 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumnode.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumnode.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumNodeLister helps list CiliumNodes. @@ -17,19 +17,19 @@ import ( type CiliumNodeLister interface { // List lists all CiliumNodes in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumNode, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumNode, err error) // Get retrieves the CiliumNode from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumNode, error) + Get(name string) (*ciliumiov2.CiliumNode, error) CiliumNodeListerExpansion } // ciliumNodeLister implements the CiliumNodeLister interface. type ciliumNodeLister struct { - listers.ResourceIndexer[*v2.CiliumNode] + listers.ResourceIndexer[*ciliumiov2.CiliumNode] } // NewCiliumNodeLister returns a new CiliumNodeLister. func NewCiliumNodeLister(indexer cache.Indexer) CiliumNodeLister { - return &ciliumNodeLister{listers.New[*v2.CiliumNode](indexer, v2.Resource("ciliumnode"))} + return &ciliumNodeLister{listers.New[*ciliumiov2.CiliumNode](indexer, ciliumiov2.Resource("ciliumnode"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2/ciliumnodeconfig.go b/pkg/k8s/client/listers/cilium.io/v2/ciliumnodeconfig.go index 50e2950cefbce..45ac73847d797 100644 --- a/pkg/k8s/client/listers/cilium.io/v2/ciliumnodeconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2/ciliumnodeconfig.go @@ -6,10 +6,10 @@ package v2 import ( - v2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumNodeConfigLister helps list CiliumNodeConfigs. @@ -17,7 +17,7 @@ import ( type CiliumNodeConfigLister interface { // List lists all CiliumNodeConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumNodeConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumNodeConfig, err error) // CiliumNodeConfigs returns an object that can list and get CiliumNodeConfigs. CiliumNodeConfigs(namespace string) CiliumNodeConfigNamespaceLister CiliumNodeConfigListerExpansion @@ -25,17 +25,17 @@ type CiliumNodeConfigLister interface { // ciliumNodeConfigLister implements the CiliumNodeConfigLister interface. type ciliumNodeConfigLister struct { - listers.ResourceIndexer[*v2.CiliumNodeConfig] + listers.ResourceIndexer[*ciliumiov2.CiliumNodeConfig] } // NewCiliumNodeConfigLister returns a new CiliumNodeConfigLister. func NewCiliumNodeConfigLister(indexer cache.Indexer) CiliumNodeConfigLister { - return &ciliumNodeConfigLister{listers.New[*v2.CiliumNodeConfig](indexer, v2.Resource("ciliumnodeconfig"))} + return &ciliumNodeConfigLister{listers.New[*ciliumiov2.CiliumNodeConfig](indexer, ciliumiov2.Resource("ciliumnodeconfig"))} } // CiliumNodeConfigs returns an object that can list and get CiliumNodeConfigs. func (s *ciliumNodeConfigLister) CiliumNodeConfigs(namespace string) CiliumNodeConfigNamespaceLister { - return ciliumNodeConfigNamespaceLister{listers.NewNamespaced[*v2.CiliumNodeConfig](s.ResourceIndexer, namespace)} + return ciliumNodeConfigNamespaceLister{listers.NewNamespaced[*ciliumiov2.CiliumNodeConfig](s.ResourceIndexer, namespace)} } // CiliumNodeConfigNamespaceLister helps list and get CiliumNodeConfigs. @@ -43,15 +43,15 @@ func (s *ciliumNodeConfigLister) CiliumNodeConfigs(namespace string) CiliumNodeC type CiliumNodeConfigNamespaceLister interface { // List lists all CiliumNodeConfigs in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2.CiliumNodeConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2.CiliumNodeConfig, err error) // Get retrieves the CiliumNodeConfig from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2.CiliumNodeConfig, error) + Get(name string) (*ciliumiov2.CiliumNodeConfig, error) CiliumNodeConfigNamespaceListerExpansion } // ciliumNodeConfigNamespaceLister implements the CiliumNodeConfigNamespaceLister // interface. type ciliumNodeConfigNamespaceLister struct { - listers.ResourceIndexer[*v2.CiliumNodeConfig] + listers.ResourceIndexer[*ciliumiov2.CiliumNodeConfig] } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpadvertisement.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpadvertisement.go index 0d8edb32b0003..eb92c303efc63 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpadvertisement.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpadvertisement.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPAdvertisementLister helps list CiliumBGPAdvertisements. @@ -17,19 +17,19 @@ import ( type CiliumBGPAdvertisementLister interface { // List lists all CiliumBGPAdvertisements in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPAdvertisement, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPAdvertisement, err error) // Get retrieves the CiliumBGPAdvertisement from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPAdvertisement, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPAdvertisement, error) CiliumBGPAdvertisementListerExpansion } // ciliumBGPAdvertisementLister implements the CiliumBGPAdvertisementLister interface. type ciliumBGPAdvertisementLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPAdvertisement] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPAdvertisement] } // NewCiliumBGPAdvertisementLister returns a new CiliumBGPAdvertisementLister. func NewCiliumBGPAdvertisementLister(indexer cache.Indexer) CiliumBGPAdvertisementLister { - return &ciliumBGPAdvertisementLister{listers.New[*v2alpha1.CiliumBGPAdvertisement](indexer, v2alpha1.Resource("ciliumbgpadvertisement"))} + return &ciliumBGPAdvertisementLister{listers.New[*ciliumiov2alpha1.CiliumBGPAdvertisement](indexer, ciliumiov2alpha1.Resource("ciliumbgpadvertisement"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpclusterconfig.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpclusterconfig.go index a70016c2eb326..a743d33c9d3f3 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpclusterconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpclusterconfig.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPClusterConfigLister helps list CiliumBGPClusterConfigs. @@ -17,19 +17,19 @@ import ( type CiliumBGPClusterConfigLister interface { // List lists all CiliumBGPClusterConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPClusterConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPClusterConfig, err error) // Get retrieves the CiliumBGPClusterConfig from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPClusterConfig, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPClusterConfig, error) CiliumBGPClusterConfigListerExpansion } // ciliumBGPClusterConfigLister implements the CiliumBGPClusterConfigLister interface. type ciliumBGPClusterConfigLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPClusterConfig] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPClusterConfig] } // NewCiliumBGPClusterConfigLister returns a new CiliumBGPClusterConfigLister. func NewCiliumBGPClusterConfigLister(indexer cache.Indexer) CiliumBGPClusterConfigLister { - return &ciliumBGPClusterConfigLister{listers.New[*v2alpha1.CiliumBGPClusterConfig](indexer, v2alpha1.Resource("ciliumbgpclusterconfig"))} + return &ciliumBGPClusterConfigLister{listers.New[*ciliumiov2alpha1.CiliumBGPClusterConfig](indexer, ciliumiov2alpha1.Resource("ciliumbgpclusterconfig"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfig.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfig.go index 47ca8ab5a5c63..796827fb22489 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfig.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPNodeConfigLister helps list CiliumBGPNodeConfigs. @@ -17,19 +17,19 @@ import ( type CiliumBGPNodeConfigLister interface { // List lists all CiliumBGPNodeConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPNodeConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPNodeConfig, err error) // Get retrieves the CiliumBGPNodeConfig from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPNodeConfig, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPNodeConfig, error) CiliumBGPNodeConfigListerExpansion } // ciliumBGPNodeConfigLister implements the CiliumBGPNodeConfigLister interface. type ciliumBGPNodeConfigLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPNodeConfig] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPNodeConfig] } // NewCiliumBGPNodeConfigLister returns a new CiliumBGPNodeConfigLister. func NewCiliumBGPNodeConfigLister(indexer cache.Indexer) CiliumBGPNodeConfigLister { - return &ciliumBGPNodeConfigLister{listers.New[*v2alpha1.CiliumBGPNodeConfig](indexer, v2alpha1.Resource("ciliumbgpnodeconfig"))} + return &ciliumBGPNodeConfigLister{listers.New[*ciliumiov2alpha1.CiliumBGPNodeConfig](indexer, ciliumiov2alpha1.Resource("ciliumbgpnodeconfig"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go index 69c6b5c0610b6..ef3b2c0e10dd3 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgpnodeconfigoverride.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPNodeConfigOverrideLister helps list CiliumBGPNodeConfigOverrides. @@ -17,19 +17,19 @@ import ( type CiliumBGPNodeConfigOverrideLister interface { // List lists all CiliumBGPNodeConfigOverrides in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPNodeConfigOverride, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, err error) // Get retrieves the CiliumBGPNodeConfigOverride from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPNodeConfigOverride, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPNodeConfigOverride, error) CiliumBGPNodeConfigOverrideListerExpansion } // ciliumBGPNodeConfigOverrideLister implements the CiliumBGPNodeConfigOverrideLister interface. type ciliumBGPNodeConfigOverrideLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPNodeConfigOverride] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPNodeConfigOverride] } // NewCiliumBGPNodeConfigOverrideLister returns a new CiliumBGPNodeConfigOverrideLister. func NewCiliumBGPNodeConfigOverrideLister(indexer cache.Indexer) CiliumBGPNodeConfigOverrideLister { - return &ciliumBGPNodeConfigOverrideLister{listers.New[*v2alpha1.CiliumBGPNodeConfigOverride](indexer, v2alpha1.Resource("ciliumbgpnodeconfigoverride"))} + return &ciliumBGPNodeConfigOverrideLister{listers.New[*ciliumiov2alpha1.CiliumBGPNodeConfigOverride](indexer, ciliumiov2alpha1.Resource("ciliumbgpnodeconfigoverride"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeerconfig.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeerconfig.go index 8051639436ff7..5dd5dc8e90be5 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeerconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeerconfig.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPPeerConfigLister helps list CiliumBGPPeerConfigs. @@ -17,19 +17,19 @@ import ( type CiliumBGPPeerConfigLister interface { // List lists all CiliumBGPPeerConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPPeerConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPPeerConfig, err error) // Get retrieves the CiliumBGPPeerConfig from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPPeerConfig, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPPeerConfig, error) CiliumBGPPeerConfigListerExpansion } // ciliumBGPPeerConfigLister implements the CiliumBGPPeerConfigLister interface. type ciliumBGPPeerConfigLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPPeerConfig] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPPeerConfig] } // NewCiliumBGPPeerConfigLister returns a new CiliumBGPPeerConfigLister. func NewCiliumBGPPeerConfigLister(indexer cache.Indexer) CiliumBGPPeerConfigLister { - return &ciliumBGPPeerConfigLister{listers.New[*v2alpha1.CiliumBGPPeerConfig](indexer, v2alpha1.Resource("ciliumbgppeerconfig"))} + return &ciliumBGPPeerConfigLister{listers.New[*ciliumiov2alpha1.CiliumBGPPeerConfig](indexer, ciliumiov2alpha1.Resource("ciliumbgppeerconfig"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go index 92d58aff1de24..99b45d2fcb2ee 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumbgppeeringpolicy.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumBGPPeeringPolicyLister helps list CiliumBGPPeeringPolicies. @@ -17,19 +17,19 @@ import ( type CiliumBGPPeeringPolicyLister interface { // List lists all CiliumBGPPeeringPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumBGPPeeringPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumBGPPeeringPolicy, err error) // Get retrieves the CiliumBGPPeeringPolicy from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumBGPPeeringPolicy, error) + Get(name string) (*ciliumiov2alpha1.CiliumBGPPeeringPolicy, error) CiliumBGPPeeringPolicyListerExpansion } // ciliumBGPPeeringPolicyLister implements the CiliumBGPPeeringPolicyLister interface. type ciliumBGPPeeringPolicyLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumBGPPeeringPolicy] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumBGPPeeringPolicy] } // NewCiliumBGPPeeringPolicyLister returns a new CiliumBGPPeeringPolicyLister. func NewCiliumBGPPeeringPolicyLister(indexer cache.Indexer) CiliumBGPPeeringPolicyLister { - return &ciliumBGPPeeringPolicyLister{listers.New[*v2alpha1.CiliumBGPPeeringPolicy](indexer, v2alpha1.Resource("ciliumbgppeeringpolicy"))} + return &ciliumBGPPeeringPolicyLister{listers.New[*ciliumiov2alpha1.CiliumBGPPeeringPolicy](indexer, ciliumiov2alpha1.Resource("ciliumbgppeeringpolicy"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumcidrgroup.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumcidrgroup.go index a91e4483c1835..7137723ae6321 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumcidrgroup.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumcidrgroup.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumCIDRGroupLister helps list CiliumCIDRGroups. @@ -17,19 +17,19 @@ import ( type CiliumCIDRGroupLister interface { // List lists all CiliumCIDRGroups in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumCIDRGroup, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumCIDRGroup, err error) // Get retrieves the CiliumCIDRGroup from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumCIDRGroup, error) + Get(name string) (*ciliumiov2alpha1.CiliumCIDRGroup, error) CiliumCIDRGroupListerExpansion } // ciliumCIDRGroupLister implements the CiliumCIDRGroupLister interface. type ciliumCIDRGroupLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumCIDRGroup] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumCIDRGroup] } // NewCiliumCIDRGroupLister returns a new CiliumCIDRGroupLister. func NewCiliumCIDRGroupLister(indexer cache.Indexer) CiliumCIDRGroupLister { - return &ciliumCIDRGroupLister{listers.New[*v2alpha1.CiliumCIDRGroup](indexer, v2alpha1.Resource("ciliumcidrgroup"))} + return &ciliumCIDRGroupLister{listers.New[*ciliumiov2alpha1.CiliumCIDRGroup](indexer, ciliumiov2alpha1.Resource("ciliumcidrgroup"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumendpointslice.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumendpointslice.go index 359dac4bfbd16..b8051604166b1 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumendpointslice.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumendpointslice.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumEndpointSliceLister helps list CiliumEndpointSlices. @@ -17,19 +17,19 @@ import ( type CiliumEndpointSliceLister interface { // List lists all CiliumEndpointSlices in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumEndpointSlice, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumEndpointSlice, err error) // Get retrieves the CiliumEndpointSlice from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumEndpointSlice, error) + Get(name string) (*ciliumiov2alpha1.CiliumEndpointSlice, error) CiliumEndpointSliceListerExpansion } // ciliumEndpointSliceLister implements the CiliumEndpointSliceLister interface. type ciliumEndpointSliceLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumEndpointSlice] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumEndpointSlice] } // NewCiliumEndpointSliceLister returns a new CiliumEndpointSliceLister. func NewCiliumEndpointSliceLister(indexer cache.Indexer) CiliumEndpointSliceLister { - return &ciliumEndpointSliceLister{listers.New[*v2alpha1.CiliumEndpointSlice](indexer, v2alpha1.Resource("ciliumendpointslice"))} + return &ciliumEndpointSliceLister{listers.New[*ciliumiov2alpha1.CiliumEndpointSlice](indexer, ciliumiov2alpha1.Resource("ciliumendpointslice"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliuml2announcementpolicy.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliuml2announcementpolicy.go index 7e447e127a24c..c66731144f26c 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliuml2announcementpolicy.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliuml2announcementpolicy.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumL2AnnouncementPolicyLister helps list CiliumL2AnnouncementPolicies. @@ -17,19 +17,19 @@ import ( type CiliumL2AnnouncementPolicyLister interface { // List lists all CiliumL2AnnouncementPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumL2AnnouncementPolicy, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, err error) // Get retrieves the CiliumL2AnnouncementPolicy from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumL2AnnouncementPolicy, error) + Get(name string) (*ciliumiov2alpha1.CiliumL2AnnouncementPolicy, error) CiliumL2AnnouncementPolicyListerExpansion } // ciliumL2AnnouncementPolicyLister implements the CiliumL2AnnouncementPolicyLister interface. type ciliumL2AnnouncementPolicyLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumL2AnnouncementPolicy] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumL2AnnouncementPolicy] } // NewCiliumL2AnnouncementPolicyLister returns a new CiliumL2AnnouncementPolicyLister. func NewCiliumL2AnnouncementPolicyLister(indexer cache.Indexer) CiliumL2AnnouncementPolicyLister { - return &ciliumL2AnnouncementPolicyLister{listers.New[*v2alpha1.CiliumL2AnnouncementPolicy](indexer, v2alpha1.Resource("ciliuml2announcementpolicy"))} + return &ciliumL2AnnouncementPolicyLister{listers.New[*ciliumiov2alpha1.CiliumL2AnnouncementPolicy](indexer, ciliumiov2alpha1.Resource("ciliuml2announcementpolicy"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumloadbalancerippool.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumloadbalancerippool.go index c94138514ee65..0b2abee1d40e0 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumloadbalancerippool.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumloadbalancerippool.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumLoadBalancerIPPoolLister helps list CiliumLoadBalancerIPPools. @@ -17,19 +17,19 @@ import ( type CiliumLoadBalancerIPPoolLister interface { // List lists all CiliumLoadBalancerIPPools in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumLoadBalancerIPPool, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumLoadBalancerIPPool, err error) // Get retrieves the CiliumLoadBalancerIPPool from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumLoadBalancerIPPool, error) + Get(name string) (*ciliumiov2alpha1.CiliumLoadBalancerIPPool, error) CiliumLoadBalancerIPPoolListerExpansion } // ciliumLoadBalancerIPPoolLister implements the CiliumLoadBalancerIPPoolLister interface. type ciliumLoadBalancerIPPoolLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumLoadBalancerIPPool] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumLoadBalancerIPPool] } // NewCiliumLoadBalancerIPPoolLister returns a new CiliumLoadBalancerIPPoolLister. func NewCiliumLoadBalancerIPPoolLister(indexer cache.Indexer) CiliumLoadBalancerIPPoolLister { - return &ciliumLoadBalancerIPPoolLister{listers.New[*v2alpha1.CiliumLoadBalancerIPPool](indexer, v2alpha1.Resource("ciliumloadbalancerippool"))} + return &ciliumLoadBalancerIPPoolLister{listers.New[*ciliumiov2alpha1.CiliumLoadBalancerIPPool](indexer, ciliumiov2alpha1.Resource("ciliumloadbalancerippool"))} } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumnodeconfig.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumnodeconfig.go index a2510fe36a263..8d655359e999d 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumnodeconfig.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumnodeconfig.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumNodeConfigLister helps list CiliumNodeConfigs. @@ -17,7 +17,7 @@ import ( type CiliumNodeConfigLister interface { // List lists all CiliumNodeConfigs in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumNodeConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumNodeConfig, err error) // CiliumNodeConfigs returns an object that can list and get CiliumNodeConfigs. CiliumNodeConfigs(namespace string) CiliumNodeConfigNamespaceLister CiliumNodeConfigListerExpansion @@ -25,17 +25,17 @@ type CiliumNodeConfigLister interface { // ciliumNodeConfigLister implements the CiliumNodeConfigLister interface. type ciliumNodeConfigLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumNodeConfig] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumNodeConfig] } // NewCiliumNodeConfigLister returns a new CiliumNodeConfigLister. func NewCiliumNodeConfigLister(indexer cache.Indexer) CiliumNodeConfigLister { - return &ciliumNodeConfigLister{listers.New[*v2alpha1.CiliumNodeConfig](indexer, v2alpha1.Resource("ciliumnodeconfig"))} + return &ciliumNodeConfigLister{listers.New[*ciliumiov2alpha1.CiliumNodeConfig](indexer, ciliumiov2alpha1.Resource("ciliumnodeconfig"))} } // CiliumNodeConfigs returns an object that can list and get CiliumNodeConfigs. func (s *ciliumNodeConfigLister) CiliumNodeConfigs(namespace string) CiliumNodeConfigNamespaceLister { - return ciliumNodeConfigNamespaceLister{listers.NewNamespaced[*v2alpha1.CiliumNodeConfig](s.ResourceIndexer, namespace)} + return ciliumNodeConfigNamespaceLister{listers.NewNamespaced[*ciliumiov2alpha1.CiliumNodeConfig](s.ResourceIndexer, namespace)} } // CiliumNodeConfigNamespaceLister helps list and get CiliumNodeConfigs. @@ -43,15 +43,15 @@ func (s *ciliumNodeConfigLister) CiliumNodeConfigs(namespace string) CiliumNodeC type CiliumNodeConfigNamespaceLister interface { // List lists all CiliumNodeConfigs in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumNodeConfig, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumNodeConfig, err error) // Get retrieves the CiliumNodeConfig from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumNodeConfig, error) + Get(name string) (*ciliumiov2alpha1.CiliumNodeConfig, error) CiliumNodeConfigNamespaceListerExpansion } // ciliumNodeConfigNamespaceLister implements the CiliumNodeConfigNamespaceLister // interface. type ciliumNodeConfigNamespaceLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumNodeConfig] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumNodeConfig] } diff --git a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumpodippool.go b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumpodippool.go index eb657f8bc2a6f..8bc1f2a92ca55 100644 --- a/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumpodippool.go +++ b/pkg/k8s/client/listers/cilium.io/v2alpha1/ciliumpodippool.go @@ -6,10 +6,10 @@ package v2alpha1 import ( - v2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + ciliumiov2alpha1 "github.com/cilium/cilium/pkg/k8s/apis/cilium.io/v2alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CiliumPodIPPoolLister helps list CiliumPodIPPools. @@ -17,19 +17,19 @@ import ( type CiliumPodIPPoolLister interface { // List lists all CiliumPodIPPools in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v2alpha1.CiliumPodIPPool, err error) + List(selector labels.Selector) (ret []*ciliumiov2alpha1.CiliumPodIPPool, err error) // Get retrieves the CiliumPodIPPool from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v2alpha1.CiliumPodIPPool, error) + Get(name string) (*ciliumiov2alpha1.CiliumPodIPPool, error) CiliumPodIPPoolListerExpansion } // ciliumPodIPPoolLister implements the CiliumPodIPPoolLister interface. type ciliumPodIPPoolLister struct { - listers.ResourceIndexer[*v2alpha1.CiliumPodIPPool] + listers.ResourceIndexer[*ciliumiov2alpha1.CiliumPodIPPool] } // NewCiliumPodIPPoolLister returns a new CiliumPodIPPoolLister. func NewCiliumPodIPPoolLister(indexer cache.Indexer) CiliumPodIPPoolLister { - return &ciliumPodIPPoolLister{listers.New[*v2alpha1.CiliumPodIPPool](indexer, v2alpha1.Resource("ciliumpodippool"))} + return &ciliumPodIPPoolLister{listers.New[*ciliumiov2alpha1.CiliumPodIPPool](indexer, ciliumiov2alpha1.Resource("ciliumpodippool"))} } diff --git a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/clientset.go b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/clientset.go index a44f5ee0993ba..af015904a0b36 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/clientset.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/clientset.go @@ -6,8 +6,8 @@ package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1" discovery "k8s.io/client-go/discovery" diff --git a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go index 5f5e04bd9aa8a..2c2d6c5216929 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go @@ -6,10 +6,10 @@ package v1 import ( - "net/http" + http "net/http" - "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/scheme" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" + scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/scheme" + apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" rest "k8s.io/client-go/rest" ) @@ -72,7 +72,7 @@ func New(c rest.Interface) *ApiextensionsV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := apiextensionsv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go index 66dbbe2b04d49..4ce75c1e80072 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go @@ -6,10 +6,10 @@ package v1 import ( - "context" + context "context" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/scheme" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" + apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -24,31 +24,33 @@ type CustomResourceDefinitionsGetter interface { // CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources. type CustomResourceDefinitionInterface interface { - Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (*v1.CustomResourceDefinition, error) - Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error) + Create(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinition, opts metav1.CreateOptions) (*apiextensionsv1.CustomResourceDefinition, error) + Update(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinition, opts metav1.UpdateOptions) (*apiextensionsv1.CustomResourceDefinition, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CustomResourceDefinition, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.CustomResourceDefinitionList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*apiextensionsv1.CustomResourceDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*apiextensionsv1.CustomResourceDefinitionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CustomResourceDefinition, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *apiextensionsv1.CustomResourceDefinition, err error) CustomResourceDefinitionExpansion } // customResourceDefinitions implements CustomResourceDefinitionInterface type customResourceDefinitions struct { - *gentype.ClientWithList[*v1.CustomResourceDefinition, *v1.CustomResourceDefinitionList] + *gentype.ClientWithList[*apiextensionsv1.CustomResourceDefinition, *apiextensionsv1.CustomResourceDefinitionList] } // newCustomResourceDefinitions returns a CustomResourceDefinitions func newCustomResourceDefinitions(c *ApiextensionsV1Client) *customResourceDefinitions { return &customResourceDefinitions{ - gentype.NewClientWithList[*v1.CustomResourceDefinition, *v1.CustomResourceDefinitionList]( + gentype.NewClientWithList[*apiextensionsv1.CustomResourceDefinition, *apiextensionsv1.CustomResourceDefinitionList]( "customresourcedefinitions", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.CustomResourceDefinition { return &v1.CustomResourceDefinition{} }, - func() *v1.CustomResourceDefinitionList { return &v1.CustomResourceDefinitionList{} }), + func() *apiextensionsv1.CustomResourceDefinition { return &apiextensionsv1.CustomResourceDefinition{} }, + func() *apiextensionsv1.CustomResourceDefinitionList { + return &apiextensionsv1.CustomResourceDefinitionList{} + }), } } diff --git a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go index 32985f2dee16c..c868c2ed05a1f 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/apiextensions/v1/customresourcedefinition.go b/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/apiextensions/v1/customresourcedefinition.go index 523c65eef513b..7a053e708ddc6 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/apiextensions/v1/customresourcedefinition.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/apiextensions/v1/customresourcedefinition.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1" - apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" + apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1" + apisapiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // CustomResourceDefinitions. type CustomResourceDefinitionInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.CustomResourceDefinitionLister + Lister() apiextensionsv1.CustomResourceDefinitionLister } type customResourceDefinitionInformer struct { @@ -57,7 +57,7 @@ func NewFilteredCustomResourceDefinitionInformer(client versioned.Interface, res return client.ApiextensionsV1().CustomResourceDefinitions().Watch(context.TODO(), options) }, }, - &apiextensionsv1.CustomResourceDefinition{}, + &apisapiextensionsv1.CustomResourceDefinition{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *customResourceDefinitionInformer) defaultInformer(client versioned.Inte } func (f *customResourceDefinitionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&apiextensionsv1.CustomResourceDefinition{}, f.defaultInformer) + return f.factory.InformerFor(&apisapiextensionsv1.CustomResourceDefinition{}, f.defaultInformer) } -func (f *customResourceDefinitionInformer) Lister() v1.CustomResourceDefinitionLister { - return v1.NewCustomResourceDefinitionLister(f.Informer().GetIndexer()) +func (f *customResourceDefinitionInformer) Lister() apiextensionsv1.CustomResourceDefinitionLister { + return apiextensionsv1.NewCustomResourceDefinitionLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/generic.go b/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/generic.go index 85977955e2464..5bb21d4302d58 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/generic.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/informers/externalversions/generic.go @@ -6,7 +6,7 @@ package externalversions import ( - "fmt" + fmt "fmt" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" diff --git a/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1/customresourcedefinition.go b/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1/customresourcedefinition.go index 316f7cfcbab2e..0ef80fe30d9bc 100644 --- a/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1/customresourcedefinition.go +++ b/pkg/k8s/slim/k8s/apiextensions-client/listers/apiextensions/v1/customresourcedefinition.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + apiextensionsv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/apis/apiextensions/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // CustomResourceDefinitionLister helps list CustomResourceDefinitions. @@ -17,19 +17,19 @@ import ( type CustomResourceDefinitionLister interface { // List lists all CustomResourceDefinitions in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.CustomResourceDefinition, err error) + List(selector labels.Selector) (ret []*apiextensionsv1.CustomResourceDefinition, err error) // Get retrieves the CustomResourceDefinition from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.CustomResourceDefinition, error) + Get(name string) (*apiextensionsv1.CustomResourceDefinition, error) CustomResourceDefinitionListerExpansion } // customResourceDefinitionLister implements the CustomResourceDefinitionLister interface. type customResourceDefinitionLister struct { - listers.ResourceIndexer[*v1.CustomResourceDefinition] + listers.ResourceIndexer[*apiextensionsv1.CustomResourceDefinition] } // NewCustomResourceDefinitionLister returns a new CustomResourceDefinitionLister. func NewCustomResourceDefinitionLister(indexer cache.Indexer) CustomResourceDefinitionLister { - return &customResourceDefinitionLister{listers.New[*v1.CustomResourceDefinition](indexer, v1.Resource("customresourcedefinition"))} + return &customResourceDefinitionLister{listers.New[*apiextensionsv1.CustomResourceDefinition](indexer, apiextensionsv1.Resource("customresourcedefinition"))} } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/clientset.go b/pkg/k8s/slim/k8s/client/clientset/versioned/clientset.go index 66370e6d6f902..2ec6aa35d09f3 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/clientset.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/clientset.go @@ -6,8 +6,8 @@ package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1" discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/core_client.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/core_client.go index 25eab19580c55..a0fbaebde2dfe 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/core_client.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/core_client.go @@ -6,10 +6,10 @@ package v1 import ( - "net/http" + http "net/http" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -97,7 +97,7 @@ func New(c rest.Interface) *CoreV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := corev1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/api" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/endpoints.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/endpoints.go index a0a09e41e5516..d66b17fd9a22c 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/endpoints.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/endpoints.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type EndpointsGetter interface { // EndpointsInterface has methods to work with Endpoints resources. type EndpointsInterface interface { - Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) - Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) + Create(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.CreateOptions) (*corev1.Endpoints, error) + Update(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Endpoints, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Endpoints, err error) EndpointsExpansion } // endpoints implements EndpointsInterface type endpoints struct { - *gentype.ClientWithList[*v1.Endpoints, *v1.EndpointsList] + *gentype.ClientWithList[*corev1.Endpoints, *corev1.EndpointsList] } // newEndpoints returns a Endpoints func newEndpoints(c *CoreV1Client, namespace string) *endpoints { return &endpoints{ - gentype.NewClientWithList[*v1.Endpoints, *v1.EndpointsList]( + gentype.NewClientWithList[*corev1.Endpoints, *corev1.EndpointsList]( "endpoints", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.Endpoints { return &v1.Endpoints{} }, - func() *v1.EndpointsList { return &v1.EndpointsList{} }), + func() *corev1.Endpoints { return &corev1.Endpoints{} }, + func() *corev1.EndpointsList { return &corev1.EndpointsList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_endpoints.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_endpoints.go index 0cca0af7c96f1..fe2dda7143f76 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_endpoints.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_endpoints.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_namespace.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_namespace.go index 36372ea414d9d..b16f29d9d8ec0 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_namespace.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_namespace.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_node.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_node.go index 0005486118add..e61d886d0ee01 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_node.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_node.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_pod.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_pod.go index 798da133cf011..d3197ceabe7a2 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_pod.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_pod.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_secret.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_secret.go index edac295c27bcd..72442a38c5374 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_secret.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_secret.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_service.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_service.go index 95c59a4fffe28..1bd4f957794c2 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_service.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/fake/fake_service.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/namespace.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/namespace.go index 39392ff98a76f..a389a2ca0446b 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/namespace.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/namespace.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,30 +24,30 @@ type NamespacesGetter interface { // NamespaceInterface has methods to work with Namespace resources. type NamespaceInterface interface { - Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error) - Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) + Create(ctx context.Context, namespace *corev1.Namespace, opts metav1.CreateOptions) (*corev1.Namespace, error) + Update(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Namespace, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Namespace, err error) NamespaceExpansion } // namespaces implements NamespaceInterface type namespaces struct { - *gentype.ClientWithList[*v1.Namespace, *v1.NamespaceList] + *gentype.ClientWithList[*corev1.Namespace, *corev1.NamespaceList] } // newNamespaces returns a Namespaces func newNamespaces(c *CoreV1Client) *namespaces { return &namespaces{ - gentype.NewClientWithList[*v1.Namespace, *v1.NamespaceList]( + gentype.NewClientWithList[*corev1.Namespace, *corev1.NamespaceList]( "namespaces", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Namespace { return &v1.Namespace{} }, - func() *v1.NamespaceList { return &v1.NamespaceList{} }), + func() *corev1.Namespace { return &corev1.Namespace{} }, + func() *corev1.NamespaceList { return &corev1.NamespaceList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/node.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/node.go index 22a06f4d6bb4d..7d546099a0ef6 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/node.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/node.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,33 +24,33 @@ type NodesGetter interface { // NodeInterface has methods to work with Node resources. type NodeInterface interface { - Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) - Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + Create(ctx context.Context, node *corev1.Node, opts metav1.CreateOptions) (*corev1.Node, error) + Update(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + UpdateStatus(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Node, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Node, err error) NodeExpansion } // nodes implements NodeInterface type nodes struct { - *gentype.ClientWithList[*v1.Node, *v1.NodeList] + *gentype.ClientWithList[*corev1.Node, *corev1.NodeList] } // newNodes returns a Nodes func newNodes(c *CoreV1Client) *nodes { return &nodes{ - gentype.NewClientWithList[*v1.Node, *v1.NodeList]( + gentype.NewClientWithList[*corev1.Node, *corev1.NodeList]( "nodes", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.Node { return &v1.Node{} }, - func() *v1.NodeList { return &v1.NodeList{} }), + func() *corev1.Node { return &corev1.Node{} }, + func() *corev1.NodeList { return &corev1.NodeList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/pod.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/pod.go index b864dbc83a92d..258fc242ac461 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/pod.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/pod.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,42 +24,42 @@ type PodsGetter interface { // PodInterface has methods to work with Pod resources. type PodInterface interface { - Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) - Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + Create(ctx context.Context, pod *corev1.Pod, opts metav1.CreateOptions) (*corev1.Pod, error) + Update(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + UpdateStatus(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Pod, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Pod, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) - UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Pod, err error) + UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) PodExpansion } // pods implements PodInterface type pods struct { - *gentype.ClientWithList[*v1.Pod, *v1.PodList] + *gentype.ClientWithList[*corev1.Pod, *corev1.PodList] } // newPods returns a Pods func newPods(c *CoreV1Client, namespace string) *pods { return &pods{ - gentype.NewClientWithList[*v1.Pod, *v1.PodList]( + gentype.NewClientWithList[*corev1.Pod, *corev1.PodList]( "pods", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.Pod { return &v1.Pod{} }, - func() *v1.PodList { return &v1.PodList{} }), + func() *corev1.Pod { return &corev1.Pod{} }, + func() *corev1.PodList { return &corev1.PodList{} }), } } // UpdateEphemeralContainers takes the top resource name and the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { - result = &v1.Pod{} +func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (result *corev1.Pod, err error) { + result = &corev1.Pod{} err = c.GetClient().Put(). Namespace(c.GetNamespace()). Resource("pods"). diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/secret.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/secret.go index 6d1cc1fe62f73..5eea1509a0f52 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/secret.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/secret.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type SecretsGetter interface { // SecretInterface has methods to work with Secret resources. type SecretInterface interface { - Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (*v1.Secret, error) - Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (*v1.Secret, error) + Create(ctx context.Context, secret *corev1.Secret, opts metav1.CreateOptions) (*corev1.Secret, error) + Update(ctx context.Context, secret *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Secret, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Secret, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.SecretList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Secret, err error) SecretExpansion } // secrets implements SecretInterface type secrets struct { - *gentype.ClientWithList[*v1.Secret, *v1.SecretList] + *gentype.ClientWithList[*corev1.Secret, *corev1.SecretList] } // newSecrets returns a Secrets func newSecrets(c *CoreV1Client, namespace string) *secrets { return &secrets{ - gentype.NewClientWithList[*v1.Secret, *v1.SecretList]( + gentype.NewClientWithList[*corev1.Secret, *corev1.SecretList]( "secrets", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.Secret { return &v1.Secret{} }, - func() *v1.SecretList { return &v1.SecretList{} }), + func() *corev1.Secret { return &corev1.Secret{} }, + func() *corev1.SecretList { return &corev1.SecretList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/service.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/service.go index 0e7032b453fdd..cf40a03b23aed 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/service.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/core/v1/service.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,32 +24,32 @@ type ServicesGetter interface { // ServiceInterface has methods to work with Service resources. type ServiceInterface interface { - Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) - Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + Create(ctx context.Context, service *corev1.Service, opts metav1.CreateOptions) (*corev1.Service, error) + Update(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + UpdateStatus(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*corev1.Service, error) + List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *corev1.Service, err error) ServiceExpansion } // services implements ServiceInterface type services struct { - *gentype.ClientWithList[*v1.Service, *v1.ServiceList] + *gentype.ClientWithList[*corev1.Service, *corev1.ServiceList] } // newServices returns a Services func newServices(c *CoreV1Client, namespace string) *services { return &services{ - gentype.NewClientWithList[*v1.Service, *v1.ServiceList]( + gentype.NewClientWithList[*corev1.Service, *corev1.ServiceList]( "services", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.Service { return &v1.Service{} }, - func() *v1.ServiceList { return &v1.ServiceList{} }), + func() *corev1.Service { return &corev1.Service{} }, + func() *corev1.ServiceList { return &corev1.ServiceList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/discovery_client.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/discovery_client.go index ca9ef1187fff0..ffa438d0589cc 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/discovery_client.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/discovery_client.go @@ -6,10 +6,10 @@ package v1 import ( - "net/http" + http "net/http" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" - "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" + discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" + scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -72,7 +72,7 @@ func New(c rest.Interface) *DiscoveryV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := discoveryv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/endpointslice.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/endpointslice.go index 9026481b169f9..4e628602865f4 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/endpointslice.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" + discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type EndpointSlicesGetter interface { // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { - Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (*v1.EndpointSlice, error) - Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (*v1.EndpointSlice, error) + Create(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts metav1.CreateOptions) (*discoveryv1.EndpointSlice, error) + Update(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1.EndpointSlice, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EndpointSlice, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*discoveryv1.EndpointSlice, error) + List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1.EndpointSliceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *discoveryv1.EndpointSlice, err error) EndpointSliceExpansion } // endpointSlices implements EndpointSliceInterface type endpointSlices struct { - *gentype.ClientWithList[*v1.EndpointSlice, *v1.EndpointSliceList] + *gentype.ClientWithList[*discoveryv1.EndpointSlice, *discoveryv1.EndpointSliceList] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1Client, namespace string) *endpointSlices { return &endpointSlices{ - gentype.NewClientWithList[*v1.EndpointSlice, *v1.EndpointSliceList]( + gentype.NewClientWithList[*discoveryv1.EndpointSlice, *discoveryv1.EndpointSliceList]( "endpointslices", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.EndpointSlice { return &v1.EndpointSlice{} }, - func() *v1.EndpointSliceList { return &v1.EndpointSliceList{} }), + func() *discoveryv1.EndpointSlice { return &discoveryv1.EndpointSlice{} }, + func() *discoveryv1.EndpointSliceList { return &discoveryv1.EndpointSliceList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/fake/fake_endpointslice.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/fake/fake_endpointslice.go index af8ca81395b71..215c18ef4b75d 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/fake/fake_endpointslice.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1/fake/fake_endpointslice.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/discovery_client.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/discovery_client.go index d2d55658183d2..ede30d0ce1409 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/discovery_client.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/discovery_client.go @@ -6,10 +6,10 @@ package v1beta1 import ( - "net/http" + http "net/http" - v1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" - "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" + discoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" + scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -72,7 +72,7 @@ func New(c rest.Interface) *DiscoveryV1beta1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion + gv := discoveryv1beta1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/endpointslice.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/endpointslice.go index 813769c1f67d1..82b17ef6733b0 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/endpointslice.go @@ -6,9 +6,9 @@ package v1beta1 import ( - "context" + context "context" - v1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" + discoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type EndpointSlicesGetter interface { // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { - Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (*v1beta1.EndpointSlice, error) - Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (*v1beta1.EndpointSlice, error) + Create(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSlice, opts v1.CreateOptions) (*discoveryv1beta1.EndpointSlice, error) + Update(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSlice, opts v1.UpdateOptions) (*discoveryv1beta1.EndpointSlice, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EndpointSlice, error) - List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*discoveryv1beta1.EndpointSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*discoveryv1beta1.EndpointSliceList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *discoveryv1beta1.EndpointSlice, err error) EndpointSliceExpansion } // endpointSlices implements EndpointSliceInterface type endpointSlices struct { - *gentype.ClientWithList[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList] + *gentype.ClientWithList[*discoveryv1beta1.EndpointSlice, *discoveryv1beta1.EndpointSliceList] } // newEndpointSlices returns a EndpointSlices func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSlices { return &endpointSlices{ - gentype.NewClientWithList[*v1beta1.EndpointSlice, *v1beta1.EndpointSliceList]( + gentype.NewClientWithList[*discoveryv1beta1.EndpointSlice, *discoveryv1beta1.EndpointSliceList]( "endpointslices", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1beta1.EndpointSlice { return &v1beta1.EndpointSlice{} }, - func() *v1beta1.EndpointSliceList { return &v1beta1.EndpointSliceList{} }), + func() *discoveryv1beta1.EndpointSlice { return &discoveryv1beta1.EndpointSlice{} }, + func() *discoveryv1beta1.EndpointSliceList { return &discoveryv1beta1.EndpointSliceList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/fake/fake_endpointslice.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/fake/fake_endpointslice.go index 3f4b0eca51f6d..32a5edb07b7ae 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/fake/fake_endpointslice.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/discovery/v1beta1/fake/fake_endpointslice.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/fake/fake_networkpolicy.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/fake/fake_networkpolicy.go index 769abf5831a5d..a2d68a15ceb84 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/fake/fake_networkpolicy.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/fake/fake_networkpolicy.go @@ -6,7 +6,7 @@ package fake import ( - "context" + context "context" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networking_client.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networking_client.go index ab93e1dfa9d27..b62b7492b52a6 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networking_client.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networking_client.go @@ -6,10 +6,10 @@ package v1 import ( - "net/http" + http "net/http" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" - "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" + networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" + scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -72,7 +72,7 @@ func New(c rest.Interface) *NetworkingV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := networkingv1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() diff --git a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networkpolicy.go b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networkpolicy.go index 2c5e9fcf833f5..a26a2af5e6946 100644 --- a/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networkpolicy.go +++ b/pkg/k8s/slim/k8s/client/clientset/versioned/typed/networking/v1/networkpolicy.go @@ -6,9 +6,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" + networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" scheme "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -24,31 +24,31 @@ type NetworkPoliciesGetter interface { // NetworkPolicyInterface has methods to work with NetworkPolicy resources. type NetworkPolicyInterface interface { - Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (*v1.NetworkPolicy, error) - Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) + Create(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts metav1.CreateOptions) (*networkingv1.NetworkPolicy, error) + Update(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts metav1.UpdateOptions) (*networkingv1.NetworkPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*networkingv1.NetworkPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.NetworkPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *networkingv1.NetworkPolicy, err error) NetworkPolicyExpansion } // networkPolicies implements NetworkPolicyInterface type networkPolicies struct { - *gentype.ClientWithList[*v1.NetworkPolicy, *v1.NetworkPolicyList] + *gentype.ClientWithList[*networkingv1.NetworkPolicy, *networkingv1.NetworkPolicyList] } // newNetworkPolicies returns a NetworkPolicies func newNetworkPolicies(c *NetworkingV1Client, namespace string) *networkPolicies { return &networkPolicies{ - gentype.NewClientWithList[*v1.NetworkPolicy, *v1.NetworkPolicyList]( + gentype.NewClientWithList[*networkingv1.NetworkPolicy, *networkingv1.NetworkPolicyList]( "networkpolicies", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1.NetworkPolicy { return &v1.NetworkPolicy{} }, - func() *v1.NetworkPolicyList { return &v1.NetworkPolicyList{} }), + func() *networkingv1.NetworkPolicy { return &networkingv1.NetworkPolicy{} }, + func() *networkingv1.NetworkPolicyList { return &networkingv1.NetworkPolicyList{} }), } } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/endpoints.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/endpoints.go index ba1226714ce40..c12aa92f5eee2 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/endpoints.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/endpoints.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Endpoints. type EndpointsInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.EndpointsLister + Lister() corev1.EndpointsLister } type endpointsInformer struct { @@ -58,7 +58,7 @@ func NewFilteredEndpointsInformer(client versioned.Interface, namespace string, return client.CoreV1().Endpoints(namespace).Watch(context.TODO(), options) }, }, - &corev1.Endpoints{}, + &apicorev1.Endpoints{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *endpointsInformer) defaultInformer(client versioned.Interface, resyncPe } func (f *endpointsInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Endpoints{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Endpoints{}, f.defaultInformer) } -func (f *endpointsInformer) Lister() v1.EndpointsLister { - return v1.NewEndpointsLister(f.Informer().GetIndexer()) +func (f *endpointsInformer) Lister() corev1.EndpointsLister { + return corev1.NewEndpointsLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/namespace.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/namespace.go index e87d66312cda9..ba8bbac18e753 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/namespace.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/namespace.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Namespaces. type NamespaceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.NamespaceLister + Lister() corev1.NamespaceLister } type namespaceInformer struct { @@ -57,7 +57,7 @@ func NewFilteredNamespaceInformer(client versioned.Interface, resyncPeriod time. return client.CoreV1().Namespaces().Watch(context.TODO(), options) }, }, - &corev1.Namespace{}, + &apicorev1.Namespace{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *namespaceInformer) defaultInformer(client versioned.Interface, resyncPe } func (f *namespaceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Namespace{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Namespace{}, f.defaultInformer) } -func (f *namespaceInformer) Lister() v1.NamespaceLister { - return v1.NewNamespaceLister(f.Informer().GetIndexer()) +func (f *namespaceInformer) Lister() corev1.NamespaceLister { + return corev1.NewNamespaceLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/node.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/node.go index 8e045ab5cd8ad..f7a410fb9c53f 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/node.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/node.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Nodes. type NodeInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.NodeLister + Lister() corev1.NodeLister } type nodeInformer struct { @@ -57,7 +57,7 @@ func NewFilteredNodeInformer(client versioned.Interface, resyncPeriod time.Durat return client.CoreV1().Nodes().Watch(context.TODO(), options) }, }, - &corev1.Node{}, + &apicorev1.Node{}, resyncPeriod, indexers, ) @@ -68,9 +68,9 @@ func (f *nodeInformer) defaultInformer(client versioned.Interface, resyncPeriod } func (f *nodeInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Node{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Node{}, f.defaultInformer) } -func (f *nodeInformer) Lister() v1.NodeLister { - return v1.NewNodeLister(f.Informer().GetIndexer()) +func (f *nodeInformer) Lister() corev1.NodeLister { + return corev1.NewNodeLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/pod.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/pod.go index 10f05911b8567..5b30408e9f8c4 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/pod.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/pod.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Pods. type PodInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.PodLister + Lister() corev1.PodLister } type podInformer struct { @@ -58,7 +58,7 @@ func NewFilteredPodInformer(client versioned.Interface, namespace string, resync return client.CoreV1().Pods(namespace).Watch(context.TODO(), options) }, }, - &corev1.Pod{}, + &apicorev1.Pod{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *podInformer) defaultInformer(client versioned.Interface, resyncPeriod t } func (f *podInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Pod{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Pod{}, f.defaultInformer) } -func (f *podInformer) Lister() v1.PodLister { - return v1.NewPodLister(f.Informer().GetIndexer()) +func (f *podInformer) Lister() corev1.PodLister { + return corev1.NewPodLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/secret.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/secret.go index d20211e675d26..da134daae877d 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/secret.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/secret.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Secrets. type SecretInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.SecretLister + Lister() corev1.SecretLister } type secretInformer struct { @@ -58,7 +58,7 @@ func NewFilteredSecretInformer(client versioned.Interface, namespace string, res return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options) }, }, - &corev1.Secret{}, + &apicorev1.Secret{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *secretInformer) defaultInformer(client versioned.Interface, resyncPerio } func (f *secretInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Secret{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Secret{}, f.defaultInformer) } -func (f *secretInformer) Lister() v1.SecretLister { - return v1.NewSecretLister(f.Informer().GetIndexer()) +func (f *secretInformer) Lister() corev1.SecretLister { + return corev1.NewSecretLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/service.go b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/service.go index f213aec9ca635..c4b15018b7ae9 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/service.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/core/v1/service.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + apicorev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // Services. type ServiceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.ServiceLister + Lister() corev1.ServiceLister } type serviceInformer struct { @@ -58,7 +58,7 @@ func NewFilteredServiceInformer(client versioned.Interface, namespace string, re return client.CoreV1().Services(namespace).Watch(context.TODO(), options) }, }, - &corev1.Service{}, + &apicorev1.Service{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *serviceInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *serviceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&corev1.Service{}, f.defaultInformer) + return f.factory.InformerFor(&apicorev1.Service{}, f.defaultInformer) } -func (f *serviceInformer) Lister() v1.ServiceLister { - return v1.NewServiceLister(f.Informer().GetIndexer()) +func (f *serviceInformer) Lister() corev1.ServiceLister { + return corev1.NewServiceLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1/endpointslice.go b/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1/endpointslice.go index 31ed7c21d0756..eb1a83760461f 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1/endpointslice.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" + apidiscoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/discovery/v1" + discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // EndpointSlices. type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.EndpointSliceLister + Lister() discoveryv1.EndpointSliceLister } type endpointSliceInformer struct { @@ -58,7 +58,7 @@ func NewFilteredEndpointSliceInformer(client versioned.Interface, namespace stri return client.DiscoveryV1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, - &discoveryv1.EndpointSlice{}, + &apidiscoveryv1.EndpointSlice{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *endpointSliceInformer) defaultInformer(client versioned.Interface, resy } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&discoveryv1.EndpointSlice{}, f.defaultInformer) + return f.factory.InformerFor(&apidiscoveryv1.EndpointSlice{}, f.defaultInformer) } -func (f *endpointSliceInformer) Lister() v1.EndpointSliceLister { - return v1.NewEndpointSliceLister(f.Informer().GetIndexer()) +func (f *endpointSliceInformer) Lister() discoveryv1.EndpointSliceLister { + return discoveryv1.NewEndpointSliceLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1beta1/endpointslice.go b/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1beta1/endpointslice.go index cc400c951a000..b6f67774d6f4f 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1beta1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/discovery/v1beta1/endpointslice.go @@ -6,13 +6,13 @@ package v1beta1 import ( - "context" + context "context" time "time" - discoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" + apidiscoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1" + discoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // EndpointSlices. type EndpointSliceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.EndpointSliceLister + Lister() discoveryv1beta1.EndpointSliceLister } type endpointSliceInformer struct { @@ -58,7 +58,7 @@ func NewFilteredEndpointSliceInformer(client versioned.Interface, namespace stri return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, - &discoveryv1beta1.EndpointSlice{}, + &apidiscoveryv1beta1.EndpointSlice{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *endpointSliceInformer) defaultInformer(client versioned.Interface, resy } func (f *endpointSliceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&discoveryv1beta1.EndpointSlice{}, f.defaultInformer) + return f.factory.InformerFor(&apidiscoveryv1beta1.EndpointSlice{}, f.defaultInformer) } -func (f *endpointSliceInformer) Lister() v1beta1.EndpointSliceLister { - return v1beta1.NewEndpointSliceLister(f.Informer().GetIndexer()) +func (f *endpointSliceInformer) Lister() discoveryv1beta1.EndpointSliceLister { + return discoveryv1beta1.NewEndpointSliceLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/generic.go b/pkg/k8s/slim/k8s/client/informers/externalversions/generic.go index 292a9e7d442ec..94194d5cd8d6e 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/generic.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/generic.go @@ -6,7 +6,7 @@ package externalversions import ( - "fmt" + fmt "fmt" v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" diff --git a/pkg/k8s/slim/k8s/client/informers/externalversions/networking/v1/networkpolicy.go b/pkg/k8s/slim/k8s/client/informers/externalversions/networking/v1/networkpolicy.go index 7697fdf19a27e..288689261fd9b 100644 --- a/pkg/k8s/slim/k8s/client/informers/externalversions/networking/v1/networkpolicy.go +++ b/pkg/k8s/slim/k8s/client/informers/externalversions/networking/v1/networkpolicy.go @@ -6,13 +6,13 @@ package v1 import ( - "context" + context "context" time "time" - networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" + apinetworkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" versioned "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/clientset/versioned" internalinterfaces "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/informers/externalversions/internalinterfaces" - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/networking/v1" + networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/client/listers/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" @@ -23,7 +23,7 @@ import ( // NetworkPolicies. type NetworkPolicyInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.NetworkPolicyLister + Lister() networkingv1.NetworkPolicyLister } type networkPolicyInformer struct { @@ -58,7 +58,7 @@ func NewFilteredNetworkPolicyInformer(client versioned.Interface, namespace stri return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.TODO(), options) }, }, - &networkingv1.NetworkPolicy{}, + &apinetworkingv1.NetworkPolicy{}, resyncPeriod, indexers, ) @@ -69,9 +69,9 @@ func (f *networkPolicyInformer) defaultInformer(client versioned.Interface, resy } func (f *networkPolicyInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1.NetworkPolicy{}, f.defaultInformer) + return f.factory.InformerFor(&apinetworkingv1.NetworkPolicy{}, f.defaultInformer) } -func (f *networkPolicyInformer) Lister() v1.NetworkPolicyLister { - return v1.NewNetworkPolicyLister(f.Informer().GetIndexer()) +func (f *networkPolicyInformer) Lister() networkingv1.NetworkPolicyLister { + return networkingv1.NewNetworkPolicyLister(f.Informer().GetIndexer()) } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/endpoints.go b/pkg/k8s/slim/k8s/client/listers/core/v1/endpoints.go index d37a57416b5da..3b17496c38a0f 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/endpoints.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/endpoints.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // EndpointsLister helps list Endpoints. @@ -17,7 +17,7 @@ import ( type EndpointsLister interface { // List lists all Endpoints in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Endpoints, err error) + List(selector labels.Selector) (ret []*corev1.Endpoints, err error) // Endpoints returns an object that can list and get Endpoints. Endpoints(namespace string) EndpointsNamespaceLister EndpointsListerExpansion @@ -25,17 +25,17 @@ type EndpointsLister interface { // endpointsLister implements the EndpointsLister interface. type endpointsLister struct { - listers.ResourceIndexer[*v1.Endpoints] + listers.ResourceIndexer[*corev1.Endpoints] } // NewEndpointsLister returns a new EndpointsLister. func NewEndpointsLister(indexer cache.Indexer) EndpointsLister { - return &endpointsLister{listers.New[*v1.Endpoints](indexer, v1.Resource("endpoints"))} + return &endpointsLister{listers.New[*corev1.Endpoints](indexer, corev1.Resource("endpoints"))} } // Endpoints returns an object that can list and get Endpoints. func (s *endpointsLister) Endpoints(namespace string) EndpointsNamespaceLister { - return endpointsNamespaceLister{listers.NewNamespaced[*v1.Endpoints](s.ResourceIndexer, namespace)} + return endpointsNamespaceLister{listers.NewNamespaced[*corev1.Endpoints](s.ResourceIndexer, namespace)} } // EndpointsNamespaceLister helps list and get Endpoints. @@ -43,15 +43,15 @@ func (s *endpointsLister) Endpoints(namespace string) EndpointsNamespaceLister { type EndpointsNamespaceLister interface { // List lists all Endpoints in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Endpoints, err error) + List(selector labels.Selector) (ret []*corev1.Endpoints, err error) // Get retrieves the Endpoints from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Endpoints, error) + Get(name string) (*corev1.Endpoints, error) EndpointsNamespaceListerExpansion } // endpointsNamespaceLister implements the EndpointsNamespaceLister // interface. type endpointsNamespaceLister struct { - listers.ResourceIndexer[*v1.Endpoints] + listers.ResourceIndexer[*corev1.Endpoints] } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/namespace.go b/pkg/k8s/slim/k8s/client/listers/core/v1/namespace.go index a585ce873812b..7ea72d62c8dd4 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/namespace.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/namespace.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // NamespaceLister helps list Namespaces. @@ -17,19 +17,19 @@ import ( type NamespaceLister interface { // List lists all Namespaces in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Namespace, err error) + List(selector labels.Selector) (ret []*corev1.Namespace, err error) // Get retrieves the Namespace from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Namespace, error) + Get(name string) (*corev1.Namespace, error) NamespaceListerExpansion } // namespaceLister implements the NamespaceLister interface. type namespaceLister struct { - listers.ResourceIndexer[*v1.Namespace] + listers.ResourceIndexer[*corev1.Namespace] } // NewNamespaceLister returns a new NamespaceLister. func NewNamespaceLister(indexer cache.Indexer) NamespaceLister { - return &namespaceLister{listers.New[*v1.Namespace](indexer, v1.Resource("namespace"))} + return &namespaceLister{listers.New[*corev1.Namespace](indexer, corev1.Resource("namespace"))} } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/node.go b/pkg/k8s/slim/k8s/client/listers/core/v1/node.go index fbba687487fd6..43434ecae7763 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/node.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/node.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // NodeLister helps list Nodes. @@ -17,19 +17,19 @@ import ( type NodeLister interface { // List lists all Nodes in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Node, err error) + List(selector labels.Selector) (ret []*corev1.Node, err error) // Get retrieves the Node from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Node, error) + Get(name string) (*corev1.Node, error) NodeListerExpansion } // nodeLister implements the NodeLister interface. type nodeLister struct { - listers.ResourceIndexer[*v1.Node] + listers.ResourceIndexer[*corev1.Node] } // NewNodeLister returns a new NodeLister. func NewNodeLister(indexer cache.Indexer) NodeLister { - return &nodeLister{listers.New[*v1.Node](indexer, v1.Resource("node"))} + return &nodeLister{listers.New[*corev1.Node](indexer, corev1.Resource("node"))} } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/pod.go b/pkg/k8s/slim/k8s/client/listers/core/v1/pod.go index ee19233be9638..f72d6e9d1175d 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/pod.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/pod.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // PodLister helps list Pods. @@ -17,7 +17,7 @@ import ( type PodLister interface { // List lists all Pods in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Pod, err error) + List(selector labels.Selector) (ret []*corev1.Pod, err error) // Pods returns an object that can list and get Pods. Pods(namespace string) PodNamespaceLister PodListerExpansion @@ -25,17 +25,17 @@ type PodLister interface { // podLister implements the PodLister interface. type podLister struct { - listers.ResourceIndexer[*v1.Pod] + listers.ResourceIndexer[*corev1.Pod] } // NewPodLister returns a new PodLister. func NewPodLister(indexer cache.Indexer) PodLister { - return &podLister{listers.New[*v1.Pod](indexer, v1.Resource("pod"))} + return &podLister{listers.New[*corev1.Pod](indexer, corev1.Resource("pod"))} } // Pods returns an object that can list and get Pods. func (s *podLister) Pods(namespace string) PodNamespaceLister { - return podNamespaceLister{listers.NewNamespaced[*v1.Pod](s.ResourceIndexer, namespace)} + return podNamespaceLister{listers.NewNamespaced[*corev1.Pod](s.ResourceIndexer, namespace)} } // PodNamespaceLister helps list and get Pods. @@ -43,15 +43,15 @@ func (s *podLister) Pods(namespace string) PodNamespaceLister { type PodNamespaceLister interface { // List lists all Pods in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Pod, err error) + List(selector labels.Selector) (ret []*corev1.Pod, err error) // Get retrieves the Pod from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Pod, error) + Get(name string) (*corev1.Pod, error) PodNamespaceListerExpansion } // podNamespaceLister implements the PodNamespaceLister // interface. type podNamespaceLister struct { - listers.ResourceIndexer[*v1.Pod] + listers.ResourceIndexer[*corev1.Pod] } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/secret.go b/pkg/k8s/slim/k8s/client/listers/core/v1/secret.go index 19025cabf6ea0..e9993e86f736d 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/secret.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/secret.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // SecretLister helps list Secrets. @@ -17,7 +17,7 @@ import ( type SecretLister interface { // List lists all Secrets in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Secret, err error) + List(selector labels.Selector) (ret []*corev1.Secret, err error) // Secrets returns an object that can list and get Secrets. Secrets(namespace string) SecretNamespaceLister SecretListerExpansion @@ -25,17 +25,17 @@ type SecretLister interface { // secretLister implements the SecretLister interface. type secretLister struct { - listers.ResourceIndexer[*v1.Secret] + listers.ResourceIndexer[*corev1.Secret] } // NewSecretLister returns a new SecretLister. func NewSecretLister(indexer cache.Indexer) SecretLister { - return &secretLister{listers.New[*v1.Secret](indexer, v1.Resource("secret"))} + return &secretLister{listers.New[*corev1.Secret](indexer, corev1.Resource("secret"))} } // Secrets returns an object that can list and get Secrets. func (s *secretLister) Secrets(namespace string) SecretNamespaceLister { - return secretNamespaceLister{listers.NewNamespaced[*v1.Secret](s.ResourceIndexer, namespace)} + return secretNamespaceLister{listers.NewNamespaced[*corev1.Secret](s.ResourceIndexer, namespace)} } // SecretNamespaceLister helps list and get Secrets. @@ -43,15 +43,15 @@ func (s *secretLister) Secrets(namespace string) SecretNamespaceLister { type SecretNamespaceLister interface { // List lists all Secrets in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Secret, err error) + List(selector labels.Selector) (ret []*corev1.Secret, err error) // Get retrieves the Secret from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Secret, error) + Get(name string) (*corev1.Secret, error) SecretNamespaceListerExpansion } // secretNamespaceLister implements the SecretNamespaceLister // interface. type secretNamespaceLister struct { - listers.ResourceIndexer[*v1.Secret] + listers.ResourceIndexer[*corev1.Secret] } diff --git a/pkg/k8s/slim/k8s/client/listers/core/v1/service.go b/pkg/k8s/slim/k8s/client/listers/core/v1/service.go index f40546b76801d..17255c33a815a 100644 --- a/pkg/k8s/slim/k8s/client/listers/core/v1/service.go +++ b/pkg/k8s/slim/k8s/client/listers/core/v1/service.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + corev1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/core/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // ServiceLister helps list Services. @@ -17,7 +17,7 @@ import ( type ServiceLister interface { // List lists all Services in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Service, err error) + List(selector labels.Selector) (ret []*corev1.Service, err error) // Services returns an object that can list and get Services. Services(namespace string) ServiceNamespaceLister ServiceListerExpansion @@ -25,17 +25,17 @@ type ServiceLister interface { // serviceLister implements the ServiceLister interface. type serviceLister struct { - listers.ResourceIndexer[*v1.Service] + listers.ResourceIndexer[*corev1.Service] } // NewServiceLister returns a new ServiceLister. func NewServiceLister(indexer cache.Indexer) ServiceLister { - return &serviceLister{listers.New[*v1.Service](indexer, v1.Resource("service"))} + return &serviceLister{listers.New[*corev1.Service](indexer, corev1.Resource("service"))} } // Services returns an object that can list and get Services. func (s *serviceLister) Services(namespace string) ServiceNamespaceLister { - return serviceNamespaceLister{listers.NewNamespaced[*v1.Service](s.ResourceIndexer, namespace)} + return serviceNamespaceLister{listers.NewNamespaced[*corev1.Service](s.ResourceIndexer, namespace)} } // ServiceNamespaceLister helps list and get Services. @@ -43,15 +43,15 @@ func (s *serviceLister) Services(namespace string) ServiceNamespaceLister { type ServiceNamespaceLister interface { // List lists all Services in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.Service, err error) + List(selector labels.Selector) (ret []*corev1.Service, err error) // Get retrieves the Service from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.Service, error) + Get(name string) (*corev1.Service, error) ServiceNamespaceListerExpansion } // serviceNamespaceLister implements the ServiceNamespaceLister // interface. type serviceNamespaceLister struct { - listers.ResourceIndexer[*v1.Service] + listers.ResourceIndexer[*corev1.Service] } diff --git a/pkg/k8s/slim/k8s/client/listers/discovery/v1/endpointslice.go b/pkg/k8s/slim/k8s/client/listers/discovery/v1/endpointslice.go index abc5eb95c2a55..8282c00d202d3 100644 --- a/pkg/k8s/slim/k8s/client/listers/discovery/v1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/listers/discovery/v1/endpointslice.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + discoveryv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // EndpointSliceLister helps list EndpointSlices. @@ -17,7 +17,7 @@ import ( type EndpointSliceLister interface { // List lists all EndpointSlices in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) + List(selector labels.Selector) (ret []*discoveryv1.EndpointSlice, err error) // EndpointSlices returns an object that can list and get EndpointSlices. EndpointSlices(namespace string) EndpointSliceNamespaceLister EndpointSliceListerExpansion @@ -25,17 +25,17 @@ type EndpointSliceLister interface { // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { - listers.ResourceIndexer[*v1.EndpointSlice] + listers.ResourceIndexer[*discoveryv1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { - return &endpointSliceLister{listers.New[*v1.EndpointSlice](indexer, v1.Resource("endpointslice"))} + return &endpointSliceLister{listers.New[*discoveryv1.EndpointSlice](indexer, discoveryv1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { - return endpointSliceNamespaceLister{listers.NewNamespaced[*v1.EndpointSlice](s.ResourceIndexer, namespace)} + return endpointSliceNamespaceLister{listers.NewNamespaced[*discoveryv1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. @@ -43,15 +43,15 @@ func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceName type EndpointSliceNamespaceLister interface { // List lists all EndpointSlices in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.EndpointSlice, err error) + List(selector labels.Selector) (ret []*discoveryv1.EndpointSlice, err error) // Get retrieves the EndpointSlice from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.EndpointSlice, error) + Get(name string) (*discoveryv1.EndpointSlice, error) EndpointSliceNamespaceListerExpansion } // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { - listers.ResourceIndexer[*v1.EndpointSlice] + listers.ResourceIndexer[*discoveryv1.EndpointSlice] } diff --git a/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1/endpointslice.go b/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1/endpointslice.go index b6d6aa66abb23..f5bf1a32f26fc 100644 --- a/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1/endpointslice.go +++ b/pkg/k8s/slim/k8s/client/listers/discovery/v1beta1/endpointslice.go @@ -6,10 +6,10 @@ package v1beta1 import ( - v1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + discoveryv1beta1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/discovery/v1beta1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // EndpointSliceLister helps list EndpointSlices. @@ -17,7 +17,7 @@ import ( type EndpointSliceLister interface { // List lists all EndpointSlices in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) + List(selector labels.Selector) (ret []*discoveryv1beta1.EndpointSlice, err error) // EndpointSlices returns an object that can list and get EndpointSlices. EndpointSlices(namespace string) EndpointSliceNamespaceLister EndpointSliceListerExpansion @@ -25,17 +25,17 @@ type EndpointSliceLister interface { // endpointSliceLister implements the EndpointSliceLister interface. type endpointSliceLister struct { - listers.ResourceIndexer[*v1beta1.EndpointSlice] + listers.ResourceIndexer[*discoveryv1beta1.EndpointSlice] } // NewEndpointSliceLister returns a new EndpointSliceLister. func NewEndpointSliceLister(indexer cache.Indexer) EndpointSliceLister { - return &endpointSliceLister{listers.New[*v1beta1.EndpointSlice](indexer, v1beta1.Resource("endpointslice"))} + return &endpointSliceLister{listers.New[*discoveryv1beta1.EndpointSlice](indexer, discoveryv1beta1.Resource("endpointslice"))} } // EndpointSlices returns an object that can list and get EndpointSlices. func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceNamespaceLister { - return endpointSliceNamespaceLister{listers.NewNamespaced[*v1beta1.EndpointSlice](s.ResourceIndexer, namespace)} + return endpointSliceNamespaceLister{listers.NewNamespaced[*discoveryv1beta1.EndpointSlice](s.ResourceIndexer, namespace)} } // EndpointSliceNamespaceLister helps list and get EndpointSlices. @@ -43,15 +43,15 @@ func (s *endpointSliceLister) EndpointSlices(namespace string) EndpointSliceName type EndpointSliceNamespaceLister interface { // List lists all EndpointSlices in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1beta1.EndpointSlice, err error) + List(selector labels.Selector) (ret []*discoveryv1beta1.EndpointSlice, err error) // Get retrieves the EndpointSlice from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1beta1.EndpointSlice, error) + Get(name string) (*discoveryv1beta1.EndpointSlice, error) EndpointSliceNamespaceListerExpansion } // endpointSliceNamespaceLister implements the EndpointSliceNamespaceLister // interface. type endpointSliceNamespaceLister struct { - listers.ResourceIndexer[*v1beta1.EndpointSlice] + listers.ResourceIndexer[*discoveryv1beta1.EndpointSlice] } diff --git a/pkg/k8s/slim/k8s/client/listers/networking/v1/networkpolicy.go b/pkg/k8s/slim/k8s/client/listers/networking/v1/networkpolicy.go index 12964387cc6a6..f5da6422fb35a 100644 --- a/pkg/k8s/slim/k8s/client/listers/networking/v1/networkpolicy.go +++ b/pkg/k8s/slim/k8s/client/listers/networking/v1/networkpolicy.go @@ -6,10 +6,10 @@ package v1 import ( - v1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" + networkingv1 "github.com/cilium/cilium/pkg/k8s/slim/k8s/api/networking/v1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" ) // NetworkPolicyLister helps list NetworkPolicies. @@ -17,7 +17,7 @@ import ( type NetworkPolicyLister interface { // List lists all NetworkPolicies in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.NetworkPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.NetworkPolicy, err error) // NetworkPolicies returns an object that can list and get NetworkPolicies. NetworkPolicies(namespace string) NetworkPolicyNamespaceLister NetworkPolicyListerExpansion @@ -25,17 +25,17 @@ type NetworkPolicyLister interface { // networkPolicyLister implements the NetworkPolicyLister interface. type networkPolicyLister struct { - listers.ResourceIndexer[*v1.NetworkPolicy] + listers.ResourceIndexer[*networkingv1.NetworkPolicy] } // NewNetworkPolicyLister returns a new NetworkPolicyLister. func NewNetworkPolicyLister(indexer cache.Indexer) NetworkPolicyLister { - return &networkPolicyLister{listers.New[*v1.NetworkPolicy](indexer, v1.Resource("networkpolicy"))} + return &networkPolicyLister{listers.New[*networkingv1.NetworkPolicy](indexer, networkingv1.Resource("networkpolicy"))} } // NetworkPolicies returns an object that can list and get NetworkPolicies. func (s *networkPolicyLister) NetworkPolicies(namespace string) NetworkPolicyNamespaceLister { - return networkPolicyNamespaceLister{listers.NewNamespaced[*v1.NetworkPolicy](s.ResourceIndexer, namespace)} + return networkPolicyNamespaceLister{listers.NewNamespaced[*networkingv1.NetworkPolicy](s.ResourceIndexer, namespace)} } // NetworkPolicyNamespaceLister helps list and get NetworkPolicies. @@ -43,15 +43,15 @@ func (s *networkPolicyLister) NetworkPolicies(namespace string) NetworkPolicyNam type NetworkPolicyNamespaceLister interface { // List lists all NetworkPolicies in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1.NetworkPolicy, err error) + List(selector labels.Selector) (ret []*networkingv1.NetworkPolicy, err error) // Get retrieves the NetworkPolicy from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1.NetworkPolicy, error) + Get(name string) (*networkingv1.NetworkPolicy, error) NetworkPolicyNamespaceListerExpansion } // networkPolicyNamespaceLister implements the NetworkPolicyNamespaceLister // interface. type networkPolicyNamespaceLister struct { - listers.ResourceIndexer[*v1.NetworkPolicy] + listers.ResourceIndexer[*networkingv1.NetworkPolicy] } diff --git a/vendor/github.com/cilium/deepequal-gen/Makefile b/vendor/github.com/cilium/deepequal-gen/Makefile index 06a3e536e0292..7b0cea7054339 100644 --- a/vendor/github.com/cilium/deepequal-gen/Makefile +++ b/vendor/github.com/cilium/deepequal-gen/Makefile @@ -18,7 +18,7 @@ test: vet @go build -o /tmp/$(TOOL) $(eval TMPDIR := $(shell mktemp -d)) PKGS=$$(go list ./output_tests/... | paste -sd' ' -); \ - /tmp/$(TOOL) --logtostderr --v=${LOGLEVEL} -i $$(echo $$PKGS | sed 's/ /,/g') -O zz_generated -h hack/boilerplate.txt --output-base $(TMPDIR) + /tmp/$(TOOL) --logtostderr --v=${LOGLEVEL} -O zz_generated.go -h hack/boilerplate.txt --output-base $(TMPDIR) $$PKGS cp -r "$(TMPDIR)/github.com/cilium/deepequal-gen/." ./ rm -rf "$(TMPDIR)" @if ! git diff --quiet HEAD; then \ diff --git a/vendor/github.com/cilium/deepequal-gen/args/args.go b/vendor/github.com/cilium/deepequal-gen/args/args.go new file mode 100644 index 0000000000000..82c1146577bc9 --- /dev/null +++ b/vendor/github.com/cilium/deepequal-gen/args/args.go @@ -0,0 +1,42 @@ +/* +SPDX-License-Identifier: Apache-2.0 +Copyright 2020 Isovalent, Inc. +*/ + +package args + +import ( + "fmt" + + "github.com/spf13/pflag" +) + +type Args struct { + OutputFile string + OutputBase string + BoundingDirs []string // Only deal with types rooted under these dirs. + GoHeaderFile string +} + +// New returns default arguments for the generator. +func New() *Args { + return &Args{} +} + +// AddFlags add the generator flags to the flag set. +func (args *Args) AddFlags(fs *pflag.FlagSet) { + fs.StringVarP(&args.OutputFile, "output-file", "O", "generated.deepequal.go", + "the name of the file to be generated") + fs.StringVarP(&args.OutputBase, "output-base", "o", args.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.") + fs.StringSliceVar(&args.BoundingDirs, "bounding-dirs", args.BoundingDirs, + "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") + fs.StringVarP(&args.GoHeaderFile, "go-header-file", "h", args.GoHeaderFile, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") +} + +// Validate checks the given arguments. +func (args *Args) Validate() error { + if len(args.OutputFile) == 0 { + return fmt.Errorf("--output-file must be specified") + } + return nil +} diff --git a/vendor/github.com/cilium/deepequal-gen/generators/deepequal.go b/vendor/github.com/cilium/deepequal-gen/generators/deepequal.go index 9f96e0a9d7d44..9456105d3c166 100644 --- a/vendor/github.com/cilium/deepequal-gen/generators/deepequal.go +++ b/vendor/github.com/cilium/deepequal-gen/generators/deepequal.go @@ -10,15 +10,16 @@ package generators import ( "fmt" "io" - "path/filepath" + "path" "strings" - "k8s.io/gengo/args" - "k8s.io/gengo/examples/set-gen/sets" - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" + "k8s.io/gengo/v2" + "k8s.io/gengo/v2/generator" + "k8s.io/gengo/v2/namer" + "k8s.io/gengo/v2/types" "k8s.io/klog/v2" + + "github.com/cilium/deepequal-gen/args" ) // CustomArgs is used tby the go2idl framework to pass args specific to this @@ -52,7 +53,7 @@ func extractEnabledTypeTag(t *types.Type) *enabledTagValue { } func extractEnabledTag(comments []string) *enabledTagValue { - tagVals := types.ExtractCommentTags("+", comments)[tagEnabledName] + tagVals := gengo.ExtractCommentTags("+", comments)[tagEnabledName] if tagVals == nil { // No match for the tag. return nil @@ -93,7 +94,7 @@ func extractEnabledTag(comments []string) *enabledTagValue { } func extractTag(tagName string, comments []string) *enabledTagValue { - tagVals := types.ExtractCommentTags("+", comments)[tagName] + tagVals := gengo.ExtractCommentTags("+", comments)[tagName] if tagVals == nil { // No match for the tag. return nil @@ -146,30 +147,27 @@ func DefaultNameSystem() string { return "public" } -func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { - boilerplate, err := arguments.LoadGoBoilerplate() +func GetTargets(context *generator.Context, args *args.Args) []generator.Target { + boilerplate, err := gengo.GoBoilerplate(args.GoHeaderFile, gengo.StdBuildTag, gengo.StdGeneratedBy) if err != nil { klog.Fatalf("Failed loading boilerplate: %v", err) } - inputs := sets.NewString(context.Inputs...) - packages := generator.Packages{} - header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) - - boundingDirs := make([]string, 0) - if customArgs, ok := arguments.CustomArgs.(*CustomArgs); ok { - if customArgs.BoundingDirs == nil { - customArgs.BoundingDirs = context.Inputs - } - for i := range customArgs.BoundingDirs { - // Strip any trailing slashes - they are not exactly "correct" but - // this is friendlier. - boundingDirs = append(boundingDirs, strings.TrimRight(customArgs.BoundingDirs[i], "/")) - } + boundingDirs := []string{} + if args.BoundingDirs == nil { + args.BoundingDirs = context.Inputs } + for i := range args.BoundingDirs { + // Strip any trailing slashes - they are not exactly "correct" but + // this is friendlier. + boundingDirs = append(boundingDirs, strings.TrimRight(args.BoundingDirs[i], "/")) + } + + targets := []generator.Target{} - for i := range inputs { + for _, i := range context.Inputs { klog.V(5).Infof("Considering pkg %q", i) + pkg := context.Universe[i] if pkg == nil { // If the input had no Go files, for example. @@ -215,7 +213,8 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if pkgNeedsGeneration { klog.V(3).Infof("Package %q needs generation", i) - path := pkg.Path + + p := pkg.Path // if the source path is within a /vendor/ directory (for example, // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow // generation to output to the proper relative path (under vendor). @@ -223,20 +222,22 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat // in the output directory. // TODO: build a more fundamental concept in gengo for dealing with modifications // to vendored packages. - if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { - expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) + if strings.HasPrefix(pkg.Dir, args.OutputBase) { + expandedPath := strings.TrimPrefix(pkg.Dir, args.OutputBase) if strings.Contains(expandedPath, "/vendor/") { - path = expandedPath + p = expandedPath } } - packages = append(packages, - &generator.DefaultPackage{ - PackageName: strings.Split(filepath.Base(pkg.Path), ".")[0], - PackagePath: path, - HeaderText: header, - GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + + targets = append(targets, + &generator.SimpleTarget{ + PkgName: strings.Split(path.Base(pkg.Path), ".")[0], + PkgPath: p, + PkgDir: path.Join(args.OutputBase, p), // output pkg is the same as the input + HeaderComment: boilerplate, + GeneratorsFunc: func(c *generator.Context) (generators []generator.Generator) { return []generator.Generator{ - NewGenDeepEqual(arguments.OutputFileBaseName, pkg.Path, boundingDirs, ptagValue == tagValuePackage, ptagRegister), + NewGenDeepEqual(args.OutputFile, pkg.Path, boundingDirs, ptagValue == tagValuePackage, ptagRegister), } }, FilterFunc: func(c *generator.Context, t *types.Type) bool { @@ -245,12 +246,12 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat }) } } - return packages + return targets } // genDeepEqual produces a file with autogenerated deep-copy functions. type genDeepEqual struct { - generator.DefaultGen + generator.GoGenerator targetPackage string boundingDirs []string allTypes bool @@ -258,10 +259,10 @@ type genDeepEqual struct { imports namer.ImportTracker } -func NewGenDeepEqual(sanitizedName, targetPackage string, boundingDirs []string, allTypes, registerTypes bool) generator.Generator { +func NewGenDeepEqual(outputFilename, targetPackage string, boundingDirs []string, allTypes, registerTypes bool) generator.Generator { return &genDeepEqual{ - DefaultGen: generator.DefaultGen{ - OptionalName: sanitizedName, + GoGenerator: generator.GoGenerator{ + OutputFilename: outputFilename, }, targetPackage: targetPackage, boundingDirs: boundingDirs, @@ -347,11 +348,11 @@ func deepEqualMethod(t *types.Type) (*types.Signature, error) { if len(f.Signature.Parameters) != 1 { return nil, fmt.Errorf("type %v: invalid %s signature, expected exactly one parameter", t, methodName) } - if len(f.Signature.Results) != 1 || f.Signature.Results[0].Name.Name != "bool" { + if len(f.Signature.Results) != 1 || f.Signature.Results[0].Type.Name.Name != "bool" { return nil, fmt.Errorf("type %v: invalid %s signature, expected bool result type", t, methodName) } - ptrParam := f.Signature.Parameters[0].Kind == types.Pointer && f.Signature.Parameters[0].Elem.Name == t.Name + ptrParam := f.Signature.Parameters[0].Type.Kind == types.Pointer && f.Signature.Parameters[0].Type.Elem.Name == t.Name if !ptrParam { return nil, fmt.Errorf("type %v: invalid %s signature, expected parameter of type *%s", t, methodName, t.Name.Name) @@ -808,11 +809,19 @@ func createFakeMethodEntries(pkg *types.Package, allTypes bool) { Kind: types.Pointer, Elem: &types.Type{Name: t.Name}, }, - Parameters: []*types.Type{{ - Kind: types.Pointer, - Elem: &types.Type{Name: t.Name}, - }}, - Results: []*types.Type{types.Bool}, + Parameters: []*types.ParamResult{ + { + Type: &types.Type{ + Kind: types.Pointer, + Elem: &types.Type{Name: t.Name}, + }, + }, + }, + Results: []*types.ParamResult{ + { + Type: types.Bool, + }, + }, CommentLines: []string{fakeCommentLine}, }, } diff --git a/vendor/github.com/cilium/deepequal-gen/main.go b/vendor/github.com/cilium/deepequal-gen/main.go index b7248f39984b3..7da1d4b9527b1 100644 --- a/vendor/github.com/cilium/deepequal-gen/main.go +++ b/vendor/github.com/cilium/deepequal-gen/main.go @@ -10,31 +10,40 @@ Copyright 2019 Wind River Systems, Inc. package main import ( + "flag" "github.com/spf13/pflag" - "k8s.io/gengo/args" + "k8s.io/gengo/v2" + "k8s.io/gengo/v2/generator" "k8s.io/klog/v2" + "github.com/cilium/deepequal-gen/args" "github.com/cilium/deepequal-gen/generators" ) func main() { klog.InitFlags(nil) - arguments := args.Default() + args := args.New() - // Override defaults. - arguments.OutputFileBaseName = "deepequal_generated" + args.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() - // Custom args. - customArgs := &generators.CustomArgs{} - pflag.CommandLine.StringSliceVar(&customArgs.BoundingDirs, "bounding-dirs", customArgs.BoundingDirs, - "Comma-separated list of import paths which bound the types for which deep-copies will be generated.") - arguments.CustomArgs = customArgs + if err := args.Validate(); err != nil { + klog.Fatalf("Error: %v", err) + } + + myTargets := func(context *generator.Context) []generator.Target { + return generators.GetTargets(context, args) + } // Run it. - if err := arguments.Execute( + if err := gengo.Execute( generators.NameSystems(), generators.DefaultNameSystem(), - generators.Packages, + myTargets, + gengo.StdBuildTag, + pflag.Args(), ); err != nil { klog.Fatalf("Error: %v", err) } diff --git a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go index 89f7ed4f02599..9b6aa7cec9f7d 100644 --- a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go +++ b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/applyconfiguration.go @@ -19,6 +19,7 @@ package generators import ( "io" "path" + "slices" "strings" "k8s.io/gengo/v2/generator" @@ -114,7 +115,7 @@ func (g *applyConfigurationGenerator) GenerateType(c *generator.Context, t *type sw.Do(constructor, typeParams) } } - g.generateWithFuncs(t, typeParams, sw, nil) + g.generateWithFuncs(t, typeParams, sw, nil, &[]string{}) g.generateGetters(t, typeParams, sw, nil) return sw.Error() } @@ -176,7 +177,8 @@ func (g *applyConfigurationGenerator) generateGetters(t *types.Type, typeParams } } -func (g *applyConfigurationGenerator) generateWithFuncs(t *types.Type, typeParams TypeParams, sw *generator.SnippetWriter, embed *memberParams) { +func (g *applyConfigurationGenerator) generateWithFuncs(t *types.Type, typeParams TypeParams, sw *generator.SnippetWriter, embed *memberParams, + generated *[]string) { for _, member := range t.Members { if blocklisted(t, member) { continue @@ -186,6 +188,11 @@ func (g *applyConfigurationGenerator) generateWithFuncs(t *types.Type, typeParam memberType = &types.Type{Kind: types.Pointer, Elem: memberType} } if jsonTags, ok := lookupJSONTags(member); ok { + if slices.Contains(*generated, member.Name) { + klog.V(5).Infof("With%s already generated on %s, skipping\n", member.Name, t.Name) + continue + } + *generated = append(*generated, member.Name) memberParams := memberParams{ TypeParams: typeParams, Member: member, @@ -194,7 +201,7 @@ func (g *applyConfigurationGenerator) generateWithFuncs(t *types.Type, typeParam EmbeddedIn: embed, } if memberParams.Member.Embedded { - g.generateWithFuncs(member.Type, typeParams, sw, &memberParams) + g.generateWithFuncs(member.Type, typeParams, sw, &memberParams, generated) if !jsonTags.inline { // non-inlined embeds are nillable and need a "ensure exists" utility function sw.Do(ensureEmbedExists, memberParams) @@ -281,9 +288,9 @@ func (g *applyConfigurationGenerator) generateMemberWith(sw *generator.SnippetWr sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) With$.Member.Name$(value $.MemberType|raw$) *$.ApplyConfig.ApplyConfiguration|public$ {\n", memberParams) g.ensureEmbedExistsIfApplicable(sw, memberParams) if g.refGraph.isApplyConfig(memberParams.Member.Type) || isNillable(memberParams.Member.Type) { - sw.Do("b.$.Member.Name$ = value\n", memberParams) + sw.Do("b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = value\n", memberParams) } else { - sw.Do("b.$.Member.Name$ = &value\n", memberParams) + sw.Do("b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = &value\n", memberParams) } sw.Do(" return b\n", memberParams) sw.Do("}\n", memberParams) @@ -297,7 +304,7 @@ func (g *applyConfigurationGenerator) generateMemberGetter(sw *generator.Snippet sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) Get$.Member.Name$() *$.MemberType|raw$ {\n", memberParams) } g.ensureEmbedExistsIfApplicable(sw, memberParams) - sw.Do(" return b.$.Member.Name$\n", memberParams) + sw.Do(" return b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$\n", memberParams) sw.Do("}\n", memberParams) } @@ -324,15 +331,15 @@ func (g *applyConfigurationGenerator) generateMemberWithForSlice(sw *generator.S sw.Do("}\n", memberParams) if memberIsPointerToSlice { - sw.Do("*b.$.Member.Name$ = append(*b.$.Member.Name$, *values[i])\n", memberParams) + sw.Do("*b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = append(*b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$, *values[i])\n", memberParams) } else { - sw.Do("b.$.Member.Name$ = append(b.$.Member.Name$, *values[i])\n", memberParams) + sw.Do("b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = append(b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$, *values[i])\n", memberParams) } } else { if memberIsPointerToSlice { - sw.Do("*b.$.Member.Name$ = append(*b.$.Member.Name$, values[i])\n", memberParams) + sw.Do("*b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = append(*b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$, values[i])\n", memberParams) } else { - sw.Do("b.$.Member.Name$ = append(b.$.Member.Name$, values[i])\n", memberParams) + sw.Do("b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = append(b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$, values[i])\n", memberParams) } } sw.Do(" }\n", memberParams) @@ -347,11 +354,11 @@ func (g *applyConfigurationGenerator) generateMemberWithForMap(sw *generator.Sni sw.Do("// overwriting an existing map entries in $.Member.Name$ field with the same key.\n", memberParams) sw.Do("func (b *$.ApplyConfig.ApplyConfiguration|public$) With$.Member.Name$(entries $.MemberType|raw$) *$.ApplyConfig.ApplyConfiguration|public$ {\n", memberParams) g.ensureEmbedExistsIfApplicable(sw, memberParams) - sw.Do(" if b.$.Member.Name$ == nil && len(entries) > 0 {\n", memberParams) - sw.Do(" b.$.Member.Name$ = make($.MemberType|raw$, len(entries))\n", memberParams) + sw.Do(" if b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ == nil && len(entries) > 0 {\n", memberParams) + sw.Do(" b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$ = make($.MemberType|raw$, len(entries))\n", memberParams) sw.Do(" }\n", memberParams) sw.Do(" for k, v := range entries {\n", memberParams) - sw.Do(" b.$.Member.Name$[k] = v\n", memberParams) + sw.Do(" b$if ne .EmbeddedIn nil$.$.EmbeddedIn.MemberType.Elem.Name.Name$$end$.$.Member.Name$[k] = v\n", memberParams) sw.Do(" }\n", memberParams) sw.Do(" return b\n", memberParams) sw.Do("}\n", memberParams) diff --git a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go index abd6501000742..f8d659e4338b0 100644 --- a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go +++ b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/internal.go @@ -74,6 +74,8 @@ func (g *internalGenerator) GenerateType(c *generator.Context, _ *types.Type, w "schemaYAML": string(schemaYAML), "smdParser": smdParser, "smdNewParser": smdNewParser, + "fmtSprintf": fmtSprintf, + "syncOnce": syncOnce, "yamlObject": yamlObject, "yamlUnmarshal": yamlUnmarshal, }) @@ -87,13 +89,13 @@ func Parser() *{{.smdParser|raw}} { var err error parser, err = {{.smdNewParser|raw}}(schemaYAML) if err != nil { - panic(fmt.Sprintf("Failed to parse schema: %v", err)) + panic({{.fmtSprintf|raw}}("Failed to parse schema: %v", err)) } }) return parser } -var parserOnce sync.Once +var parserOnce {{.syncOnce|raw}} var parser *{{.smdParser|raw}} var schemaYAML = {{.yamlObject|raw}}(` + "`{{.schemaYAML}}`" + `) ` diff --git a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/targets.go b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/targets.go index 197e932517936..b033d22d82961 100644 --- a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/targets.go +++ b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/targets.go @@ -188,7 +188,7 @@ func targetForApplyConfigurationsPackage(outputDirBase, outputPkgBase, pkgSubdir localPkg: outputPkg, groupVersion: gv, applyConfig: toGenerate, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), refGraph: refs, openAPIType: openAPIType, }) @@ -211,7 +211,7 @@ func targetForUtils(outputDirBase, outputPkgBase string, boilerplate []byte, gro OutputFilename: "utils.go", }, outputPackage: outputPkgBase, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkgBase), groupVersions: groupVersions, typesForGroupVersion: applyConfigsForGroupVersion, groupGoNames: groupGoNames, @@ -236,7 +236,7 @@ func targetForInternal(outputDirBase, outputPkgBase string, boilerplate []byte, OutputFilename: "internal.go", }, outputPackage: outputPkgBase, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), typeModels: models, }) return generators diff --git a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go index bc0b54d032873..95e6bb3455ad0 100644 --- a/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go +++ b/vendor/k8s.io/code-generator/cmd/applyconfiguration-gen/generators/types.go @@ -19,6 +19,8 @@ package generators import "k8s.io/gengo/v2/types" var ( + fmtSprintf = types.Ref("fmt", "Sprintf") + syncOnce = types.Ref("sync", "Once") applyConfiguration = types.Ref("k8s.io/apimachinery/pkg/runtime", "ApplyConfiguration") groupVersionKind = types.Ref("k8s.io/apimachinery/pkg/runtime/schema", "GroupVersionKind") typeMeta = types.Ref("k8s.io/apimachinery/pkg/apis/meta/v1", "TypeMeta") diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index 12a4afdbf945f..1fc21c224b566 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -161,7 +161,7 @@ func targetForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clie version: gv.Version.String(), groupGoName: groupGoName, typeToMatch: t, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(gvPkg), }) } @@ -177,7 +177,7 @@ func targetForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clie groupGoName: groupGoName, apiPath: apiPath, types: typeList, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(gvPkg), }) expansionFileName := "generated_expansion.go" @@ -214,7 +214,7 @@ func targetForClientset(args *args.Args, clientsetDir, clientsetPkg string, grou groups: args.Groups, groupGoNames: groupGoNames, clientsetPackage: clientsetPkg, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(clientsetPkg), }, } return generators @@ -260,7 +260,7 @@ NextGroup: OutputPath: schemeDir, Groups: args.Groups, GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), + ImportTracker: generator.NewImportTrackerForPackage(schemePkg), CreateRegistry: internalClient, }, } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go index 74c98232c5ca2..699c7b5f3c59d 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/fake_client_generator.go @@ -63,7 +63,7 @@ func TargetForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clie version: gv.Version.String(), groupGoName: groupGoName, typeToMatch: t, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), applyConfigurationPackage: applyBuilderPackage, }) } @@ -78,7 +78,7 @@ func TargetForGroup(gv clientgentypes.GroupVersion, typeList []*types.Type, clie version: gv.Version.String(), groupGoName: groupGoName, types: typeList, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), }) return generators }, @@ -111,7 +111,7 @@ func TargetForClientset(args *args.Args, clientsetDir, clientsetPkg string, appl groups: args.Groups, groupGoNames: groupGoNames, fakeClientsetPackage: clientsetPkg, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(clientsetPkg), realClientsetPackage: clientsetPkg, applyConfigurationPackage: applyConfigurationPkg, }, @@ -123,7 +123,7 @@ func TargetForClientset(args *args.Args, clientsetDir, clientsetPkg string, appl OutputPkg: clientsetPkg, Groups: args.Groups, GroupGoNames: groupGoNames, - ImportTracker: generator.NewImportTracker(), + ImportTracker: generator.NewImportTrackerForPackage(clientsetPkg), PrivateScheme: true, }, } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go index 3bf7aa12b9c64..ffb02ebba1e8c 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_clientset.go @@ -77,7 +77,6 @@ func (g *genClientset) Imports(c *generator.Context) (imports []string) { "fakediscovery \"k8s.io/client-go/discovery/fake\"", "k8s.io/apimachinery/pkg/runtime", "k8s.io/apimachinery/pkg/watch", - "k8s.io/apimachinery/pkg/api/meta/testrestmapper", ) return diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go index 20499cf8c1687..0e071af92267b 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -123,6 +123,8 @@ func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io. "ApplyPatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "ApplyPatchType"}), "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), + "fmtErrorf": c.Universe.Type(types.Name{Package: "fmt", Name: "Errorf"}), + "contextContext": c.Universe.Type(types.Name{Package: "context", Name: "Context"}), "NewRootListActionWithOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewRootListActionWithOptions"}), "NewListActionWithOptions": c.Universe.Function(types.Name{Package: pkgClientGoTesting, Name: "NewListActionWithOptions"}), @@ -332,7 +334,7 @@ var $.type|allLowercasePlural$Kind = $.SchemeGroupVersion|raw$.WithKind("$.type| var listTemplate = ` // List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { +func (c *Fake$.type|publicPlural$) List(ctx $.contextContext|raw$, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { emptyResult := &$.type|raw$List{} obj, err := c.Fake. $if .namespaced$Invokes($.NewListActionWithOptions|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), emptyResult) @@ -346,7 +348,7 @@ func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions| var listUsingOptionsTemplate = ` // List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { +func (c *Fake$.type|publicPlural$) List(ctx $.contextContext|raw$, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { emptyResult := &$.type|raw$List{} obj, err := c.Fake. $if .namespaced$Invokes($.NewListActionWithOptions|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), emptyResult) @@ -371,7 +373,7 @@ func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions| var getTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Get(ctx $.contextContext|raw$, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewGetActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, name, options), emptyResult) @@ -385,7 +387,7 @@ func (c *Fake$.type|publicPlural$) Get(ctx context.Context, name string, options var getSubresourceTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Get(ctx $.contextContext|raw$, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewGetSubresourceActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name, options), emptyResult) @@ -399,7 +401,7 @@ func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name var deleteTemplate = ` // Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { +func (c *Fake$.type|publicPlural$) Delete(ctx $.contextContext|raw$, name string, opts $.DeleteOptions|raw$) error { _, err := c.Fake. $if .namespaced$Invokes($.NewDeleteActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, name, opts), &$.type|raw${}) $else$Invokes($.NewRootDeleteActionWithOptions|raw$($.type|allLowercasePlural$Resource, name, opts), &$.type|raw${})$end$ @@ -409,7 +411,7 @@ func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. -func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { +func (c *Fake$.type|publicPlural$) DeleteCollection(ctx $.contextContext|raw$, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { $if .namespaced$action := $.NewDeleteCollectionActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, opts, listOpts) $else$action := $.NewRootDeleteCollectionActionWithOptions|raw$($.type|allLowercasePlural$Resource, opts, listOpts) $end$ @@ -419,7 +421,7 @@ func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $. ` var createTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Create(ctx $.contextContext|raw$, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewCreateActionWithOptions|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$, opts), emptyResult) @@ -433,7 +435,7 @@ func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.inputType|priva var createSubresourceTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Create(ctx $.contextContext|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewCreateSubresourceActionWithOptions|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", c.ns, $.inputType|private$, opts), emptyResult) @@ -447,7 +449,7 @@ func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.type|private$Na var updateTemplate = ` // Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Update(ctx $.contextContext|raw$, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateActionWithOptions|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$, opts), emptyResult) @@ -461,7 +463,7 @@ func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.inputType|priva var updateSubresourceTemplate = ` // Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Update(ctx $.contextContext|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateSubresourceActionWithOptions|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", c.ns, $.inputType|private$, opts), &$.inputType|raw${}) @@ -476,7 +478,7 @@ func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.type|private$Na var updateStatusTemplate = ` // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *Fake$.type|publicPlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (result *$.type|raw$, err error) { +func (c *Fake$.type|publicPlural$) UpdateStatus(ctx $.contextContext|raw$, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (result *$.type|raw$, err error) { emptyResult := &$.type|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateSubresourceActionWithOptions|raw$($.type|allLowercasePlural$Resource, "status", c.ns, $.type|private$, opts), emptyResult) @@ -490,7 +492,7 @@ func (c *Fake$.type|publicPlural$) UpdateStatus(ctx context.Context, $.type|priv var watchTemplate = ` // Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *Fake$.type|publicPlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { +func (c *Fake$.type|publicPlural$) Watch(ctx $.contextContext|raw$, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { return c.Fake. $if .namespaced$InvokesWatch($.NewWatchActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, opts)) $else$InvokesWatch($.NewRootWatchActionWithOptions|raw$($.type|allLowercasePlural$Resource, opts))$end$ @@ -499,7 +501,7 @@ func (c *Fake$.type|publicPlural$) Watch(ctx context.Context, opts $.ListOptions var patchTemplate = ` // Patch applies the patch and returns the patched $.resultType|private$. -func (c *Fake$.type|publicPlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Patch(ctx $.contextContext|raw$, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { emptyResult := &$.resultType|raw${} obj, err := c.Fake. $if .namespaced$Invokes($.NewPatchSubresourceActionWithOptions|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, opts, subresources... ), emptyResult) @@ -513,9 +515,9 @@ func (c *Fake$.type|publicPlural$) Patch(ctx context.Context, name string, pt $. var applyTemplate = ` // Apply takes the given apply declarative configuration, applies it and returns the applied $.resultType|private$. -func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Apply(ctx $.contextContext|raw$, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") + return nil, $.fmtErrorf|raw$("$.inputType|private$ provided to Apply must not be nil") } data, err := $.jsonMarshal|raw$($.inputType|private$) if err != nil { @@ -523,7 +525,7 @@ func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.inputType|privat } name := $.inputType|private$.Name if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") + return nil, $.fmtErrorf|raw$("$.inputType|private$.Name must be provided to Apply") } emptyResult := &$.resultType|raw${} obj, err := c.Fake. @@ -539,9 +541,9 @@ func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.inputType|privat var applyStatusTemplate = ` // ApplyStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -func (c *Fake$.type|publicPlural$) ApplyStatus(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) ApplyStatus(ctx $.contextContext|raw$, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") + return nil, $.fmtErrorf|raw$("$.inputType|private$ provided to Apply must not be nil") } data, err := $.jsonMarshal|raw$($.inputType|private$) if err != nil { @@ -549,7 +551,7 @@ func (c *Fake$.type|publicPlural$) ApplyStatus(ctx context.Context, $.inputType| } name := $.inputType|private$.Name if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") + return nil, $.fmtErrorf|raw$("$.inputType|private$.Name must be provided to Apply") } emptyResult := &$.resultType|raw${} obj, err := c.Fake. @@ -565,9 +567,9 @@ func (c *Fake$.type|publicPlural$) ApplyStatus(ctx context.Context, $.inputType| var applySubresourceTemplate = ` // Apply takes top resource name and the apply declarative configuration for $.subresourcePath$, // applies it and returns the applied $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Apply(ctx $.contextContext|raw$, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") + return nil, $.fmtErrorf|raw$("$.inputType|private$ provided to Apply must not be nil") } data, err := $.jsonMarshal|raw$($.inputType|private$) if err != nil { diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go index 0c043cee9e8ae..e84205604dbcf 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -73,12 +73,14 @@ func (g *genClientset) GenerateType(c *generator.Context, t *types.Type, w io.Wr allGroups := clientgentypes.ToGroupVersionInfo(g.groups, g.groupGoNames) m := map[string]interface{}{ "allGroups": allGroups, + "fmtErrorf": c.Universe.Type(types.Name{Package: "fmt", Name: "Errorf"}), "Config": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), "DefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), "RESTHTTPClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "HTTPClientFor"}), "DiscoveryInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryInterface"}), "DiscoveryClient": c.Universe.Type(types.Name{Package: "k8s.io/client-go/discovery", Name: "DiscoveryClient"}), + "httpClient": c.Universe.Type(types.Name{Package: "net/http", Name: "Client"}), "NewDiscoveryClientForConfigAndClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigAndClient"}), "NewDiscoveryClientForConfigOrDie": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClientForConfigOrDie"}), "NewDiscoveryClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/discovery", Name: "NewDiscoveryClient"}), @@ -160,11 +162,11 @@ var newClientsetForConfigAndClientTemplate = ` // Note the http client provided takes precedence over the configured transport values. // If config's RateLimiter is not set and QPS and Burst are acceptable, // NewForConfigAndClient will generate a rate-limiter in configShallowCopy. -func NewForConfigAndClient(c *$.Config|raw$, httpClient *http.Client) (*Clientset, error) { +func NewForConfigAndClient(c *$.Config|raw$, httpClient *$.httpClient|raw$) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + return nil, $.fmtErrorf|raw$("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = $.flowcontrolNewTokenBucketRateLimiter|raw$(configShallowCopy.QPS, configShallowCopy.Burst) } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go index 83b13b11cdcc1..e5915b67724f5 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_group.go @@ -64,7 +64,6 @@ func (g *genGroup) Namers(c *generator.Context) namer.NameSystems { func (g *genGroup) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, path.Join(g.clientsetPackage, "scheme")) return } @@ -82,23 +81,27 @@ func (g *genGroup) GenerateType(c *generator.Context, t *types.Type, w io.Writer if groupName == "" { apiPath = `"/api"` } - + schemePackage := path.Join(g.clientsetPackage, "scheme") m := map[string]interface{}{ - "version": g.version, - "groupName": groupName, - "GroupGoName": g.groupGoName, - "Version": namer.IC(g.version), - "types": g.types, - "apiPath": apiPath, - "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), - "runtimeAPIVersionInternal": c.Universe.Variable(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "APIVersionInternal"}), - "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), - "restDefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), - "restRESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), - "RESTHTTPClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "HTTPClientFor"}), - "restRESTClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientFor"}), - "restRESTClientForConfigAndClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientForConfigAndClient"}), - "SchemeGroupVersion": c.Universe.Variable(types.Name{Package: g.inputPackage, Name: "SchemeGroupVersion"}), + "version": g.version, + "groupName": groupName, + "GroupGoName": g.groupGoName, + "Version": namer.IC(g.version), + "types": g.types, + "apiPath": apiPath, + "httpClient": c.Universe.Type(types.Name{Package: "net/http", Name: "Client"}), + "schemaGroupVersion": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersion"}), + "runtimeAPIVersionInternal": c.Universe.Variable(types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "APIVersionInternal"}), + "restConfig": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Config"}), + "restDefaultKubernetesUserAgent": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "DefaultKubernetesUserAgent"}), + "restRESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), + "RESTHTTPClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "HTTPClientFor"}), + "restRESTClientFor": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientFor"}), + "restRESTClientForConfigAndClient": c.Universe.Function(types.Name{Package: "k8s.io/client-go/rest", Name: "RESTClientForConfigAndClient"}), + "SchemeGroupVersion": c.Universe.Variable(types.Name{Package: g.inputPackage, Name: "SchemeGroupVersion"}), + "SchemePrioritizedVersionsForGroup": c.Universe.Variable(types.Name{Package: schemePackage, Name: "Scheme.PrioritizedVersionsForGroup"}), + "Codecs": c.Universe.Variable(types.Name{Package: schemePackage, Name: "Codecs"}), + "CodecsWithoutConversion": c.Universe.Variable(types.Name{Package: schemePackage, Name: "Codecs.WithoutConversion"}), } sw.Do(groupInterfaceTemplate, m) sw.Do(groupClientTemplate, m) @@ -179,7 +182,7 @@ func NewForConfig(c *$.restConfig|raw$) (*$.GroupGoName$$.Version$Client, error) var newClientForConfigAndClientTemplate = ` // NewForConfigAndClient creates a new $.GroupGoName$$.Version$Client for the given config and http client. // Note the http client provided takes precedence over the configured transport values. -func NewForConfigAndClient(c *$.restConfig|raw$, h *http.Client) (*$.GroupGoName$$.Version$Client, error) { +func NewForConfigAndClient(c *$.restConfig|raw$, h *$.httpClient|raw$) (*$.GroupGoName$$.Version$Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -228,11 +231,11 @@ func setConfigDefaults(config *$.restConfig|raw$) error { if config.UserAgent == "" { config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() } - if config.GroupVersion == nil || config.GroupVersion.Group != scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0].Group { - gv := scheme.Scheme.PrioritizedVersionsForGroup("$.groupName$")[0] + if config.GroupVersion == nil || config.GroupVersion.Group != $.SchemePrioritizedVersionsForGroup|raw$("$.groupName$")[0].Group { + gv := $.SchemePrioritizedVersionsForGroup|raw$("$.groupName$")[0] config.GroupVersion = &gv } - config.NegotiatedSerializer = scheme.Codecs + config.NegotiatedSerializer = $.Codecs|raw$ if config.QPS == 0 { config.QPS = 5 @@ -250,7 +253,7 @@ func setConfigDefaults(config *$.restConfig|raw$) error { gv := $.SchemeGroupVersion|raw$ config.GroupVersion = &gv config.APIPath = $.apiPath$ - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = $.CodecsWithoutConversion|raw$() if config.UserAgent == "" { config.UserAgent = $.restDefaultKubernetesUserAgent|raw$() diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go index 7361c48f1f5bf..5e08292251db0 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go @@ -23,6 +23,7 @@ import ( "golang.org/x/text/cases" "golang.org/x/text/language" + "k8s.io/gengo/v2/generator" "k8s.io/gengo/v2/namer" "k8s.io/gengo/v2/types" @@ -140,6 +141,7 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i "ApplyOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ApplyOptions"}), "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), + "context": c.Universe.Type(types.Name{Package: "context", Name: "Context"}), }, } if e.HasVerb("apply") { @@ -172,6 +174,8 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), "schemeParameterCodec": c.Universe.Variable(types.Name{Package: path.Join(g.clientsetPackage, "scheme"), Name: "ParameterCodec"}), "jsonMarshal": c.Universe.Type(types.Name{Package: "encoding/json", Name: "Marshal"}), + "fmtErrorf": c.Universe.Type(types.Name{Package: "fmt", Name: "Errorf"}), + "context": c.Universe.Type(types.Name{Package: "context", Name: "Context"}), "resourceVersionMatchNotOlderThan": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ResourceVersionMatchNotOlderThan"}), "CheckListFromCacheDataConsistencyIfRequested": c.Universe.Function(types.Name{Package: "k8s.io/client-go/util/consistencydetector", Name: "CheckListFromCacheDataConsistencyIfRequested"}), "CheckWatchListFromCacheDataConsistencyIfRequested": c.Universe.Function(types.Name{Package: "k8s.io/client-go/util/consistencydetector", Name: "CheckWatchListFromCacheDataConsistencyIfRequested"}), @@ -267,64 +271,65 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i m["inputType"] = &inputType m["resultType"] = &resultType m["subresourcePath"] = e.SubResourcePath + m["verb"] = e.VerbName if e.HasVerb("apply") { m["inputApplyConfig"] = types.Ref(path.Join(g.applyConfigurationPackage, inputGVString), inputType.Name.Name+"ApplyConfiguration") } if e.HasVerb("get") { if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getSubresourceTemplate), m) + sw.Do(getSubresourceTemplate, m) } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, getTemplate), m) + sw.Do(getTemplate, m) } } if e.HasVerb("list") { if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listSubresourceTemplate), m) + sw.Do(listSubresourceTemplate, m) } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, listTemplate), m) - sw.Do(adjustTemplate(e.VerbName, e.VerbType, privateListTemplate), m) - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchListTemplate), m) + sw.Do(listTemplate, m) + sw.Do(privateListTemplate, m) + sw.Do(watchListTemplate, m) } } // TODO: Figure out schemantic for watching a sub-resource. if e.HasVerb("watch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, watchTemplate), m) + sw.Do(watchTemplate, m) } if e.HasVerb("create") { if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createSubresourceTemplate), m) + sw.Do(createSubresourceTemplate, m) } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, createTemplate), m) + sw.Do(createTemplate, m) } } if e.HasVerb("update") { if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateSubresourceTemplate), m) + sw.Do(updateSubresourceTemplate, m) } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, updateTemplate), m) + sw.Do(updateTemplate, m) } } // TODO: Figure out schemantic for deleting a sub-resource (what arguments // are passed, does it need two names? etc. if e.HasVerb("delete") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, deleteTemplate), m) + sw.Do(deleteTemplate, m) } if e.HasVerb("patch") { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, patchTemplate), m) + sw.Do(patchTemplate, m) } if e.HasVerb("apply") { if e.IsSubresource() { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applySubresourceTemplate), m) + sw.Do(applySubresourceTemplate, m) } else { - sw.Do(adjustTemplate(e.VerbName, e.VerbType, applyTemplate), m) + sw.Do(applyTemplate, m) } } } @@ -332,13 +337,6 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i return sw.Error() } -// adjustTemplate adjust the origin verb template using the expansion name. -// TODO: Make the verbs in templates parametrized so the strings.Replace() is -// not needed. -func adjustTemplate(name, verbType, template string) string { - return strings.ReplaceAll(template, " "+titler.String(verbType), " "+name) -} - func generateInterface(defaultVerbTemplates map[string]string, tags util.Tags) string { // need an ordered list here to guarantee order of generated methods. out := []string{} @@ -352,34 +350,34 @@ func generateInterface(defaultVerbTemplates map[string]string, tags util.Tags) s func buildSubresourceDefaultVerbTemplates(generateApply bool) map[string]string { m := map[string]string{ - "create": `Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "update": `Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, - "get": `Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, + "create": `Create(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx $.context|raw$, $.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "update": `Update(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "get": `Get(ctx $.context|raw$, $.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, } if generateApply { - m["apply"] = `Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (*$.resultType|raw$, error)` + m["apply"] = `Apply(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (*$.resultType|raw$, error)` } return m } func buildDefaultVerbTemplates(generateApply bool) map[string]string { m := map[string]string{ - "create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, - "update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "create": `Create(ctx $.context|raw$, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "update": `Update(ctx $.context|raw$, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, "updateStatus": `// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, - "delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`, - "deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, - "get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, - "patch": `Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error)`, +UpdateStatus(ctx $.context|raw$, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, + "delete": `Delete(ctx $.context|raw$, name string, opts $.DeleteOptions|raw$) error`, + "deleteCollection": `DeleteCollection(ctx $.context|raw$, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, + "get": `Get(ctx $.context|raw$, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx $.context|raw$, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "watch": `Watch(ctx $.context|raw$, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, + "patch": `Patch(ctx $.context|raw$, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error)`, } if generateApply { - m["apply"] = `Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` + m["apply"] = `Apply(ctx $.context|raw$, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` m["applyStatus"] = `// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). -ApplyStatus(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` +ApplyStatus(ctx $.context|raw$, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error)` } return m } @@ -579,8 +577,8 @@ var newStruct = []string{ } var listTemplate = ` -// List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error) { +// $.verb$ takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, opts $.ListOptions|raw$) (*$.resultType|raw$List, error) { if watchListOptions, hasWatchListOptionsPrepared, watchListOptionsErr := $.PrepareWatchListOptionsFromListOptions|raw$(opts); watchListOptionsErr != nil { klog.Warningf("Failed preparing watchlist options for $.type|resource$, falling back to the standard LIST semantics, err = %v", watchListOptionsErr ) } else if hasWatchListOptionsPrepared { @@ -601,7 +599,7 @@ func (c *$.type|privatePlural$) List(ctx context.Context, opts $.ListOptions|raw var privateListTemplate = ` // list takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) list(ctx context.Context, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { +func (c *$.type|privatePlural$) list(ctx $.context|raw$, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -619,8 +617,8 @@ func (c *$.type|privatePlural$) list(ctx context.Context, opts $.ListOptions|raw ` var listSubresourceTemplate = ` -// List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { +// $.verb$ takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -640,8 +638,8 @@ func (c *$.type|privatePlural$) List(ctx context.Context, $.type|private$Name st ` var getTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Get(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -655,8 +653,8 @@ func (c *$.type|privatePlural$) Get(ctx context.Context, name string, options $. ` var getSubresourceTemplate = ` -// Get takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Get(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -671,8 +669,8 @@ func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name str ` var deleteTemplate = ` -// Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { +// $.verb$ takes name of the $.type|private$ and deletes it. Returns an error if one occurs. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, name string, opts $.DeleteOptions|raw$) error { return c.GetClient().Delete(). $if .namespaced$Namespace(c.GetNamespace()).$end$ Resource("$.type|resource$"). @@ -684,8 +682,8 @@ func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $. ` var createSubresourceTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Post(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -701,8 +699,8 @@ func (c *$.type|privatePlural$) Create(ctx context.Context, $.type|private$Name ` var createTemplate = ` -// Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Post(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -716,8 +714,8 @@ func (c *$.type|privatePlural$) Create(ctx context.Context, $.inputType|private$ ` var updateSubresourceTemplate = ` -// Update takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Put(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -733,8 +731,8 @@ func (c *$.type|privatePlural$) Update(ctx context.Context, $.type|private$Name ` var updateTemplate = ` -// Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Put(). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -749,8 +747,8 @@ func (c *$.type|privatePlural$) Update(ctx context.Context, $.inputType|private$ ` var watchTemplate = ` -// Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *$.type|privatePlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { +// $.verb$ returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -766,7 +764,7 @@ func (c *$.type|privatePlural$) Watch(ctx context.Context, opts $.ListOptions|ra var watchListTemplate = ` // watchList establishes a watch stream with the server and returns the list of $.resultType|publicPlural$ -func (c *$.type|privatePlural$) watchList(ctx context.Context, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { +func (c *$.type|privatePlural$) watchList(ctx $.context|raw$, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -784,8 +782,8 @@ func (c *$.type|privatePlural$) watchList(ctx context.Context, opts $.ListOption ` var patchTemplate = ` -// Patch applies the patch and returns the patched $.resultType|private$. -func (c *$.type|privatePlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { +// $.verb$ applies the patch and returns the patched $.resultType|private$. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.GetClient().Patch(pt). $if .namespaced$Namespace(c.GetNamespace()).$end$ @@ -801,10 +799,10 @@ func (c *$.type|privatePlural$) Patch(ctx context.Context, name string, pt $.Pat ` var applyTemplate = ` -// Apply takes the given apply declarative configuration, applies it and returns the applied $.resultType|private$. -func (c *$.type|privatePlural$) Apply(ctx context.Context, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { +// $.verb$ takes the given apply declarative configuration, applies it and returns the applied $.resultType|private$. +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") + return nil, $.fmtErrorf|raw$("$.inputType|private$ provided to $.verb$ must not be nil") } patchOpts := opts.ToPatchOptions() data, err := $.jsonMarshal|raw$($.inputType|private$) @@ -813,7 +811,7 @@ func (c *$.type|privatePlural$) Apply(ctx context.Context, $.inputType|private$ } name := $.inputType|private$.Name if name == nil { - return nil, fmt.Errorf("$.inputType|private$.Name must be provided to Apply") + return nil, $.fmtErrorf|raw$("$.inputType|private$.Name must be provided to $.verb$") } result = &$.resultType|raw${} err = c.GetClient().Patch($.ApplyPatchType|raw$). @@ -829,11 +827,11 @@ func (c *$.type|privatePlural$) Apply(ctx context.Context, $.inputType|private$ ` var applySubresourceTemplate = ` -// Apply takes top resource name and the apply declarative configuration for $.subresourcePath$, +// $.verb$ takes top resource name and the apply declarative configuration for $.subresourcePath$, // applies it and returns the applied $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Apply(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) $.verb$(ctx $.context|raw$, $.type|private$Name string, $.inputType|private$ *$.inputApplyConfig|raw$, opts $.ApplyOptions|raw$) (result *$.resultType|raw$, err error) { if $.inputType|private$ == nil { - return nil, fmt.Errorf("$.inputType|private$ provided to Apply must not be nil") + return nil, $.fmtErrorf|raw$("$.inputType|private$ provided to $.verb$ must not be nil") } patchOpts := opts.ToPatchOptions() data, err := $.jsonMarshal|raw$($.inputType|private$) diff --git a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go index f58130af255a4..b1ac8209a5666 100644 --- a/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go +++ b/vendor/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go @@ -158,16 +158,16 @@ func getManualConversionFunctions(context *generator.Context, pkg *types.Package klog.V(6).Infof("%s has a receiver", f.Name) continue } - if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { + if len(signature.Parameters) != 3 || signature.Parameters[2].Type.Name != scopeName { klog.V(6).Infof("%s has wrong parameters", f.Name) continue } - if len(signature.Results) != 1 || signature.Results[0].Name != errorName { + if len(signature.Results) != 1 || signature.Results[0].Type.Name != errorName { klog.V(6).Infof("%s has wrong results", f.Name) continue } - inType := signature.Parameters[0] - outType := signature.Parameters[1] + inType := signature.Parameters[0].Type + outType := signature.Parameters[1].Type if inType.Kind != types.Pointer || outType.Kind != types.Pointer { klog.V(6).Infof("%s has wrong parameter types", f.Name) continue @@ -478,7 +478,7 @@ func NewGenConversion(outputFilename, typesPackage, outputPackage string, manual outputPackage: outputPackage, peerPackages: peerPkgs, manualConversions: manualConversions, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPackage), types: []*types.Type{}, explicitConversions: []conversionPair{}, skippedFields: map[*types.Type][]string{}, diff --git a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/generators/deepcopy.go b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/generators/deepcopy.go index c6047aacae034..e1a8e4c166ac8 100644 --- a/vendor/k8s.io/code-generator/cmd/deepcopy-gen/generators/deepcopy.go +++ b/vendor/k8s.io/code-generator/cmd/deepcopy-gen/generators/deepcopy.go @@ -222,7 +222,7 @@ func NewGenDeepCopy(outputFilename, targetPackage string, boundingDirs []string, boundingDirs: boundingDirs, allTypes: allTypes, registerTypes: registerTypes, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(targetPackage), typesForInit: make([]*types.Type, 0), } } @@ -277,8 +277,8 @@ func deepCopyMethod(t *types.Type) (*types.Signature, error) { return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected exactly one result", t) } - ptrResult := f.Signature.Results[0].Kind == types.Pointer && f.Signature.Results[0].Elem.Name == t.Name - nonPtrResult := f.Signature.Results[0].Name == t.Name + ptrResult := f.Signature.Results[0].Type.Kind == types.Pointer && f.Signature.Results[0].Type.Elem.Name == t.Name + nonPtrResult := f.Signature.Results[0].Type.Name == t.Name if !ptrResult && !nonPtrResult { return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected to return %s or *%s", t, t.Name.Name, t.Name.Name) @@ -329,7 +329,7 @@ func deepCopyIntoMethod(t *types.Type) (*types.Signature, error) { return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected no result type", t) } - ptrParam := f.Signature.Parameters[0].Kind == types.Pointer && f.Signature.Parameters[0].Elem.Name == t.Name + ptrParam := f.Signature.Parameters[0].Type.Kind == types.Pointer && f.Signature.Parameters[0].Type.Elem.Name == t.Name if !ptrParam { return nil, fmt.Errorf("type %v: invalid DeepCopy signature, expected parameter of type *%s", t, t.Name.Name) @@ -696,7 +696,7 @@ func (g *genDeepCopy) doMap(t *types.Type, sw *generator.SnippetWriter) { leftPointer := ut.Elem.Kind == types.Pointer rightPointer := !isReference(ut.Elem) if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer + rightPointer = dc.Results[0].Type.Kind == types.Pointer } if leftPointer == rightPointer { sw.Do("(*out)[key] = val.DeepCopy()\n", nil) @@ -812,7 +812,7 @@ func (g *genDeepCopy) doStruct(t *types.Type, sw *generator.SnippetWriter) { leftPointer := ft.Kind == types.Pointer rightPointer := !isReference(ft) if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer + rightPointer = dc.Results[0].Type.Kind == types.Pointer } if leftPointer == rightPointer { sw.Do("out.$.name$ = in.$.name$.DeepCopy()\n", args) @@ -866,7 +866,7 @@ func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) { case dc != nil || dci != nil: rightPointer := !isReference(ut.Elem) if dc != nil { - rightPointer = dc.Results[0].Kind == types.Pointer + rightPointer = dc.Results[0].Type.Kind == types.Pointer } if rightPointer { sw.Do("*out = (*in).DeepCopy()\n", nil) diff --git a/vendor/k8s.io/code-generator/cmd/defaulter-gen/generators/defaulter.go b/vendor/k8s.io/code-generator/cmd/defaulter-gen/generators/defaulter.go index 64b9ff29998b8..f7a6864c745e8 100644 --- a/vendor/k8s.io/code-generator/cmd/defaulter-gen/generators/defaulter.go +++ b/vendor/k8s.io/code-generator/cmd/defaulter-gen/generators/defaulter.go @@ -165,7 +165,7 @@ func getManualDefaultingFunctions(context *generator.Context, pkg *types.Package if len(signature.Results) != 0 { continue } - inType := signature.Parameters[0] + inType := signature.Parameters[0].Type if inType.Kind != types.Pointer { continue } @@ -823,7 +823,7 @@ func (g *genDefaulter) GenerateType(c *generator.Context, t *types.Type, w io.Wr }) sw := generator.NewSnippetWriter(w, c, "$", "$") - g.generateDefaulter(t, callTree, sw) + g.generateDefaulter(c, t, callTree, sw) return sw.Error() } @@ -833,9 +833,9 @@ func defaultingArgsFromType(inType *types.Type) generator.Args { } } -func (g *genDefaulter) generateDefaulter(inType *types.Type, callTree *callNode, sw *generator.SnippetWriter) { +func (g *genDefaulter) generateDefaulter(c *generator.Context, inType *types.Type, callTree *callNode, sw *generator.SnippetWriter) { sw.Do("func $.inType|objectdefaultfn$(in *$.inType|raw$) {\n", defaultingArgsFromType(inType)) - callTree.WriteMethod("in", 0, nil, sw) + callTree.WriteMethod(c, "in", 0, nil, sw) sw.Do("}\n\n", nil) } @@ -996,15 +996,19 @@ func getTypeZeroValue(t string) (interface{}, error) { return defaultZero, nil } -func (n *callNode) writeDefaulter(varName string, index string, isVarPointer bool, sw *generator.SnippetWriter) { +func (n *callNode) writeDefaulter(c *generator.Context, varName string, index string, isVarPointer bool, sw *generator.SnippetWriter) { if n.defaultValue.IsEmpty() { return } + + jsonUnmarshalType := c.Universe.Type(types.Name{Package: "encoding/json", Name: "Unmarshal"}) + args := generator.Args{ - "defaultValue": n.defaultValue.Resolved(), - "varName": varName, - "index": index, - "varTopType": n.defaultTopLevelType, + "defaultValue": n.defaultValue.Resolved(), + "varName": varName, + "index": index, + "varTopType": n.defaultTopLevelType, + "jsonUnmarshal": jsonUnmarshalType, } variablePlaceholder := "" @@ -1101,13 +1105,13 @@ func (n *callNode) writeDefaulter(varName string, index string, isVarPointer boo // This applies to maps with non-primitive values (eg: map[string]SubStruct) if n.key { sw.Do("$.mapDefaultVar$ := $.varName$[$.index$]\n", args) - sw.Do("if err := json.Unmarshal([]byte(`$.defaultValue$`), &$.mapDefaultVar$); err != nil {\n", args) + sw.Do("if err := $.jsonUnmarshal|raw$([]byte(`$.defaultValue$`), &$.mapDefaultVar$); err != nil {\n", args) } else { variablePointer := variablePlaceholder if !isVarPointer { variablePointer = "&" + variablePointer } - sw.Do(fmt.Sprintf("if err := json.Unmarshal([]byte(`$.defaultValue$`), %s); err != nil {\n", variablePointer), args) + sw.Do(fmt.Sprintf("if err := $.jsonUnmarshal|raw$([]byte(`$.defaultValue$`), %s); err != nil {\n", variablePointer), args) } sw.Do("panic(err)\n", nil) sw.Do("}\n", nil) @@ -1121,7 +1125,7 @@ func (n *callNode) writeDefaulter(varName string, index string, isVarPointer boo // WriteMethod performs an in-order traversal of the calltree, generating loops and if blocks as necessary // to correctly turn the call tree into a method body that invokes all calls on all child nodes of the call tree. // Depth is used to generate local variables at the proper depth. -func (n *callNode) WriteMethod(varName string, depth int, ancestors []*callNode, sw *generator.SnippetWriter) { +func (n *callNode) WriteMethod(c *generator.Context, varName string, depth int, ancestors []*callNode, sw *generator.SnippetWriter) { // if len(n.call) > 0 { // sw.Do(fmt.Sprintf("// %s\n", callPath(append(ancestors, n)).String()), nil) // } @@ -1153,10 +1157,10 @@ func (n *callNode) WriteMethod(varName string, depth int, ancestors []*callNode, } } - n.writeDefaulter(varName, index, isPointer, sw) + n.writeDefaulter(c, varName, index, isPointer, sw) n.writeCalls(local, true, sw) for i := range n.children { - n.children[i].WriteMethod(local, depth+1, append(ancestors, n), sw) + n.children[i].WriteMethod(c, local, depth+1, append(ancestors, n), sw) } sw.Do("}\n", nil) case n.key: @@ -1165,14 +1169,14 @@ func (n *callNode) WriteMethod(varName string, depth int, ancestors []*callNode, index = index + "_" + ancestors[len(ancestors)-1].field vars["index"] = index sw.Do("for $.index$ := range $.var$ {\n", vars) - n.writeDefaulter(varName, index, isPointer, sw) + n.writeDefaulter(c, varName, index, isPointer, sw) sw.Do("}\n", nil) } default: - n.writeDefaulter(varName, index, isPointer, sw) + n.writeDefaulter(c, varName, index, isPointer, sw) n.writeCalls(varName, isPointer, sw) for i := range n.children { - n.children[i].WriteMethod(varName, depth, append(ancestors, n), sw) + n.children[i].WriteMethod(c, varName, depth, append(ancestors, n), sw) } } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go index d8e8873aab68a..e863b1d2fde4f 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go @@ -61,7 +61,6 @@ func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems { func (g *genericGenerator) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "fmt") return } @@ -127,6 +126,7 @@ func (g *genericGenerator) GenerateType(c *generator.Context, t *types.Type, w i "cacheGenericLister": c.Universe.Type(cacheGenericLister), "cacheNewGenericLister": c.Universe.Function(cacheNewGenericLister), "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), + "fmtErrorf": c.Universe.Type(fmtErrorfFunc), "groups": groups, "schemeGVs": schemeGVs, "schemaGroupResource": c.Universe.Type(schemaGroupResource), @@ -179,6 +179,6 @@ func (f *sharedInformerFactory) ForResource(resource {{.schemaGroupVersionResour {{end -}} } - return nil, fmt.Errorf("no informer found for %v", resource) + return nil, {{.fmtErrorf|raw}}("no informer found for %v", resource) } ` diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go index 9d786ea07d6a7..4034695ddf0f5 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go @@ -86,6 +86,7 @@ func (g *informerGenerator) GenerateType(c *generator.Context, t *types.Type, w "cacheNewSharedIndexInformer": c.Universe.Function(cacheNewSharedIndexInformer), "cacheSharedIndexInformer": c.Universe.Type(cacheSharedIndexInformer), "clientSetInterface": clientSetInterface, + "contextTODO": c.Universe.Type(contextTODOFunc), "group": namer.IC(g.groupGoName), "informerFor": informerFor, "interfacesTweakListOptionsFunc": c.Universe.Type(types.Name{Package: g.internalInterfacesPackage, Name: "TweakListOptionsFunc"}), @@ -151,13 +152,13 @@ func NewFiltered$.type|public$Informer(client $.clientSetInterface|raw$$if .name if tweakListOptions != nil { tweakListOptions(&options) } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(context.TODO(), options) + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List($.contextTODO|raw$(), options) }, WatchFunc: func(options $.v1ListOptions|raw$) ($.watchInterface|raw$, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(context.TODO(), options) + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch($.contextTODO|raw$(), options) }, }, &$.type|raw${}, diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/targets.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/targets.go index 65dc89d0385d7..2e886d4e00c57 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/targets.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/targets.go @@ -249,7 +249,7 @@ func factoryTarget(outputDirBase, outputPkgBase string, boilerplate []byte, grou OutputFilename: "factory.go", }, outputPackage: outputPkgBase, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkgBase), groupVersions: groupVersions, clientSetPackage: clientSetPackage, internalInterfacesPackage: path.Join(outputPkgBase, subdirForInternalInterfaces), @@ -261,7 +261,7 @@ func factoryTarget(outputDirBase, outputPkgBase string, boilerplate []byte, grou OutputFilename: "generic.go", }, outputPackage: outputPkgBase, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkgBase), groupVersions: groupVersions, pluralExceptions: pluralExceptions, typesForGroupVersion: typesForGroupVersion, @@ -288,7 +288,7 @@ func factoryInterfaceTarget(outputDirBase, outputPkgBase string, boilerplate []b OutputFilename: "factory_interfaces.go", }, outputPackage: outputPkg, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), clientSetPackage: clientSetPackage, }) @@ -314,7 +314,7 @@ func groupTarget(outputDirBase, outputPackageBase string, groupVersions clientge }, outputPackage: outputPkg, groupVersions: groupVersions, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), internalInterfacesPackage: path.Join(outputPackageBase, subdirForInternalInterfaces), }) return generators @@ -342,7 +342,7 @@ func versionTarget(outputDirBase, outputPkgBase string, groupPkgName string, gv OutputFilename: "interface.go", }, outputPackage: outputPkg, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), types: typesToGenerate, internalInterfacesPackage: path.Join(outputPkgBase, subdirForInternalInterfaces), }) @@ -357,7 +357,7 @@ func versionTarget(outputDirBase, outputPkgBase string, groupPkgName string, gv groupVersion: gv, groupGoName: groupGoName, typeToGenerate: t, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), clientSetPackage: clientSetPackage, listersPackage: listersPackage, internalInterfacesPackage: path.Join(outputPkgBase, subdirForInternalInterfaces), diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go index 4ca511ea4ed4b..b717adfd3ec53 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/types.go @@ -29,6 +29,8 @@ var ( cacheNewSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "NewSharedIndexInformer"} cacheSharedIndexInformer = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "SharedIndexInformer"} cacheTransformFunc = types.Name{Package: "k8s.io/client-go/tools/cache", Name: "TransformFunc"} + contextTODOFunc = types.Name{Package: "context", Name: "TODO"} + fmtErrorfFunc = types.Name{Package: "fmt", Name: "Errorf"} listOptions = types.Name{Package: "k8s.io/kubernetes/pkg/apis/core", Name: "ListOptions"} reflectType = types.Name{Package: "reflect", Name: "Type"} runtimeObject = types.Name{Package: "k8s.io/apimachinery/pkg/runtime", Name: "Object"} diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go index 8955e076f6c5d..a5beb2a7f18d2 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go @@ -149,7 +149,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target groupVersion: gv, internalGVPkg: internalGVPkg, typeToGenerate: t, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(outputPkg), objectMeta: objectMeta, }) } @@ -213,11 +213,6 @@ func (g *listerGenerator) Namers(c *generator.Context) namer.NameSystems { func (g *listerGenerator) Imports(c *generator.Context) (imports []string) { imports = append(imports, g.imports.ImportLines()...) - imports = append(imports, "k8s.io/apimachinery/pkg/api/errors") - imports = append(imports, "k8s.io/apimachinery/pkg/labels") - imports = append(imports, "k8s.io/client-go/listers") - // for Indexer - imports = append(imports, "k8s.io/client-go/tools/cache") return } @@ -226,9 +221,14 @@ func (g *listerGenerator) GenerateType(c *generator.Context, t *types.Type, w io klog.V(5).Infof("processing type %v", t) m := map[string]interface{}{ - "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), - "type": t, - "objectMeta": g.objectMeta, + "Resource": c.Universe.Function(types.Name{Package: t.Name.Package, Name: "Resource"}), + "labelsSelector": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/labels", Name: "Selector"}), + "listersResourceIndexer": c.Universe.Function(types.Name{Package: "k8s.io/client-go/listers", Name: "ResourceIndexer"}), + "listersNew": c.Universe.Function(types.Name{Package: "k8s.io/client-go/listers", Name: "New"}), + "listersNewNamespaced": c.Universe.Function(types.Name{Package: "k8s.io/client-go/listers", Name: "NewNamespaced"}), + "cacheIndexer": c.Universe.Type(types.Name{Package: "k8s.io/client-go/tools/cache", Name: "Indexer"}), + "type": t, + "objectMeta": g.objectMeta, } tags, err := util.ParseClientGenTags(append(t.SecondClosestCommentLines, t.CommentLines...)) @@ -262,7 +262,7 @@ var typeListerInterface = ` type $.type|public$Lister interface { // List lists all $.type|publicPlural$ in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) + List(selector $.labelsSelector|raw$) (ret []*$.type|raw$, err error) // $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. $.type|publicPlural$(namespace string) $.type|public$NamespaceLister $.type|public$ListerExpansion @@ -275,7 +275,7 @@ var typeListerInterfaceNonNamespaced = ` type $.type|public$Lister interface { // List lists all $.type|publicPlural$ in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) + List(selector $.labelsSelector|raw$) (ret []*$.type|raw$, err error) // Get retrieves the $.type|public$ from the index for a given name. // Objects returned here must be treated as read-only. Get(name string) (*$.type|raw$, error) @@ -289,21 +289,21 @@ type $.type|public$Lister interface { var typeListerStruct = ` // $.type|private$Lister implements the $.type|public$Lister interface. type $.type|private$Lister struct { - listers.ResourceIndexer[*$.type|raw$] + $.listersResourceIndexer|raw$[*$.type|raw$] } ` var typeListerConstructor = ` // New$.type|public$Lister returns a new $.type|public$Lister. -func New$.type|public$Lister(indexer cache.Indexer) $.type|public$Lister { - return &$.type|private$Lister{listers.New[*$.type|raw$](indexer, $.Resource|raw$("$.type|lowercaseSingular$"))} +func New$.type|public$Lister(indexer $.cacheIndexer|raw$) $.type|public$Lister { + return &$.type|private$Lister{$.listersNew|raw$[*$.type|raw$](indexer, $.Resource|raw$("$.type|lowercaseSingular$"))} } ` var typeListerNamespaceLister = ` // $.type|publicPlural$ returns an object that can list and get $.type|publicPlural$. func (s *$.type|private$Lister) $.type|publicPlural$(namespace string) $.type|public$NamespaceLister { - return $.type|private$NamespaceLister{listers.NewNamespaced[*$.type|raw$](s.ResourceIndexer, namespace)} + return $.type|private$NamespaceLister{$.listersNewNamespaced|raw$[*$.type|raw$](s.ResourceIndexer, namespace)} } ` @@ -313,7 +313,7 @@ var namespaceListerInterface = ` type $.type|public$NamespaceLister interface { // List lists all $.type|publicPlural$ in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*$.type|raw$, err error) + List(selector $.labelsSelector|raw$) (ret []*$.type|raw$, err error) // Get retrieves the $.type|public$ from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. Get(name string) (*$.type|raw$, error) @@ -328,6 +328,6 @@ var namespaceListerStruct = ` // $.type|private$NamespaceLister implements the $.type|public$NamespaceLister // interface. type $.type|private$NamespaceLister struct { - listers.ResourceIndexer[*$.type|raw$] + $.listersResourceIndexer|raw$[*$.type|raw$] } ` diff --git a/vendor/k8s.io/code-generator/cmd/register-gen/generators/targets.go b/vendor/k8s.io/code-generator/cmd/register-gen/generators/targets.go index d2998261c8dab..952e276f7b5f5 100644 --- a/vendor/k8s.io/code-generator/cmd/register-gen/generators/targets.go +++ b/vendor/k8s.io/code-generator/cmd/register-gen/generators/targets.go @@ -115,7 +115,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target gv: gv, typesToGenerate: typesToRegister, outputPackage: pkg.Path, - imports: generator.NewImportTracker(), + imports: generator.NewImportTrackerForPackage(pkg.Path), }, } }, diff --git a/vendor/k8s.io/gengo/LICENSE b/vendor/k8s.io/gengo/LICENSE deleted file mode 100644 index 00b2401109fde..0000000000000 --- a/vendor/k8s.io/gengo/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 The Kubernetes Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/k8s.io/gengo/args/args.go b/vendor/k8s.io/gengo/args/args.go deleted file mode 100644 index b81ceb93afb79..0000000000000 --- a/vendor/k8s.io/gengo/args/args.go +++ /dev/null @@ -1,199 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package args has common command-line flags for generation programs. -package args - -import ( - "bytes" - goflag "flag" - "fmt" - "io/ioutil" - "os" - "path" - "path/filepath" - "strconv" - "strings" - "time" - - "k8s.io/gengo/generator" - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - - "github.com/spf13/pflag" -) - -// Default returns a defaulted GeneratorArgs. You may change the defaults -// before calling AddFlags. -func Default() *GeneratorArgs { - return &GeneratorArgs{ - OutputBase: DefaultSourceTree(), - GoHeaderFilePath: filepath.Join(DefaultSourceTree(), "k8s.io/gengo/boilerplate/boilerplate.go.txt"), - GeneratedBuildTag: "ignore_autogenerated", - GeneratedByCommentTemplate: "// Code generated by GENERATOR_NAME. DO NOT EDIT.", - defaultCommandLineFlags: true, - } -} - -// GeneratorArgs has arguments that are passed to generators. -type GeneratorArgs struct { - // Which directories to parse. - InputDirs []string - - // Source tree to write results to. - OutputBase string - - // Package path within the source tree. - OutputPackagePath string - - // Output file name. - OutputFileBaseName string - - // Where to get copyright header text. - GoHeaderFilePath string - - // If GeneratedByCommentTemplate is set, generate a "Code generated by" comment - // below the bloilerplate, of the format defined by this string. - // Any instances of "GENERATOR_NAME" will be replaced with the name of the code generator. - GeneratedByCommentTemplate string - - // If true, only verify, don't write anything. - VerifyOnly bool - - // If true, include *_test.go files - IncludeTestFiles bool - - // GeneratedBuildTag is the tag used to identify code generated by execution - // of this type. Each generator should use a different tag, and different - // groups of generators (external API that depends on Kube generations) should - // keep tags distinct as well. - GeneratedBuildTag string - - // Any custom arguments go here - CustomArgs interface{} - - // If specified, trim the prefix from OutputPackagePath before writing files. - TrimPathPrefix string - - // Whether to use default command line flags - defaultCommandLineFlags bool -} - -// WithoutDefaultFlagParsing disables implicit addition of command line flags and parsing. -func (g *GeneratorArgs) WithoutDefaultFlagParsing() *GeneratorArgs { - g.defaultCommandLineFlags = false - return g -} - -func (g *GeneratorArgs) AddFlags(fs *pflag.FlagSet) { - fs.StringSliceVarP(&g.InputDirs, "input-dirs", "i", g.InputDirs, "Comma-separated list of import paths to get input types from.") - fs.StringVarP(&g.OutputBase, "output-base", "o", g.OutputBase, "Output base; defaults to $GOPATH/src/ or ./ if $GOPATH is not set.") - fs.StringVarP(&g.OutputPackagePath, "output-package", "p", g.OutputPackagePath, "Base package path.") - fs.StringVarP(&g.OutputFileBaseName, "output-file-base", "O", g.OutputFileBaseName, "Base name (without .go suffix) for output files.") - fs.StringVarP(&g.GoHeaderFilePath, "go-header-file", "h", g.GoHeaderFilePath, "File containing boilerplate header text. The string YEAR will be replaced with the current 4-digit year.") - fs.BoolVar(&g.VerifyOnly, "verify-only", g.VerifyOnly, "If true, only verify existing output, do not write anything.") - fs.StringVar(&g.GeneratedBuildTag, "build-tag", g.GeneratedBuildTag, "A Go build tag to use to identify files generated by this command. Should be unique.") - fs.StringVar(&g.TrimPathPrefix, "trim-path-prefix", g.TrimPathPrefix, "If set, trim the specified prefix from --output-package when generating files.") -} - -// LoadGoBoilerplate loads the boilerplate file passed to --go-header-file. -func (g *GeneratorArgs) LoadGoBoilerplate() ([]byte, error) { - b, err := ioutil.ReadFile(g.GoHeaderFilePath) - if err != nil { - return nil, err - } - b = bytes.Replace(b, []byte("YEAR"), []byte(strconv.Itoa(time.Now().UTC().Year())), -1) - - if g.GeneratedByCommentTemplate != "" { - if len(b) != 0 { - b = append(b, byte('\n')) - } - generatorName := path.Base(os.Args[0]) - generatedByComment := strings.Replace(g.GeneratedByCommentTemplate, "GENERATOR_NAME", generatorName, -1) - s := fmt.Sprintf("%s\n\n", generatedByComment) - b = append(b, []byte(s)...) - } - return b, nil -} - -// NewBuilder makes a new parser.Builder and populates it with the input -// directories. -func (g *GeneratorArgs) NewBuilder() (*parser.Builder, error) { - b := parser.New() - - // flag for including *_test.go - b.IncludeTestFiles = g.IncludeTestFiles - - // Ignore all auto-generated files. - b.AddBuildTags(g.GeneratedBuildTag) - - for _, d := range g.InputDirs { - var err error - if strings.HasSuffix(d, "/...") { - err = b.AddDirRecursive(strings.TrimSuffix(d, "/...")) - } else { - err = b.AddDir(d) - } - if err != nil { - return nil, fmt.Errorf("unable to add directory %q: %v", d, err) - } - } - return b, nil -} - -// DefaultSourceTree returns the /src directory of the first entry in $GOPATH. -// If $GOPATH is empty, it returns "./". Useful as a default output location. -func DefaultSourceTree() string { - paths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator)) - if len(paths) > 0 && len(paths[0]) > 0 { - return filepath.Join(paths[0], "src") - } - return "./" -} - -// Execute implements main(). -// If you don't need any non-default behavior, use as: -// args.Default().Execute(...) -func (g *GeneratorArgs) Execute(nameSystems namer.NameSystems, defaultSystem string, pkgs func(*generator.Context, *GeneratorArgs) generator.Packages) error { - if g.defaultCommandLineFlags { - g.AddFlags(pflag.CommandLine) - pflag.CommandLine.AddGoFlagSet(goflag.CommandLine) - pflag.Parse() - } - - b, err := g.NewBuilder() - if err != nil { - return fmt.Errorf("Failed making a parser: %v", err) - } - - // pass through the flag on whether to include *_test.go files - b.IncludeTestFiles = g.IncludeTestFiles - - c, err := generator.NewContext(b, nameSystems, defaultSystem) - if err != nil { - return fmt.Errorf("Failed making a context: %v", err) - } - - c.TrimPathPrefix = g.TrimPathPrefix - - c.Verify = g.VerifyOnly - packages := pkgs(c, g) - if err := c.ExecutePackages(g.OutputBase, packages); err != nil { - return fmt.Errorf("Failed executing generator: %v", err) - } - - return nil -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go b/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go deleted file mode 100644 index e9660c2f3a94d..0000000000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/byte.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Byte is a set of bytes, implemented via map[byte]struct{} for minimal memory consumption. -type Byte map[byte]Empty - -// NewByte creates a Byte from a list of values. -func NewByte(items ...byte) Byte { - ss := make(Byte, len(items)) - ss.Insert(items...) - return ss -} - -// ByteKeySet creates a Byte from a keys of a map[byte](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func ByteKeySet(theMap interface{}) Byte { - v := reflect.ValueOf(theMap) - ret := Byte{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(byte)) - } - return ret -} - -// Insert adds items to the set. -func (s Byte) Insert(items ...byte) Byte { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Byte) Delete(items ...byte) Byte { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Byte) Has(item byte) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Byte) HasAll(items ...byte) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Byte) HasAny(items ...byte) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Byte) Clone() Byte { - result := make(Byte, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Byte) Difference(s2 Byte) Byte { - result := NewByte() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Byte) SymmetricDifference(s2 Byte) Byte { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Byte) Union(s2 Byte) Byte { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Byte) Intersection(s2 Byte) Byte { - var walk, other Byte - result := NewByte() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Byte) IsSuperset(s2 Byte) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Byte) Equal(s2 Byte) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfByte []byte - -func (s sortableSliceOfByte) Len() int { return len(s) } -func (s sortableSliceOfByte) Less(i, j int) bool { return lessByte(s[i], s[j]) } -func (s sortableSliceOfByte) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted byte slice. -func (s Byte) List() []byte { - res := make(sortableSliceOfByte, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []byte(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Byte) UnsortedList() []byte { - res := make([]byte, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Byte) PopAny() (byte, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue byte - return zeroValue, false -} - -// Len returns the size of the set. -func (s Byte) Len() int { - return len(s) -} - -func lessByte(lhs, rhs byte) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int.go deleted file mode 100644 index f614f06e1f97f..0000000000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/int.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int is a set of ints, implemented via map[int]struct{} for minimal memory consumption. -type Int map[int]Empty - -// NewInt creates a Int from a list of values. -func NewInt(items ...int) Int { - ss := make(Int, len(items)) - ss.Insert(items...) - return ss -} - -// IntKeySet creates a Int from a keys of a map[int](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func IntKeySet(theMap interface{}) Int { - v := reflect.ValueOf(theMap) - ret := Int{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int)) - } - return ret -} - -// Insert adds items to the set. -func (s Int) Insert(items ...int) Int { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int) Delete(items ...int) Int { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int) Has(item int) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int) HasAll(items ...int) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int) HasAny(items ...int) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Int) Clone() Int { - result := make(Int, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int) Difference(s2 Int) Int { - result := NewInt() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int) SymmetricDifference(s2 Int) Int { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int) Union(s2 Int) Int { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int) Intersection(s2 Int) Int { - var walk, other Int - result := NewInt() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int) IsSuperset(s2 Int) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int) Equal(s2 Int) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt []int - -func (s sortableSliceOfInt) Len() int { return len(s) } -func (s sortableSliceOfInt) Less(i, j int) bool { return lessInt(s[i], s[j]) } -func (s sortableSliceOfInt) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int slice. -func (s Int) List() []int { - res := make(sortableSliceOfInt, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int) UnsortedList() []int { - res := make([]int, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int) PopAny() (int, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int) Len() int { - return len(s) -} - -func lessInt(lhs, rhs int) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go b/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go deleted file mode 100644 index 995d99bd90db6..0000000000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/int64.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.Int64 is a set of int64s, implemented via map[int64]struct{} for minimal memory consumption. -type Int64 map[int64]Empty - -// NewInt64 creates a Int64 from a list of values. -func NewInt64(items ...int64) Int64 { - ss := make(Int64, len(items)) - ss.Insert(items...) - return ss -} - -// Int64KeySet creates a Int64 from a keys of a map[int64](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func Int64KeySet(theMap interface{}) Int64 { - v := reflect.ValueOf(theMap) - ret := Int64{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(int64)) - } - return ret -} - -// Insert adds items to the set. -func (s Int64) Insert(items ...int64) Int64 { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s Int64) Delete(items ...int64) Int64 { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s Int64) Has(item int64) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s Int64) HasAll(items ...int64) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s Int64) HasAny(items ...int64) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s Int64) Clone() Int64 { - result := make(Int64, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 Int64) Difference(s2 Int64) Int64 { - result := NewInt64() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 Int64) SymmetricDifference(s2 Int64) Int64 { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 Int64) Union(s2 Int64) Int64 { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 Int64) Intersection(s2 Int64) Int64 { - var walk, other Int64 - result := NewInt64() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 Int64) IsSuperset(s2 Int64) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 Int64) Equal(s2 Int64) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfInt64 []int64 - -func (s sortableSliceOfInt64) Len() int { return len(s) } -func (s sortableSliceOfInt64) Less(i, j int) bool { return lessInt64(s[i], s[j]) } -func (s sortableSliceOfInt64) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted int64 slice. -func (s Int64) List() []int64 { - res := make(sortableSliceOfInt64, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []int64(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s Int64) UnsortedList() []int64 { - res := make([]int64, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s Int64) PopAny() (int64, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue int64 - return zeroValue, false -} - -// Len returns the size of the set. -func (s Int64) Len() int { - return len(s) -} - -func lessInt64(lhs, rhs int64) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/string.go b/vendor/k8s.io/gengo/examples/set-gen/sets/string.go deleted file mode 100644 index 4a4a92fd21fd1..0000000000000 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/string.go +++ /dev/null @@ -1,221 +0,0 @@ -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by set-gen. DO NOT EDIT. - -package sets - -import ( - "reflect" - "sort" -) - -// sets.String is a set of strings, implemented via map[string]struct{} for minimal memory consumption. -type String map[string]Empty - -// NewString creates a String from a list of values. -func NewString(items ...string) String { - ss := make(String, len(items)) - ss.Insert(items...) - return ss -} - -// StringKeySet creates a String from a keys of a map[string](? extends interface{}). -// If the value passed in is not actually a map, this will panic. -func StringKeySet(theMap interface{}) String { - v := reflect.ValueOf(theMap) - ret := String{} - - for _, keyValue := range v.MapKeys() { - ret.Insert(keyValue.Interface().(string)) - } - return ret -} - -// Insert adds items to the set. -func (s String) Insert(items ...string) String { - for _, item := range items { - s[item] = Empty{} - } - return s -} - -// Delete removes all items from the set. -func (s String) Delete(items ...string) String { - for _, item := range items { - delete(s, item) - } - return s -} - -// Has returns true if and only if item is contained in the set. -func (s String) Has(item string) bool { - _, contained := s[item] - return contained -} - -// HasAll returns true if and only if all items are contained in the set. -func (s String) HasAll(items ...string) bool { - for _, item := range items { - if !s.Has(item) { - return false - } - } - return true -} - -// HasAny returns true if any items are contained in the set. -func (s String) HasAny(items ...string) bool { - for _, item := range items { - if s.Has(item) { - return true - } - } - return false -} - -// Clone returns a new set which is a copy of the current set. -func (s String) Clone() String { - result := make(String, len(s)) - for key := range s { - result.Insert(key) - } - return result -} - -// Difference returns a set of objects that are not in s2. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.Difference(s2) = {a3} -// s2.Difference(s1) = {a4, a5} -func (s1 String) Difference(s2 String) String { - result := NewString() - for key := range s1 { - if !s2.Has(key) { - result.Insert(key) - } - } - return result -} - -// SymmetricDifference returns a set of elements which are in either of the sets, but not in their intersection. -// For example: -// s1 = {a1, a2, a3} -// s2 = {a1, a2, a4, a5} -// s1.SymmetricDifference(s2) = {a3, a4, a5} -// s2.SymmetricDifference(s1) = {a3, a4, a5} -func (s1 String) SymmetricDifference(s2 String) String { - return s1.Difference(s2).Union(s2.Difference(s1)) -} - -// Union returns a new set which includes items in either s1 or s2. -// For example: -// s1 = {a1, a2} -// s2 = {a3, a4} -// s1.Union(s2) = {a1, a2, a3, a4} -// s2.Union(s1) = {a1, a2, a3, a4} -func (s1 String) Union(s2 String) String { - result := s1.Clone() - for key := range s2 { - result.Insert(key) - } - return result -} - -// Intersection returns a new set which includes the item in BOTH s1 and s2 -// For example: -// s1 = {a1, a2} -// s2 = {a2, a3} -// s1.Intersection(s2) = {a2} -func (s1 String) Intersection(s2 String) String { - var walk, other String - result := NewString() - if s1.Len() < s2.Len() { - walk = s1 - other = s2 - } else { - walk = s2 - other = s1 - } - for key := range walk { - if other.Has(key) { - result.Insert(key) - } - } - return result -} - -// IsSuperset returns true if and only if s1 is a superset of s2. -func (s1 String) IsSuperset(s2 String) bool { - for item := range s2 { - if !s1.Has(item) { - return false - } - } - return true -} - -// Equal returns true if and only if s1 is equal (as a set) to s2. -// Two sets are equal if their membership is identical. -// (In practice, this means same elements, order doesn't matter) -func (s1 String) Equal(s2 String) bool { - return len(s1) == len(s2) && s1.IsSuperset(s2) -} - -type sortableSliceOfString []string - -func (s sortableSliceOfString) Len() int { return len(s) } -func (s sortableSliceOfString) Less(i, j int) bool { return lessString(s[i], s[j]) } -func (s sortableSliceOfString) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// List returns the contents as a sorted string slice. -func (s String) List() []string { - res := make(sortableSliceOfString, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Sort(res) - return []string(res) -} - -// UnsortedList returns the slice with contents in random order. -func (s String) UnsortedList() []string { - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - return res -} - -// Returns a single element from the set. -func (s String) PopAny() (string, bool) { - for key := range s { - s.Delete(key) - return key, true - } - var zeroValue string - return zeroValue, false -} - -// Len returns the size of the set. -func (s String) Len() int { - return len(s) -} - -func lessString(lhs, rhs string) bool { - return lhs < rhs -} diff --git a/vendor/k8s.io/gengo/generator/default_generator.go b/vendor/k8s.io/gengo/generator/default_generator.go deleted file mode 100644 index f9476682148d2..0000000000000 --- a/vendor/k8s.io/gengo/generator/default_generator.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -const ( - GolangFileType = "golang" -) - -// DefaultGen implements a do-nothing Generator. -// -// It can be used to implement static content files. -type DefaultGen struct { - // OptionalName, if present, will be used for the generator's name, and - // the filename (with ".go" appended). - OptionalName string - - // OptionalBody, if present, will be used as the return from the "Init" - // method. This causes it to be static content for the entire file if - // no other generator touches the file. - OptionalBody []byte -} - -func (d DefaultGen) Name() string { return d.OptionalName } -func (d DefaultGen) Filter(*Context, *types.Type) bool { return true } -func (d DefaultGen) Namers(*Context) namer.NameSystems { return nil } -func (d DefaultGen) Imports(*Context) []string { return []string{} } -func (d DefaultGen) PackageVars(*Context) []string { return []string{} } -func (d DefaultGen) PackageConsts(*Context) []string { return []string{} } -func (d DefaultGen) GenerateType(*Context, *types.Type, io.Writer) error { return nil } -func (d DefaultGen) Filename() string { return d.OptionalName + ".go" } -func (d DefaultGen) FileType() string { return GolangFileType } -func (d DefaultGen) Finalize(*Context, io.Writer) error { return nil } - -func (d DefaultGen) Init(c *Context, w io.Writer) error { - _, err := w.Write(d.OptionalBody) - return err -} - -var ( - _ = Generator(DefaultGen{}) -) diff --git a/vendor/k8s.io/gengo/generator/default_package.go b/vendor/k8s.io/gengo/generator/default_package.go deleted file mode 100644 index dcf0883235dd2..0000000000000 --- a/vendor/k8s.io/gengo/generator/default_package.go +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "k8s.io/gengo/types" -) - -// DefaultPackage contains a default implementation of Package. -type DefaultPackage struct { - // Short name of package, used in the "package xxxx" line. - PackageName string - // Import path of the package, and the location on disk of the package. - PackagePath string - // The location of the package on disk. - Source string - - // Emitted at the top of every file. - HeaderText []byte - - // Emitted only for a "doc.go" file; appended to the HeaderText for - // that file. - PackageDocumentation []byte - - // If non-nil, will be called on "Generators"; otherwise, the static - // list will be used. So you should set only one of these two fields. - GeneratorFunc func(*Context) []Generator - GeneratorList []Generator - - // Optional; filters the types exposed to the generators. - FilterFunc func(*Context, *types.Type) bool -} - -func (d *DefaultPackage) Name() string { return d.PackageName } -func (d *DefaultPackage) Path() string { return d.PackagePath } -func (d *DefaultPackage) SourcePath() string { return d.Source } - -func (d *DefaultPackage) Filter(c *Context, t *types.Type) bool { - if d.FilterFunc != nil { - return d.FilterFunc(c, t) - } - return true -} - -func (d *DefaultPackage) Generators(c *Context) []Generator { - if d.GeneratorFunc != nil { - return d.GeneratorFunc(c) - } - return d.GeneratorList -} - -func (d *DefaultPackage) Header(filename string) []byte { - if filename == "doc.go" { - return append(d.HeaderText, d.PackageDocumentation...) - } - return d.HeaderText -} - -var ( - _ = Package(&DefaultPackage{}) -) diff --git a/vendor/k8s.io/gengo/generator/doc.go b/vendor/k8s.io/gengo/generator/doc.go deleted file mode 100644 index d8e12534a44ee..0000000000000 --- a/vendor/k8s.io/gengo/generator/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package generator defines an interface for code generators to implement. -// -// To use this package, you'll implement the "Package" and "Generator" -// interfaces; you'll call NewContext to load up the types you want to work -// with, and then you'll call one or more of the Execute methods. See the -// interface definitions for explanations. All output will have gofmt called on -// it automatically, so you do not need to worry about generating correct -// indentation. -// -// This package also exposes SnippetWriter. SnippetWriter reduces to a minimum -// the boilerplate involved in setting up a template from go's text/template -// package. Additionally, all naming systems in the Context will be added as -// functions to the parsed template, so that they can be called directly from -// your templates! -package generator // import "k8s.io/gengo/generator" diff --git a/vendor/k8s.io/gengo/generator/error_tracker.go b/vendor/k8s.io/gengo/generator/error_tracker.go deleted file mode 100644 index 964dae37ba55a..0000000000000 --- a/vendor/k8s.io/gengo/generator/error_tracker.go +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "io" -) - -// ErrorTracker tracks errors to the underlying writer, so that you can ignore -// them until you're ready to return. -type ErrorTracker struct { - io.Writer - err error -} - -// NewErrorTracker makes a new error tracker; note that it implements io.Writer. -func NewErrorTracker(w io.Writer) *ErrorTracker { - return &ErrorTracker{Writer: w} -} - -// Write intercepts calls to Write. -func (et *ErrorTracker) Write(p []byte) (n int, err error) { - if et.err != nil { - return 0, et.err - } - n, err = et.Writer.Write(p) - if err != nil { - et.err = err - } - return n, err -} - -// Error returns nil if no error has occurred, otherwise it returns the error. -func (et *ErrorTracker) Error() error { - return et.err -} diff --git a/vendor/k8s.io/gengo/generator/execute.go b/vendor/k8s.io/gengo/generator/execute.go deleted file mode 100644 index f096741bc8686..0000000000000 --- a/vendor/k8s.io/gengo/generator/execute.go +++ /dev/null @@ -1,329 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - - "golang.org/x/tools/imports" - "k8s.io/gengo/namer" - "k8s.io/gengo/types" - - "k8s.io/klog/v2" -) - -func errs2strings(errors []error) []string { - strs := make([]string, len(errors)) - for i := range errors { - strs[i] = errors[i].Error() - } - return strs -} - -// ExecutePackages runs the generators for every package in 'packages'. 'outDir' -// is the base directory in which to place all the generated packages; it -// should be a physical path on disk, not an import path. e.g.: -// /path/to/home/path/to/gopath/src/ -// Each package has its import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackages(outDir string, packages Packages) error { - var errors []error - for _, p := range packages { - if err := c.ExecutePackage(outDir, p); err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("some packages had errors:\n%v\n", strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -type DefaultFileType struct { - Format func([]byte) ([]byte, error) - Assemble func(io.Writer, *File) -} - -func (ft DefaultFileType) AssembleFile(f *File, pathname string) error { - klog.V(5).Infof("Assembling file %q", pathname) - destFile, err := os.Create(pathname) - if err != nil { - return err - } - defer destFile.Close() - - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - if formatted, err := ft.Format(b.Bytes()); err != nil { - err = fmt.Errorf("unable to format file %q (%v).", pathname, err) - // Write the file anyway, so they can see what's going wrong and fix the generator. - if _, err2 := destFile.Write(b.Bytes()); err2 != nil { - return err2 - } - return err - } else { - _, err = destFile.Write(formatted) - return err - } -} - -func (ft DefaultFileType) VerifyFile(f *File, pathname string) error { - klog.V(5).Infof("Verifying file %q", pathname) - friendlyName := filepath.Join(f.PackageName, f.Name) - b := &bytes.Buffer{} - et := NewErrorTracker(b) - ft.Assemble(et, f) - if et.Error() != nil { - return et.Error() - } - formatted, err := ft.Format(b.Bytes()) - if err != nil { - return fmt.Errorf("unable to format the output for %q: %v", friendlyName, err) - } - existing, err := ioutil.ReadFile(pathname) - if err != nil { - return fmt.Errorf("unable to read file %q for comparison: %v", friendlyName, err) - } - if bytes.Compare(formatted, existing) == 0 { - return nil - } - // Be nice and find the first place where they differ - i := 0 - for i < len(formatted) && i < len(existing) && formatted[i] == existing[i] { - i++ - } - eDiff, fDiff := existing[i:], formatted[i:] - if len(eDiff) > 100 { - eDiff = eDiff[:100] - } - if len(fDiff) > 100 { - fDiff = fDiff[:100] - } - return fmt.Errorf("output for %q differs; first existing/expected diff: \n %q\n %q", friendlyName, string(eDiff), string(fDiff)) -} - -func assembleGolangFile(w io.Writer, f *File) { - w.Write(f.Header) - fmt.Fprintf(w, "package %v\n\n", f.PackageName) - - if len(f.Imports) > 0 { - fmt.Fprint(w, "import (\n") - for i := range f.Imports { - if strings.Contains(i, "\"") { - // they included quotes, or are using the - // `name "path/to/pkg"` format. - fmt.Fprintf(w, "\t%s\n", i) - } else { - fmt.Fprintf(w, "\t%q\n", i) - } - } - fmt.Fprint(w, ")\n\n") - } - - if f.Vars.Len() > 0 { - fmt.Fprint(w, "var (\n") - w.Write(f.Vars.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - if f.Consts.Len() > 0 { - fmt.Fprint(w, "const (\n") - w.Write(f.Consts.Bytes()) - fmt.Fprint(w, ")\n\n") - } - - w.Write(f.Body.Bytes()) -} - -func importsWrapper(src []byte) ([]byte, error) { - return imports.Process("", src, nil) -} - -func NewGolangFile() *DefaultFileType { - return &DefaultFileType{ - Format: importsWrapper, - Assemble: assembleGolangFile, - } -} - -// format should be one line only, and not end with \n. -func addIndentHeaderComment(b *bytes.Buffer, format string, args ...interface{}) { - if b.Len() > 0 { - fmt.Fprintf(b, "\n// "+format+"\n", args...) - } else { - fmt.Fprintf(b, "// "+format+"\n", args...) - } -} - -func (c *Context) filteredBy(f func(*Context, *types.Type) bool) *Context { - c2 := *c - c2.Order = []*types.Type{} - for _, t := range c.Order { - if f(c, t) { - c2.Order = append(c2.Order, t) - } - } - return &c2 -} - -// make a new context; inheret c.Namers, but add on 'namers'. In case of a name -// collision, the namer in 'namers' wins. -func (c *Context) addNameSystems(namers namer.NameSystems) *Context { - if namers == nil { - return c - } - c2 := *c - // Copy the existing name systems so we don't corrupt a parent context - c2.Namers = namer.NameSystems{} - for k, v := range c.Namers { - c2.Namers[k] = v - } - - for name, namer := range namers { - c2.Namers[name] = namer - } - return &c2 -} - -// ExecutePackage executes a single package. 'outDir' is the base directory in -// which to place the package; it should be a physical path on disk, not an -// import path. e.g.: '/path/to/home/path/to/gopath/src/' The package knows its -// import path already, this will be appended to 'outDir'. -func (c *Context) ExecutePackage(outDir string, p Package) error { - path := filepath.Join(outDir, p.Path()) - - // When working outside of GOPATH, we typically won't want to generate the - // full path for a package. For example, if our current project's root/base - // package is github.com/foo/bar, outDir=., p.Path()=github.com/foo/bar/generated, - // then we really want to be writing files to ./generated, not ./github.com/foo/bar/generated. - // The following will trim a path prefix (github.com/foo/bar) from p.Path() to arrive at - // a relative path that works with projects not in GOPATH. - if c.TrimPathPrefix != "" { - separator := string(filepath.Separator) - if !strings.HasSuffix(c.TrimPathPrefix, separator) { - c.TrimPathPrefix += separator - } - - path = strings.TrimPrefix(path, c.TrimPathPrefix) - } - klog.V(5).Infof("Processing package %q, disk location %q", p.Name(), path) - // Filter out any types the *package* doesn't care about. - packageContext := c.filteredBy(p.Filter) - os.MkdirAll(path, 0755) - files := map[string]*File{} - for _, g := range p.Generators(packageContext) { - // Filter out types the *generator* doesn't care about. - genContext := packageContext.filteredBy(g.Filter) - // Now add any extra name systems defined by this generator - genContext = genContext.addNameSystems(g.Namers(genContext)) - - fileType := g.FileType() - if len(fileType) == 0 { - return fmt.Errorf("generator %q must specify a file type", g.Name()) - } - f := files[g.Filename()] - if f == nil { - // This is the first generator to reference this file, so start it. - f = &File{ - Name: g.Filename(), - FileType: fileType, - PackageName: p.Name(), - PackagePath: p.Path(), - PackageSourcePath: p.SourcePath(), - Header: p.Header(g.Filename()), - Imports: map[string]struct{}{}, - } - files[f.Name] = f - } else { - if f.FileType != g.FileType() { - return fmt.Errorf("file %q already has type %q, but generator %q wants to use type %q", f.Name, f.FileType, g.Name(), g.FileType()) - } - } - - if vars := g.PackageVars(genContext); len(vars) > 0 { - addIndentHeaderComment(&f.Vars, "Package-wide variables from generator %q.", g.Name()) - for _, v := range vars { - if _, err := fmt.Fprintf(&f.Vars, "%s\n", v); err != nil { - return err - } - } - } - if consts := g.PackageConsts(genContext); len(consts) > 0 { - addIndentHeaderComment(&f.Consts, "Package-wide consts from generator %q.", g.Name()) - for _, v := range consts { - if _, err := fmt.Fprintf(&f.Consts, "%s\n", v); err != nil { - return err - } - } - } - if err := genContext.executeBody(&f.Body, g); err != nil { - return err - } - if imports := g.Imports(genContext); len(imports) > 0 { - for _, i := range imports { - f.Imports[i] = struct{}{} - } - } - } - - var errors []error - for _, f := range files { - finalPath := filepath.Join(path, f.Name) - assembler, ok := c.FileTypes[f.FileType] - if !ok { - return fmt.Errorf("the file type %q registered for file %q does not exist in the context", f.FileType, f.Name) - } - var err error - if c.Verify { - err = assembler.VerifyFile(f, finalPath) - } else { - err = assembler.AssembleFile(f, finalPath) - } - if err != nil { - errors = append(errors, err) - } - } - if len(errors) > 0 { - return fmt.Errorf("errors in package %q:\n%v\n", p.Path(), strings.Join(errs2strings(errors), "\n")) - } - return nil -} - -func (c *Context) executeBody(w io.Writer, generator Generator) error { - et := NewErrorTracker(w) - if err := generator.Init(c, et); err != nil { - return err - } - for _, t := range c.Order { - if err := generator.GenerateType(c, t, et); err != nil { - return err - } - } - if err := generator.Finalize(c, et); err != nil { - return err - } - return et.Error() -} diff --git a/vendor/k8s.io/gengo/generator/generator.go b/vendor/k8s.io/gengo/generator/generator.go deleted file mode 100644 index 5614ae3b322c9..0000000000000 --- a/vendor/k8s.io/gengo/generator/generator.go +++ /dev/null @@ -1,259 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "bytes" - "io" - - "k8s.io/gengo/namer" - "k8s.io/gengo/parser" - "k8s.io/gengo/types" -) - -// Package contains the contract for generating a package. -type Package interface { - // Name returns the package short name. - Name() string - // Path returns the package import path. - Path() string - // SourcePath returns the location of the package on disk. - SourcePath() string - - // Filter should return true if this package cares about this type. - // Otherwise, this type will be omitted from the type ordering for - // this package. - Filter(*Context, *types.Type) bool - - // Header should return a header for the file, including comment markers. - // Useful for copyright notices and doc strings. Include an - // autogeneration notice! Do not include the "package x" line. - Header(filename string) []byte - - // Generators returns the list of generators for this package. It is - // allowed for more than one generator to write to the same file. - // A Context is passed in case the list of generators depends on the - // input types. - Generators(*Context) []Generator -} - -type File struct { - Name string - FileType string - PackageName string - Header []byte - PackagePath string - PackageSourcePath string - Imports map[string]struct{} - Vars bytes.Buffer - Consts bytes.Buffer - Body bytes.Buffer -} - -type FileType interface { - AssembleFile(f *File, path string) error - VerifyFile(f *File, path string) error -} - -// Packages is a list of packages to generate. -type Packages []Package - -// Generator is the contract for anything that wants to do auto-generation. -// It's expected that the io.Writers passed to the below functions will be -// ErrorTrackers; this allows implementations to not check for io errors, -// making more readable code. -// -// The call order for the functions that take a Context is: -// 1. Filter() // Subsequent calls see only types that pass this. -// 2. Namers() // Subsequent calls see the namers provided by this. -// 3. PackageVars() -// 4. PackageConsts() -// 5. Init() -// 6. GenerateType() // Called N times, once per type in the context's Order. -// 7. Imports() -// -// You may have multiple generators for the same file. -type Generator interface { - // The name of this generator. Will be included in generated comments. - Name() string - - // Filter should return true if this generator cares about this type. - // (otherwise, GenerateType will not be called.) - // - // Filter is called before any of the generator's other functions; - // subsequent calls will get a context with only the types that passed - // this filter. - Filter(*Context, *types.Type) bool - - // If this generator needs special namers, return them here. These will - // override the original namers in the context if there is a collision. - // You may return nil if you don't need special names. These names will - // be available in the context passed to the rest of the generator's - // functions. - // - // A use case for this is to return a namer that tracks imports. - Namers(*Context) namer.NameSystems - - // Init should write an init function, and any other content that's not - // generated per-type. (It's not intended for generator specific - // initialization! Do that when your Package constructs the - // Generators.) - Init(*Context, io.Writer) error - - // Finalize should write finish up functions, and any other content that's not - // generated per-type. - Finalize(*Context, io.Writer) error - - // PackageVars should emit an array of variable lines. They will be - // placed in a var ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageVars(*Context) []string - - // PackageConsts should emit an array of constant lines. They will be - // placed in a const ( ... ) block. There's no need to include a leading - // \t or trailing \n. - PackageConsts(*Context) []string - - // GenerateType should emit the code for a particular type. - GenerateType(*Context, *types.Type, io.Writer) error - - // Imports should return a list of necessary imports. They will be - // formatted correctly. You do not need to include quotation marks, - // return only the package name; alternatively, you can also return - // imports in the format `name "path/to/pkg"`. Imports will be called - // after Init, PackageVars, PackageConsts, and GenerateType, to allow - // you to keep track of what imports you actually need. - Imports(*Context) []string - - // Preferred file name of this generator, not including a path. It is - // allowed for multiple generators to use the same filename, but it's - // up to you to make sure they don't have colliding import names. - // TODO: provide per-file import tracking, removing the requirement - // that generators coordinate.. - Filename() string - - // A registered file type in the context to generate this file with. If - // the FileType is not found in the context, execution will stop. - FileType() string -} - -// Context is global context for individual generators to consume. -type Context struct { - // A map from the naming system to the names for that system. E.g., you - // might have public names and several private naming systems. - Namers namer.NameSystems - - // All the types, in case you want to look up something. - Universe types.Universe - - // Incoming imports, i.e. packages importing the given package. - incomingImports map[string][]string - - // Incoming transitive imports, i.e. the transitive closure of IncomingImports - incomingTransitiveImports map[string][]string - - // All the user-specified packages. This is after recursive expansion. - Inputs []string - - // The canonical ordering of the types (will be filtered by both the - // Package's and Generator's Filter methods). - Order []*types.Type - - // A set of types this context can process. If this is empty or nil, - // the default "golang" filetype will be provided. - FileTypes map[string]FileType - - // If true, Execute* calls will just verify that the existing output is - // correct. (You may set this after calling NewContext.) - Verify bool - - // Allows generators to add packages at runtime. - builder *parser.Builder - - // If specified, trim the prefix from a package's path before writing files. - TrimPathPrefix string -} - -// NewContext generates a context from the given builder, naming systems, and -// the naming system you wish to construct the canonical ordering from. -func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) { - universe, err := b.FindTypes() - if err != nil { - return nil, err - } - - c := &Context{ - Namers: namer.NameSystems{}, - Universe: universe, - Inputs: b.FindPackages(), - FileTypes: map[string]FileType{ - GolangFileType: NewGolangFile(), - }, - builder: b, - } - - for name, systemNamer := range nameSystems { - c.Namers[name] = systemNamer - if name == canonicalOrderName { - orderer := namer.Orderer{Namer: systemNamer} - c.Order = orderer.OrderUniverse(universe) - } - } - return c, nil -} - -// IncomingImports returns the incoming imports for each package. The map is lazily computed. -func (ctxt *Context) IncomingImports() map[string][]string { - if ctxt.incomingImports == nil { - incoming := map[string][]string{} - for _, pkg := range ctxt.Universe { - for imp := range pkg.Imports { - incoming[imp] = append(incoming[imp], pkg.Path) - } - } - ctxt.incomingImports = incoming - } - return ctxt.incomingImports -} - -// TransitiveIncomingImports returns the transitive closure of the incoming imports for each package. -// The map is lazily computed. -func (ctxt *Context) TransitiveIncomingImports() map[string][]string { - if ctxt.incomingTransitiveImports == nil { - ctxt.incomingTransitiveImports = transitiveClosure(ctxt.IncomingImports()) - } - return ctxt.incomingTransitiveImports -} - -// AddDir adds a Go package to the context. The specified path must be a single -// go package import path. GOPATH, GOROOT, and the location of your go binary -// (`which go`) will all be searched, in the normal Go fashion. -// Deprecated. Please use AddDirectory. -func (ctxt *Context) AddDir(path string) error { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirTo(path, &ctxt.Universe) -} - -// AddDirectory adds a Go package to the context. The specified path must be a -// single go package import path. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched, in the normal Go fashion. -func (ctxt *Context) AddDirectory(path string) (*types.Package, error) { - ctxt.incomingImports = nil - ctxt.incomingTransitiveImports = nil - return ctxt.builder.AddDirectoryTo(path, &ctxt.Universe) -} diff --git a/vendor/k8s.io/gengo/generator/import_tracker.go b/vendor/k8s.io/gengo/generator/import_tracker.go deleted file mode 100644 index 99525c40ba024..0000000000000 --- a/vendor/k8s.io/gengo/generator/import_tracker.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "go/token" - "strings" - - "k8s.io/klog/v2" - - "k8s.io/gengo/namer" - "k8s.io/gengo/types" -) - -// NewImportTrackerForPackage creates a new import tracker which is aware -// of a generator's output package. The tracker will not add import lines -// when symbols or types are added from the same package, and LocalNameOf -// will return empty string for the output package. -// -// e.g.: -// -// tracker := NewImportTrackerForPackage("bar.com/pkg/foo") -// tracker.AddSymbol(types.Name{"bar.com/pkg/foo.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz.MyType"}) -// tracker.AddSymbol(types.Name{"bar.com/pkg/baz/baz.MyType"}) -// -// tracker.LocalNameOf("bar.com/pkg/foo") -> "" -// tracker.LocalNameOf("bar.com/pkg/baz") -> "baz" -// tracker.LocalNameOf("bar.com/pkg/baz/baz") -> "bazbaz" -// tracker.ImportLines() -> {`baz "bar.com/pkg/baz"`, `bazbaz "bar.com/pkg/baz/baz"`} -func NewImportTrackerForPackage(local string, typesToAdd ...*types.Type) *namer.DefaultImportTracker { - tracker := namer.NewDefaultImportTracker(types.Name{Package: local}) - tracker.IsInvalidType = func(*types.Type) bool { return false } - tracker.LocalName = func(name types.Name) string { return golangTrackerLocalName(&tracker, name) } - tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } - - tracker.AddTypes(typesToAdd...) - return &tracker -} - -func NewImportTracker(typesToAdd ...*types.Type) *namer.DefaultImportTracker { - return NewImportTrackerForPackage("", typesToAdd...) -} - -func golangTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { - path := t.Package - - // Using backslashes in package names causes gengo to produce Go code which - // will not compile with the gc compiler. See the comment on GoSeperator. - if strings.ContainsRune(path, '\\') { - klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path) - } - - dirs := strings.Split(path, namer.GoSeperator) - for n := len(dirs) - 1; n >= 0; n-- { - // follow kube convention of not having anything between directory names - name := strings.Join(dirs[n:], "") - name = strings.Replace(name, "_", "", -1) - // These characters commonly appear in import paths for go - // packages, but aren't legal go names. So we'll sanitize. - name = strings.Replace(name, ".", "", -1) - name = strings.Replace(name, "-", "", -1) - if _, found := tracker.PathOf(name); found { - // This name collides with some other package - continue - } - - // If the import name is a Go keyword, prefix with an underscore. - if token.Lookup(name).IsKeyword() { - name = "_" + name - } - return name - } - panic("can't find import for " + path) -} diff --git a/vendor/k8s.io/gengo/generator/snippet_writer.go b/vendor/k8s.io/gengo/generator/snippet_writer.go deleted file mode 100644 index 590775ff228b1..0000000000000 --- a/vendor/k8s.io/gengo/generator/snippet_writer.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import ( - "fmt" - "io" - "runtime" - "text/template" -) - -// SnippetWriter is an attempt to make the template library usable. -// Methods are chainable, and you don't have to check Error() until you're all -// done. -type SnippetWriter struct { - w io.Writer - context *Context - // Left & right delimiters. text/template defaults to "{{" and "}}" - // which is totally unusable for go code based templates. - left, right string - funcMap template.FuncMap - err error -} - -// w is the destination; left and right are the delimiters; @ and $ are both -// reasonable choices. -// -// c is used to make a function for every naming system, to which you can pass -// a type and get the corresponding name. -func NewSnippetWriter(w io.Writer, c *Context, left, right string) *SnippetWriter { - sw := &SnippetWriter{ - w: w, - context: c, - left: left, - right: right, - funcMap: template.FuncMap{}, - } - for name, namer := range c.Namers { - sw.funcMap[name] = namer.Name - } - return sw -} - -// Do parses format and runs args through it. You can have arbitrary logic in -// the format (see the text/template documentation), but consider running many -// short templates with ordinary go logic in between--this may be more -// readable. Do is chainable. Any error causes every other call to do to be -// ignored, and the error will be returned by Error(). So you can check it just -// once, at the end of your function. -// -// 'args' can be quite literally anything; read the text/template documentation -// for details. Maps and structs work particularly nicely. Conveniently, the -// types package is designed to have structs that are easily referencable from -// the template language. -// -// Example: -// -// sw := generator.NewSnippetWriter(outBuffer, context, "$", "$") -// sw.Do(`The public type name is: $.type|public$`, map[string]interface{}{"type": t}) -// return sw.Error() -// -// Where: -// * "$" starts a template directive -// * "." references the entire thing passed as args -// * "type" therefore sees a map and looks up the key "type" -// * "|" means "pass the thing on the left to the thing on the right" -// * "public" is the name of a naming system, so the SnippetWriter has given -// the template a function called "public" that takes a *types.Type and -// returns the naming system's name. E.g., if the type is "string" this might -// return "String". -// * the second "$" ends the template directive. -// -// The map is actually not necessary. The below does the same thing: -// -// sw.Do(`The public type name is: $.|public$`, t) -// -// You may or may not find it more readable to use the map with a descriptive -// key, but if you want to pass more than one arg, the map or a custom struct -// becomes a requirement. You can do arbitrary logic inside these templates, -// but you should consider doing the logic in go and stitching them together -// for the sake of your readers. -// -// TODO: Change Do() to optionally take a list of pairs of parameters (key, value) -// and have it construct a combined map with that and args. -func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter { - if s.err != nil { - return s - } - // Name the template by source file:line so it can be found when - // there's an error. - _, file, line, _ := runtime.Caller(1) - tmpl, err := template. - New(fmt.Sprintf("%s:%d", file, line)). - Delims(s.left, s.right). - Funcs(s.funcMap). - Parse(format) - if err != nil { - s.err = err - return s - } - err = tmpl.Execute(s.w, args) - if err != nil { - s.err = err - } - return s -} - -// Args exists to make it convenient to construct arguments for -// SnippetWriter.Do. -type Args map[interface{}]interface{} - -// With makes a copy of a and adds the given key, value pair. -func (a Args) With(key, value interface{}) Args { - a2 := Args{key: value} - for k, v := range a { - a2[k] = v - } - return a2 -} - -// WithArgs makes a copy of a and adds the given arguments. -func (a Args) WithArgs(rhs Args) Args { - a2 := Args{} - for k, v := range rhs { - a2[k] = v - } - for k, v := range a { - a2[k] = v - } - return a2 -} - -func (s *SnippetWriter) Out() io.Writer { - return s.w -} - -// Error returns any encountered error. -func (s *SnippetWriter) Error() error { - return s.err -} diff --git a/vendor/k8s.io/gengo/generator/transitive_closure.go b/vendor/k8s.io/gengo/generator/transitive_closure.go deleted file mode 100644 index 385a49fce312d..0000000000000 --- a/vendor/k8s.io/gengo/generator/transitive_closure.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package generator - -import "sort" - -type edge struct { - from string - to string -} - -func transitiveClosure(in map[string][]string) map[string][]string { - adj := make(map[edge]bool) - imports := make(map[string]struct{}) - for from, tos := range in { - for _, to := range tos { - adj[edge{from, to}] = true - imports[to] = struct{}{} - } - } - - // Warshal's algorithm - for k := range in { - for i := range in { - if !adj[edge{i, k}] { - continue - } - for j := range imports { - if adj[edge{i, j}] { - continue - } - if adj[edge{k, j}] { - adj[edge{i, j}] = true - } - } - } - } - - out := make(map[string][]string, len(in)) - for i := range in { - for j := range imports { - if adj[edge{i, j}] { - out[i] = append(out[i], j) - } - } - - sort.Strings(out[i]) - } - - return out -} diff --git a/vendor/k8s.io/gengo/namer/doc.go b/vendor/k8s.io/gengo/namer/doc.go deleted file mode 100644 index 8a44ea995973f..0000000000000 --- a/vendor/k8s.io/gengo/namer/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package namer has support for making different type naming systems. -// -// This is because sometimes you want to refer to the literal type, sometimes -// you want to make a name for the thing you're generating, and you want to -// make the name based on the type. For example, if you have `type foo string`, -// you want to be able to generate something like `func FooPrinter(f *foo) { -// Print(string(*f)) }`; that is, you want to refer to a public name, a literal -// name, and the underlying literal name. -// -// This package supports the idea of a "Namer" and a set of "NameSystems" to -// support these use cases. -// -// Additionally, a "RawNamer" can optionally keep track of what needs to be -// imported. -package namer // import "k8s.io/gengo/namer" diff --git a/vendor/k8s.io/gengo/namer/import_tracker.go b/vendor/k8s.io/gengo/namer/import_tracker.go deleted file mode 100644 index 2bf1d503f946f..0000000000000 --- a/vendor/k8s.io/gengo/namer/import_tracker.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// ImportTracker may be passed to a namer.RawNamer, to track the imports needed -// for the types it names. -// -// TODO: pay attention to the package name (instead of renaming every package). -type DefaultImportTracker struct { - pathToName map[string]string - // forbidden names are in here. (e.g. "go" is a directory in which - // there is code, but "go" is not a legal name for a package, so we put - // it here to prevent us from naming any package "go") - nameToPath map[string]string - local types.Name - - // Returns true if a given types is an invalid type and should be ignored. - IsInvalidType func(*types.Type) bool - // Returns the final local name for the given name - LocalName func(types.Name) string - // Returns the "import" line for a given (path, name). - PrintImport func(string, string) string -} - -func NewDefaultImportTracker(local types.Name) DefaultImportTracker { - return DefaultImportTracker{ - pathToName: map[string]string{}, - nameToPath: map[string]string{}, - local: local, - } -} - -func (tracker *DefaultImportTracker) AddTypes(types ...*types.Type) { - for _, t := range types { - tracker.AddType(t) - } -} -func (tracker *DefaultImportTracker) AddSymbol(symbol types.Name) { - if tracker.local.Package == symbol.Package { - return - } - - if len(symbol.Package) == 0 { - return - } - path := symbol.Path - if len(path) == 0 { - path = symbol.Package - } - if _, ok := tracker.pathToName[path]; ok { - return - } - - name := tracker.LocalName(symbol) - tracker.nameToPath[name] = path - tracker.pathToName[path] = name -} - -func (tracker *DefaultImportTracker) AddType(t *types.Type) { - if tracker.local.Package == t.Name.Package { - return - } - - if tracker.IsInvalidType(t) { - if t.Kind == types.Builtin { - return - } - if _, ok := tracker.nameToPath[t.Name.Package]; !ok { - tracker.nameToPath[t.Name.Package] = "" - } - return - } - - tracker.AddSymbol(t.Name) -} - -func (tracker *DefaultImportTracker) ImportLines() []string { - importPaths := []string{} - for path := range tracker.pathToName { - importPaths = append(importPaths, path) - } - sort.Sort(sort.StringSlice(importPaths)) - out := []string{} - for _, path := range importPaths { - out = append(out, tracker.PrintImport(path, tracker.pathToName[path])) - } - return out -} - -// LocalNameOf returns the name you would use to refer to the package at the -// specified path within the body of a file. -func (tracker *DefaultImportTracker) LocalNameOf(path string) string { - return tracker.pathToName[path] -} - -// PathOf returns the path that a given localName is referring to within the -// body of a file. -func (tracker *DefaultImportTracker) PathOf(localName string) (string, bool) { - name, ok := tracker.nameToPath[localName] - return name, ok -} diff --git a/vendor/k8s.io/gengo/namer/namer.go b/vendor/k8s.io/gengo/namer/namer.go deleted file mode 100644 index a0f1a24abe94d..0000000000000 --- a/vendor/k8s.io/gengo/namer/namer.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "fmt" - "path/filepath" - "strconv" - "strings" - - "k8s.io/gengo/types" -) - -const ( - // GoSeperator is used to split go import paths. - // Forward slash is used instead of filepath.Seperator because it is the - // only universally-accepted path delimiter and the only delimiter not - // potentially forbidden by Go compilers. (In particular gc does not allow - // the use of backslashes in import paths.) - // See https://golang.org/ref/spec#Import_declarations. - // See also https://github.com/kubernetes/gengo/issues/83#issuecomment-367040772. - GoSeperator = "/" -) - -// Returns whether a name is a private Go name. -func IsPrivateGoName(name string) bool { - return len(name) == 0 || strings.ToLower(name[:1]) == name[:1] -} - -// NewPublicNamer is a helper function that returns a namer that makes -// CamelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPublicNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IC, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewPrivateNamer is a helper function that returns a namer that makes -// camelCase names. See the NameStrategy struct for an explanation of the -// arguments to this constructor. -func NewPrivateNamer(prependPackageNames int, ignoreWords ...string) *NameStrategy { - n := &NameStrategy{ - Join: Joiner(IL, IC), - IgnoreWords: map[string]bool{}, - PrependPackageNames: prependPackageNames, - } - for _, w := range ignoreWords { - n.IgnoreWords[w] = true - } - return n -} - -// NewRawNamer will return a Namer that makes a name by which you would -// directly refer to a type, optionally keeping track of the import paths -// necessary to reference the names it provides. Tracker may be nil. -// The 'pkg' is the full package name, in which the Namer is used - all -// types from that package will be referenced by just type name without -// referencing the package. -// -// For example, if the type is map[string]int, a raw namer will literally -// return "map[string]int". -// -// Or if the type, in package foo, is "type Bar struct { ... }", then the raw -// namer will return "foo.Bar" as the name of the type, and if 'tracker' was -// not nil, will record that package foo needs to be imported. -func NewRawNamer(pkg string, tracker ImportTracker) *rawNamer { - return &rawNamer{pkg: pkg, tracker: tracker} -} - -// Names is a map from Type to name, as defined by some Namer. -type Names map[*types.Type]string - -// Namer takes a type, and assigns a name. -// -// The purpose of this complexity is so that you can assign coherent -// side-by-side systems of names for the types. For example, you might want a -// public interface, a private implementation struct, and also to reference -// literally the type name. -// -// Note that it is safe to call your own Name() function recursively to find -// the names of keys, elements, etc. This is because anonymous types can't have -// cycles in their names, and named types don't require the sort of recursion -// that would be problematic. -type Namer interface { - Name(*types.Type) string -} - -// NameSystems is a map of a system name to a namer for that system. -type NameSystems map[string]Namer - -// NameStrategy is a general Namer. The easiest way to use it is to copy the -// Public/PrivateNamer variables, and modify the members you wish to change. -// -// The Name method produces a name for the given type, of the forms: -// Anonymous types: -// Named types: -// -// In all cases, every part of the name is run through the capitalization -// functions. -// -// The IgnoreWords map can be set if you have directory names that are -// semantically meaningless for naming purposes, e.g. "proto". -// -// Prefix and Suffix can be used to disambiguate parallel systems of type -// names. For example, if you want to generate an interface and an -// implementation, you might want to suffix one with "Interface" and the other -// with "Implementation". Another common use-- if you want to generate private -// types, and one of your source types could be "string", you can't use the -// default lowercase private namer. You'll have to add a suffix or prefix. -type NameStrategy struct { - Prefix, Suffix string - Join func(pre string, parts []string, post string) string - - // Add non-meaningful package directory names here (e.g. "proto") and - // they will be ignored. - IgnoreWords map[string]bool - - // If > 0, prepend exactly that many package directory names (or as - // many as there are). Package names listed in "IgnoreWords" will be - // ignored. - // - // For example, if Ignore words lists "proto" and type Foo is in - // pkg/server/frobbing/proto, then a value of 1 will give a type name - // of FrobbingFoo, 2 gives ServerFrobbingFoo, etc. - PrependPackageNames int - - // A cache of names thus far assigned by this namer. - Names -} - -// IC ensures the first character is uppercase. -func IC(in string) string { - if in == "" { - return in - } - return strings.ToUpper(in[:1]) + in[1:] -} - -// IL ensures the first character is lowercase. -func IL(in string) string { - if in == "" { - return in - } - return strings.ToLower(in[:1]) + in[1:] -} - -// Joiner lets you specify functions that preprocess the various components of -// a name before joining them. You can construct e.g. camelCase or CamelCase or -// any other way of joining words. (See the IC and IL convenience functions.) -func Joiner(first, others func(string) string) func(pre string, in []string, post string) string { - return func(pre string, in []string, post string) string { - tmp := []string{others(pre)} - for i := range in { - tmp = append(tmp, others(in[i])) - } - tmp = append(tmp, others(post)) - return first(strings.Join(tmp, "")) - } -} - -func (ns *NameStrategy) removePrefixAndSuffix(s string) string { - // The join function may have changed capitalization. - lowerIn := strings.ToLower(s) - lowerP := strings.ToLower(ns.Prefix) - lowerS := strings.ToLower(ns.Suffix) - b, e := 0, len(s) - if strings.HasPrefix(lowerIn, lowerP) { - b = len(ns.Prefix) - } - if strings.HasSuffix(lowerIn, lowerS) { - e -= len(ns.Suffix) - } - return s[b:e] -} - -var ( - importPathNameSanitizer = strings.NewReplacer("-", "_", ".", "") -) - -// filters out unwanted directory names and sanitizes remaining names. -func (ns *NameStrategy) filterDirs(path string) []string { - allDirs := strings.Split(path, GoSeperator) - dirs := make([]string, 0, len(allDirs)) - for _, p := range allDirs { - if ns.IgnoreWords == nil || !ns.IgnoreWords[p] { - dirs = append(dirs, importPathNameSanitizer.Replace(p)) - } - } - return dirs -} - -// See the comment on NameStrategy. -func (ns *NameStrategy) Name(t *types.Type) string { - if ns.Names == nil { - ns.Names = Names{} - } - if s, ok := ns.Names[t]; ok { - return s - } - - if t.Name.Package != "" { - dirs := append(ns.filterDirs(t.Name.Package), t.Name.Name) - i := ns.PrependPackageNames + 1 - dn := len(dirs) - if i > dn { - i = dn - } - name := ns.Join(ns.Prefix, dirs[dn-i:], ns.Suffix) - ns.Names[t] = name - return name - } - - // Only anonymous types remain. - var name string - switch t.Kind { - case types.Builtin: - name = ns.Join(ns.Prefix, []string{t.Name.Name}, ns.Suffix) - case types.Map: - name = ns.Join(ns.Prefix, []string{ - "Map", - ns.removePrefixAndSuffix(ns.Name(t.Key)), - "To", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Slice: - name = ns.Join(ns.Prefix, []string{ - "Slice", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Array: - name = ns.Join(ns.Prefix, []string{ - "Array", - ns.removePrefixAndSuffix(fmt.Sprintf("%d", t.Len)), - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Pointer: - name = ns.Join(ns.Prefix, []string{ - "Pointer", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Struct: - names := []string{"Struct"} - for _, m := range t.Members { - names = append(names, ns.removePrefixAndSuffix(ns.Name(m.Type))) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Chan: - name = ns.Join(ns.Prefix, []string{ - "Chan", - ns.removePrefixAndSuffix(ns.Name(t.Elem)), - }, ns.Suffix) - case types.Interface: - // TODO: add to name test - names := []string{"Interface"} - for _, m := range t.Methods { - // TODO: include function signature - names = append(names, m.Name.Name) - } - name = ns.Join(ns.Prefix, names, ns.Suffix) - case types.Func: - // TODO: add to name test - parts := []string{"Func"} - for _, pt := range t.Signature.Parameters { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(pt))) - } - parts = append(parts, "Returns") - for _, rt := range t.Signature.Results { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(rt))) - } - name = ns.Join(ns.Prefix, parts, ns.Suffix) - default: - name = "unnameable_" + string(t.Kind) - } - ns.Names[t] = name - return name -} - -// ImportTracker allows a raw namer to keep track of the packages needed for -// import. You can implement yourself or use the one in the generation package. -type ImportTracker interface { - AddType(*types.Type) - AddSymbol(types.Name) - LocalNameOf(packagePath string) string - PathOf(localName string) (string, bool) - ImportLines() []string -} - -type rawNamer struct { - pkg string - tracker ImportTracker - Names -} - -// Name makes a name the way you'd write it to literally refer to type t, -// making ordinary assumptions about how you've imported t's package (or using -// r.tracker to specifically track the package imports). -func (r *rawNamer) Name(t *types.Type) string { - if r.Names == nil { - r.Names = Names{} - } - if name, ok := r.Names[t]; ok { - return name - } - if t.Name.Package != "" { - var name string - if r.tracker != nil { - r.tracker.AddType(t) - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = r.tracker.LocalNameOf(t.Name.Package) + "." + t.Name.Name - } - } else { - if t.Name.Package == r.pkg { - name = t.Name.Name - } else { - name = filepath.Base(t.Name.Package) + "." + t.Name.Name - } - } - r.Names[t] = name - return name - } - var name string - switch t.Kind { - case types.Builtin: - name = t.Name.Name - case types.Map: - name = "map[" + r.Name(t.Key) + "]" + r.Name(t.Elem) - case types.Slice: - name = "[]" + r.Name(t.Elem) - case types.Array: - l := strconv.Itoa(int(t.Len)) - name = "[" + l + "]" + r.Name(t.Elem) - case types.Pointer: - name = "*" + r.Name(t.Elem) - case types.Struct: - elems := []string{} - for _, m := range t.Members { - elems = append(elems, m.Name+" "+r.Name(m.Type)) - } - name = "struct{" + strings.Join(elems, "; ") + "}" - case types.Chan: - // TODO: include directionality - name = "chan " + r.Name(t.Elem) - case types.Interface: - // TODO: add to name test - elems := []string{} - for _, m := range t.Methods { - // TODO: include function signature - elems = append(elems, m.Name.Name) - } - name = "interface{" + strings.Join(elems, "; ") + "}" - case types.Func: - // TODO: add to name test - params := []string{} - for _, pt := range t.Signature.Parameters { - params = append(params, r.Name(pt)) - } - results := []string{} - for _, rt := range t.Signature.Results { - results = append(results, r.Name(rt)) - } - name = "func(" + strings.Join(params, ",") + ")" - if len(results) == 1 { - name += " " + results[0] - } else if len(results) > 1 { - name += " (" + strings.Join(results, ",") + ")" - } - default: - name = "unnameable_" + string(t.Kind) - } - r.Names[t] = name - return name -} diff --git a/vendor/k8s.io/gengo/namer/order.go b/vendor/k8s.io/gengo/namer/order.go deleted file mode 100644 index fd89be9b08371..0000000000000 --- a/vendor/k8s.io/gengo/namer/order.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "sort" - - "k8s.io/gengo/types" -) - -// Orderer produces an ordering of types given a Namer. -type Orderer struct { - Namer -} - -// OrderUniverse assigns a name to every type in the Universe, including Types, -// Functions and Variables, and returns a list sorted by those names. -func (o *Orderer) OrderUniverse(u types.Universe) []*types.Type { - list := tList{ - namer: o.Namer, - } - for _, p := range u { - for _, t := range p.Types { - list.types = append(list.types, t) - } - for _, f := range p.Functions { - list.types = append(list.types, f) - } - for _, v := range p.Variables { - list.types = append(list.types, v) - } - for _, v := range p.Constants { - list.types = append(list.types, v) - } - } - sort.Sort(list) - return list.types -} - -// OrderTypes assigns a name to every type, and returns a list sorted by those -// names. -func (o *Orderer) OrderTypes(typeList []*types.Type) []*types.Type { - list := tList{ - namer: o.Namer, - types: typeList, - } - sort.Sort(list) - return list.types -} - -type tList struct { - namer Namer - types []*types.Type -} - -func (t tList) Len() int { return len(t.types) } -func (t tList) Less(i, j int) bool { return t.namer.Name(t.types[i]) < t.namer.Name(t.types[j]) } -func (t tList) Swap(i, j int) { t.types[i], t.types[j] = t.types[j], t.types[i] } diff --git a/vendor/k8s.io/gengo/namer/plural_namer.go b/vendor/k8s.io/gengo/namer/plural_namer.go deleted file mode 100644 index 0e3ebbf262a71..0000000000000 --- a/vendor/k8s.io/gengo/namer/plural_namer.go +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package namer - -import ( - "strings" - - "k8s.io/gengo/types" -) - -var consonants = "bcdfghjklmnpqrstvwxyz" - -type pluralNamer struct { - // key is the case-sensitive type name, value is the case-insensitive - // intended output. - exceptions map[string]string - finalize func(string) string -} - -// NewPublicPluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a uppercase letter. -func NewPublicPluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IC} -} - -// NewPrivatePluralNamer returns a namer that returns the plural form of the input -// type's name, starting with a lowercase letter. -func NewPrivatePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, IL} -} - -// NewAllLowercasePluralNamer returns a namer that returns the plural form of the input -// type's name, with all letters in lowercase. -func NewAllLowercasePluralNamer(exceptions map[string]string) *pluralNamer { - return &pluralNamer{exceptions, strings.ToLower} -} - -// Name returns the plural form of the type's name. If the type's name is found -// in the exceptions map, the map value is returned. -func (r *pluralNamer) Name(t *types.Type) string { - singular := t.Name.Name - var plural string - var ok bool - if plural, ok = r.exceptions[singular]; ok { - return r.finalize(plural) - } - if len(singular) < 2 { - return r.finalize(singular) - } - - switch rune(singular[len(singular)-1]) { - case 's', 'x', 'z': - plural = esPlural(singular) - case 'y': - sl := rune(singular[len(singular)-2]) - if isConsonant(sl) { - plural = iesPlural(singular) - } else { - plural = sPlural(singular) - } - case 'h': - sl := rune(singular[len(singular)-2]) - if sl == 'c' || sl == 's' { - plural = esPlural(singular) - } else { - plural = sPlural(singular) - } - case 'e': - sl := rune(singular[len(singular)-2]) - if sl == 'f' { - plural = vesPlural(singular[:len(singular)-1]) - } else { - plural = sPlural(singular) - } - case 'f': - plural = vesPlural(singular) - default: - plural = sPlural(singular) - } - return r.finalize(plural) -} - -func iesPlural(singular string) string { - return singular[:len(singular)-1] + "ies" -} - -func vesPlural(singular string) string { - return singular[:len(singular)-1] + "ves" -} - -func esPlural(singular string) string { - return singular + "es" -} - -func sPlural(singular string) string { - return singular + "s" -} - -func isConsonant(char rune) bool { - for _, c := range consonants { - if char == c { - return true - } - } - return false -} diff --git a/vendor/k8s.io/gengo/parser/doc.go b/vendor/k8s.io/gengo/parser/doc.go deleted file mode 100644 index 8231b6d432034..0000000000000 --- a/vendor/k8s.io/gengo/parser/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package parser provides code to parse go files, type-check them, extract the -// types. -package parser // import "k8s.io/gengo/parser" diff --git a/vendor/k8s.io/gengo/parser/parse.go b/vendor/k8s.io/gengo/parser/parse.go deleted file mode 100644 index bbd719295e6e0..0000000000000 --- a/vendor/k8s.io/gengo/parser/parse.go +++ /dev/null @@ -1,925 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package parser - -import ( - "fmt" - "go/ast" - "go/build" - "go/constant" - "go/parser" - "go/token" - tc "go/types" - "io/ioutil" - "os" - "os/exec" - "path" - "path/filepath" - "regexp" - "sort" - "strings" - - "k8s.io/gengo/types" - "k8s.io/klog/v2" -) - -// This clarifies when a pkg path has been canonicalized. -type importPathString string - -// Builder lets you add all the go files in all the packages that you care -// about, then constructs the type source data. -type Builder struct { - context *build.Context - - // If true, include *_test.go - IncludeTestFiles bool - - // Map of package names to more canonical information about the package. - // This might hold the same value for multiple names, e.g. if someone - // referenced ./pkg/name or in the case of vendoring, which canonicalizes - // differently that what humans would type. - // - // This must only be accessed via getLoadedBuildPackage and setLoadedBuildPackage - buildPackages map[importPathString]*build.Package - - fset *token.FileSet - // map of package path to list of parsed files - parsed map[importPathString][]parsedFile - // map of package path to absolute path (to prevent overlap) - absPaths map[importPathString]string - - // Set by typeCheckPackage(), used by importPackage() and friends. - typeCheckedPackages map[importPathString]*tc.Package - - // Map of package path to whether the user requested it or it was from - // an import. - userRequested map[importPathString]bool - - // All comments from everywhere in every parsed file. - endLineToCommentGroup map[fileLine]*ast.CommentGroup - - // map of package to list of packages it imports. - importGraph map[importPathString]map[string]struct{} -} - -// parsedFile is for tracking files with name -type parsedFile struct { - name string - file *ast.File -} - -// key type for finding comments. -type fileLine struct { - file string - line int -} - -// New constructs a new builder. -func New() *Builder { - c := build.Default - if c.GOROOT == "" { - if p, err := exec.Command("which", "go").CombinedOutput(); err == nil { - // The returned string will have some/path/bin/go, so remove the last two elements. - c.GOROOT = filepath.Dir(filepath.Dir(strings.Trim(string(p), "\n"))) - } else { - klog.Warningf("Warning: $GOROOT not set, and unable to run `which go` to find it: %v\n", err) - } - } - // Force this to off, since we don't properly parse CGo. All symbols must - // have non-CGo equivalents. - c.CgoEnabled = false - return &Builder{ - context: &c, - buildPackages: map[importPathString]*build.Package{}, - typeCheckedPackages: map[importPathString]*tc.Package{}, - fset: token.NewFileSet(), - parsed: map[importPathString][]parsedFile{}, - absPaths: map[importPathString]string{}, - userRequested: map[importPathString]bool{}, - endLineToCommentGroup: map[fileLine]*ast.CommentGroup{}, - importGraph: map[importPathString]map[string]struct{}{}, - } -} - -// AddBuildTags adds the specified build tags to the parse context. -func (b *Builder) AddBuildTags(tags ...string) { - b.context.BuildTags = append(b.context.BuildTags, tags...) -} - -func (b *Builder) getLoadedBuildPackage(importPath string) (*build.Package, bool) { - canonicalized := canonicalizeImportPath(importPath) - if string(canonicalized) != importPath { - klog.V(5).Infof("getLoadedBuildPackage: %s normalized to %s", importPath, canonicalized) - } - buildPkg, ok := b.buildPackages[canonicalized] - return buildPkg, ok -} -func (b *Builder) setLoadedBuildPackage(importPath string, buildPkg *build.Package) { - canonicalizedImportPath := canonicalizeImportPath(importPath) - if string(canonicalizedImportPath) != importPath { - klog.V(5).Infof("setLoadedBuildPackage: importPath %s normalized to %s", importPath, canonicalizedImportPath) - } - - canonicalizedBuildPkgImportPath := canonicalizeImportPath(buildPkg.ImportPath) - if string(canonicalizedBuildPkgImportPath) != buildPkg.ImportPath { - klog.V(5).Infof("setLoadedBuildPackage: buildPkg.ImportPath %s normalized to %s", buildPkg.ImportPath, canonicalizedBuildPkgImportPath) - } - - if canonicalizedImportPath != canonicalizedBuildPkgImportPath { - klog.V(5).Infof("setLoadedBuildPackage: normalized importPath (%s) differs from buildPkg.ImportPath (%s)", canonicalizedImportPath, canonicalizedBuildPkgImportPath) - } - b.buildPackages[canonicalizedImportPath] = buildPkg - b.buildPackages[canonicalizedBuildPkgImportPath] = buildPkg -} - -// Get package information from the go/build package. Automatically excludes -// e.g. test files and files for other platforms-- there is quite a bit of -// logic of that nature in the build package. -func (b *Builder) importBuildPackage(dir string) (*build.Package, error) { - if buildPkg, ok := b.getLoadedBuildPackage(dir); ok { - return buildPkg, nil - } - // This validates the `package foo // github.com/bar/foo` comments. - buildPkg, err := b.importWithMode(dir, build.ImportComment) - if err != nil { - if _, ok := err.(*build.NoGoError); !ok { - return nil, fmt.Errorf("unable to import %q: %v", dir, err) - } - } - if buildPkg == nil { - // Might be an empty directory. Try to just find the dir. - buildPkg, err = b.importWithMode(dir, build.FindOnly) - if err != nil { - return nil, err - } - } - - // Remember it under the user-provided name. - klog.V(5).Infof("saving buildPackage %s", dir) - b.setLoadedBuildPackage(dir, buildPkg) - - return buildPkg, nil -} - -// AddFileForTest adds a file to the set, without verifying that the provided -// pkg actually exists on disk. The pkg must be of the form "canonical/pkg/path" -// and the path must be the absolute path to the file. Because this bypasses -// the normal recursive finding of package dependencies (on disk), test should -// sort their test files topologically first, so all deps are resolved by the -// time we need them. -func (b *Builder) AddFileForTest(pkg string, path string, src []byte) error { - if err := b.addFile(importPathString(pkg), path, src, true); err != nil { - return err - } - if _, err := b.typeCheckPackage(importPathString(pkg), true); err != nil { - return err - } - return nil -} - -// addFile adds a file to the set. The pkgPath must be of the form -// "canonical/pkg/path" and the path must be the absolute path to the file. A -// flag indicates whether this file was user-requested or just from following -// the import graph. -func (b *Builder) addFile(pkgPath importPathString, path string, src []byte, userRequested bool) error { - for _, p := range b.parsed[pkgPath] { - if path == p.name { - klog.V(5).Infof("addFile %s %s already parsed, skipping", pkgPath, path) - return nil - } - } - klog.V(6).Infof("addFile %s %s", pkgPath, path) - p, err := parser.ParseFile(b.fset, path, src, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return err - } - - // This is redundant with addDir, but some tests call AddFileForTest, which - // call into here without calling addDir. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - b.parsed[pkgPath] = append(b.parsed[pkgPath], parsedFile{path, p}) - for _, c := range p.Comments { - position := b.fset.Position(c.End()) - b.endLineToCommentGroup[fileLine{position.Filename, position.Line}] = c - } - - // We have to get the packages from this specific file, in case the - // user added individual files instead of entire directories. - if b.importGraph[pkgPath] == nil { - b.importGraph[pkgPath] = map[string]struct{}{} - } - for _, im := range p.Imports { - importedPath := strings.Trim(im.Path.Value, `"`) - b.importGraph[pkgPath][importedPath] = struct{}{} - } - return nil -} - -// AddDir adds an entire directory, scanning it for go files. 'dir' should have -// a single go package in it. GOPATH, GOROOT, and the location of your go -// binary (`which go`) will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDir(dir string) error { - _, err := b.importPackage(dir, true) - return err -} - -// AddDirRecursive is just like AddDir, but it also recursively adds -// subdirectories; it returns an error only if the path couldn't be resolved; -// any directories recursed into without go source are ignored. -func (b *Builder) AddDirRecursive(dir string) error { - // Add the root. - if _, err := b.importPackage(dir, true); err != nil { - klog.Warningf("Ignoring directory %v: %v", dir, err) - } - - // filepath.Walk does not follow symlinks. We therefore evaluate symlinks and use that with - // filepath.Walk. - buildPkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no loaded build package for %s", dir) - } - realPath, err := filepath.EvalSymlinks(buildPkg.Dir) - if err != nil { - return err - } - - fn := func(filePath string, info os.FileInfo, err error) error { - if info != nil && info.IsDir() { - rel := filepath.ToSlash(strings.TrimPrefix(filePath, realPath)) - if rel != "" { - // Make a pkg path. - buildPkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no loaded build package for %s", dir) - } - pkg := path.Join(string(canonicalizeImportPath(buildPkg.ImportPath)), rel) - - // Add it. - if _, err := b.importPackage(pkg, true); err != nil { - klog.Warningf("Ignoring child directory %v: %v", pkg, err) - } - } - } - return nil - } - if err := filepath.Walk(realPath, fn); err != nil { - return err - } - return nil -} - -// AddDirTo adds an entire directory to a given Universe. Unlike AddDir, this -// processes the package immediately, which makes it safe to use from within a -// generator (rather than just at init time. 'dir' must be a single go package. -// GOPATH, GOROOT, and the location of your go binary (`which go`) will all be -// searched if dir doesn't literally resolve. -// Deprecated. Please use AddDirectoryTo. -func (b *Builder) AddDirTo(dir string, u *types.Universe) error { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return err - } - pkg, ok := b.getLoadedBuildPackage(dir) - if !ok { - return fmt.Errorf("no such package: %q", dir) - } - return b.findTypesIn(canonicalizeImportPath(pkg.ImportPath), u) -} - -// AddDirectoryTo adds an entire directory to a given Universe. Unlike AddDir, -// this processes the package immediately, which makes it safe to use from -// within a generator (rather than just at init time. 'dir' must be a single go -// package. GOPATH, GOROOT, and the location of your go binary (`which go`) -// will all be searched if dir doesn't literally resolve. -func (b *Builder) AddDirectoryTo(dir string, u *types.Universe) (*types.Package, error) { - // We want all types from this package, as if they were directly added - // by the user. They WERE added by the user, in effect. - if _, err := b.importPackage(dir, true); err != nil { - return nil, err - } - pkg, ok := b.getLoadedBuildPackage(dir) - if !ok || pkg == nil { - return nil, fmt.Errorf("no such package: %q", dir) - } - path := canonicalizeImportPath(pkg.ImportPath) - if err := b.findTypesIn(path, u); err != nil { - return nil, err - } - return u.Package(string(path)), nil -} - -// The implementation of AddDir. A flag indicates whether this directory was -// user-requested or just from following the import graph. -func (b *Builder) addDir(dir string, userRequested bool) error { - klog.V(5).Infof("addDir %s", dir) - buildPkg, err := b.importBuildPackage(dir) - if err != nil { - return err - } - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - pkgPath := canonicalPackage - if dir != string(canonicalPackage) { - klog.V(5).Infof("addDir %s, canonical path is %s", dir, pkgPath) - } - - // Sanity check the pkg dir has not changed. - if prev, found := b.absPaths[pkgPath]; found { - if buildPkg.Dir != prev { - return fmt.Errorf("package %q (%s) previously resolved to %s", pkgPath, buildPkg.Dir, prev) - } - } else { - b.absPaths[pkgPath] = buildPkg.Dir - } - - files := []string{} - files = append(files, buildPkg.GoFiles...) - if b.IncludeTestFiles { - files = append(files, buildPkg.TestGoFiles...) - } - - for _, file := range files { - if !strings.HasSuffix(file, ".go") { - continue - } - absPath := filepath.Join(buildPkg.Dir, file) - data, err := ioutil.ReadFile(absPath) - if err != nil { - return fmt.Errorf("while loading %q: %v", absPath, err) - } - err = b.addFile(pkgPath, absPath, data, userRequested) - if err != nil { - return fmt.Errorf("while parsing %q: %v", absPath, err) - } - } - return nil -} - -// regexErrPackageNotFound helps test the expected error for not finding a package. -var regexErrPackageNotFound = regexp.MustCompile(`^unable to import ".*?":.*`) - -func isErrPackageNotFound(err error) bool { - return regexErrPackageNotFound.MatchString(err.Error()) -} - -// importPackage is a function that will be called by the type check package when it -// needs to import a go package. 'path' is the import path. -func (b *Builder) importPackage(dir string, userRequested bool) (*tc.Package, error) { - klog.V(5).Infof("importPackage %s", dir) - - var pkgPath = importPathString(dir) - - // Get the canonical path if we can. - if buildPkg, _ := b.getLoadedBuildPackage(dir); buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - - // If we have not seen this before, process it now. - ignoreError := false - if _, found := b.parsed[pkgPath]; !found { - // Ignore errors in paths that we're importing solely because - // they're referenced by other packages. - ignoreError = true - - // Add it. - if err := b.addDir(dir, userRequested); err != nil { - if isErrPackageNotFound(err) { - klog.V(6).Info(err) - return nil, nil - } - - return nil, err - } - - // Get the canonical path now that it has been added. - if buildPkg, _ := b.getLoadedBuildPackage(dir); buildPkg != nil { - canonicalPackage := canonicalizeImportPath(buildPkg.ImportPath) - klog.V(5).Infof("importPackage %s, canonical path is %s", dir, canonicalPackage) - pkgPath = canonicalPackage - } - } - - // If it was previously known, just check that the user-requestedness hasn't - // changed. - b.userRequested[pkgPath] = userRequested || b.userRequested[pkgPath] - - // Run the type checker. We may end up doing this to pkgs that are already - // done, or are in the queue to be done later, but it will short-circuit, - // and we can't miss pkgs that are only depended on. - pkg, err := b.typeCheckPackage(pkgPath, !ignoreError) - if err != nil { - switch { - case ignoreError && pkg != nil: - klog.V(4).Infof("type checking encountered some issues in %q, but ignoring.\n", pkgPath) - case !ignoreError && pkg != nil: - klog.V(3).Infof("type checking encountered some errors in %q\n", pkgPath) - return nil, err - default: - return nil, err - } - } - - return pkg, nil -} - -type importAdapter struct { - b *Builder -} - -func (a importAdapter) Import(path string) (*tc.Package, error) { - return a.b.importPackage(path, false) -} - -// typeCheckPackage will attempt to return the package even if there are some -// errors, so you may check whether the package is nil or not even if you get -// an error. -func (b *Builder) typeCheckPackage(pkgPath importPathString, logErr bool) (*tc.Package, error) { - klog.V(5).Infof("typeCheckPackage %s", pkgPath) - if pkg, ok := b.typeCheckedPackages[pkgPath]; ok { - if pkg != nil { - klog.V(6).Infof("typeCheckPackage %s already done", pkgPath) - return pkg, nil - } - // We store a nil right before starting work on a package. So - // if we get here and it's present and nil, that means there's - // another invocation of this function on the call stack - // already processing this package. - return nil, fmt.Errorf("circular dependency for %q", pkgPath) - } - parsedFiles, ok := b.parsed[pkgPath] - if !ok { - return nil, fmt.Errorf("No files for pkg %q", pkgPath) - } - files := make([]*ast.File, len(parsedFiles)) - for i := range parsedFiles { - files[i] = parsedFiles[i].file - } - b.typeCheckedPackages[pkgPath] = nil - c := tc.Config{ - IgnoreFuncBodies: true, - // Note that importAdapter can call b.importPackage which calls this - // method. So there can't be cycles in the import graph. - Importer: importAdapter{b}, - Error: func(err error) { - if logErr { - klog.V(2).Infof("type checker: %v\n", err) - } else { - klog.V(3).Infof("type checker: %v\n", err) - } - }, - } - pkg, err := c.Check(string(pkgPath), b.fset, files, nil) - b.typeCheckedPackages[pkgPath] = pkg // record the result whether or not there was an error - return pkg, err -} - -// FindPackages fetches a list of the user-imported packages. -// Note that you need to call b.FindTypes() first. -func (b *Builder) FindPackages() []string { - // Iterate packages in a predictable order. - pkgPaths := []string{} - for k := range b.typeCheckedPackages { - pkgPaths = append(pkgPaths, string(k)) - } - sort.Strings(pkgPaths) - - result := []string{} - for _, pkgPath := range pkgPaths { - if b.userRequested[importPathString(pkgPath)] { - // Since walkType is recursive, all types that are in packages that - // were directly mentioned will be included. We don't need to - // include all types in all transitive packages, though. - result = append(result, pkgPath) - } - } - return result -} - -// FindTypes finalizes the package imports, and searches through all the -// packages for types. -func (b *Builder) FindTypes() (types.Universe, error) { - // Take a snapshot of pkgs to iterate, since this will recursively mutate - // b.parsed. Iterate in a predictable order. - pkgPaths := []string{} - for pkgPath := range b.parsed { - pkgPaths = append(pkgPaths, string(pkgPath)) - } - sort.Strings(pkgPaths) - - u := types.Universe{} - for _, pkgPath := range pkgPaths { - if err := b.findTypesIn(importPathString(pkgPath), &u); err != nil { - return nil, err - } - } - return u, nil -} - -// addCommentsToType takes any accumulated comment lines prior to obj and -// attaches them to the type t. -func (b *Builder) addCommentsToType(obj tc.Object, t *types.Type) { - c1 := b.priorCommentLines(obj.Pos(), 1) - // c1.Text() is safe if c1 is nil - t.CommentLines = splitLines(c1.Text()) - if c1 == nil { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(obj.Pos(), 2).Text()) - } else { - t.SecondClosestCommentLines = splitLines(b.priorCommentLines(c1.List[0].Slash, 2).Text()) - } -} - -// findTypesIn finalizes the package import and searches through the package -// for types. -func (b *Builder) findTypesIn(pkgPath importPathString, u *types.Universe) error { - klog.V(5).Infof("findTypesIn %s", pkgPath) - pkg := b.typeCheckedPackages[pkgPath] - if pkg == nil { - return fmt.Errorf("findTypesIn(%s): package is not known", pkgPath) - } - if !b.userRequested[pkgPath] { - // Since walkType is recursive, all types that the - // packages they asked for depend on will be included. - // But we don't need to include all types in all - // *packages* they depend on. - klog.V(5).Infof("findTypesIn %s: package is not user requested", pkgPath) - return nil - } - - // We're keeping this package. This call will create the record. - u.Package(string(pkgPath)).Name = pkg.Name() - u.Package(string(pkgPath)).Path = pkg.Path() - u.Package(string(pkgPath)).SourcePath = b.absPaths[pkgPath] - - for _, f := range b.parsed[pkgPath] { - if _, fileName := filepath.Split(f.name); fileName == "doc.go" { - tp := u.Package(string(pkgPath)) - // findTypesIn might be called multiple times. Clean up tp.Comments - // to avoid repeatedly fill same comments to it. - tp.Comments = []string{} - for i := range f.file.Comments { - tp.Comments = append(tp.Comments, splitLines(f.file.Comments[i].Text())...) - } - if f.file.Doc != nil { - tp.DocComments = splitLines(f.file.Doc.Text()) - } - } - } - - s := pkg.Scope() - for _, n := range s.Names() { - obj := s.Lookup(n) - tn, ok := obj.(*tc.TypeName) - if ok { - t := b.walkType(*u, nil, tn.Type()) - b.addCommentsToType(obj, t) - } - tf, ok := obj.(*tc.Func) - // We only care about functions, not concrete/abstract methods. - if ok && tf.Type() != nil && tf.Type().(*tc.Signature).Recv() == nil { - t := b.addFunction(*u, nil, tf) - b.addCommentsToType(obj, t) - } - tv, ok := obj.(*tc.Var) - if ok && !tv.IsField() { - t := b.addVariable(*u, nil, tv) - b.addCommentsToType(obj, t) - } - tconst, ok := obj.(*tc.Const) - if ok { - t := b.addConstant(*u, nil, tconst) - b.addCommentsToType(obj, t) - } - } - - importedPkgs := []string{} - for k := range b.importGraph[pkgPath] { - importedPkgs = append(importedPkgs, string(k)) - } - sort.Strings(importedPkgs) - for _, p := range importedPkgs { - u.AddImports(string(pkgPath), p) - } - return nil -} - -func (b *Builder) importWithMode(dir string, mode build.ImportMode) (*build.Package, error) { - // This is a bit of a hack. The srcDir argument to Import() should - // properly be the dir of the file which depends on the package to be - // imported, so that vendoring can work properly and local paths can - // resolve. We assume that there is only one level of vendoring, and that - // the CWD is inside the GOPATH, so this should be safe. Nobody should be - // using local (relative) paths except on the CLI, so CWD is also - // sufficient. - cwd, err := os.Getwd() - if err != nil { - return nil, fmt.Errorf("unable to get current directory: %v", err) - } - - // normalize to drop /vendor/ if present - dir = string(canonicalizeImportPath(dir)) - - buildPkg, err := b.context.Import(filepath.ToSlash(dir), cwd, mode) - if err != nil { - return nil, err - } - return buildPkg, nil -} - -// if there's a comment on the line `lines` before pos, return its text, otherwise "". -func (b *Builder) priorCommentLines(pos token.Pos, lines int) *ast.CommentGroup { - position := b.fset.Position(pos) - key := fileLine{position.Filename, position.Line - lines} - return b.endLineToCommentGroup[key] -} - -func splitLines(str string) []string { - return strings.Split(strings.TrimRight(str, "\n"), "\n") -} - -func tcFuncNameToName(in string) types.Name { - name := strings.TrimPrefix(in, "func ") - nameParts := strings.Split(name, "(") - return tcNameToName(nameParts[0]) -} - -func tcVarNameToName(in string) types.Name { - nameParts := strings.Split(in, " ") - // nameParts[0] is "var". - // nameParts[2:] is the type of the variable, we ignore it for now. - return tcNameToName(nameParts[1]) -} - -func tcNameToName(in string) types.Name { - // Detect anonymous type names. (These may have '.' characters because - // embedded types may have packages, so we detect them specially.) - if strings.HasPrefix(in, "struct{") || - strings.HasPrefix(in, "<-chan") || - strings.HasPrefix(in, "chan<-") || - strings.HasPrefix(in, "chan ") || - strings.HasPrefix(in, "func(") || - strings.HasPrefix(in, "func (") || - strings.HasPrefix(in, "*") || - strings.HasPrefix(in, "map[") || - strings.HasPrefix(in, "[") { - return types.Name{Name: in} - } - - // Otherwise, if there are '.' characters present, the name has a - // package path in front. - nameParts := strings.Split(in, ".") - name := types.Name{Name: in} - if n := len(nameParts); n >= 2 { - // The final "." is the name of the type--previous ones must - // have been in the package path. - name.Package, name.Name = strings.Join(nameParts[:n-1], "."), nameParts[n-1] - } - return name -} - -func (b *Builder) convertSignature(u types.Universe, t *tc.Signature) *types.Signature { - signature := &types.Signature{} - for i := 0; i < t.Params().Len(); i++ { - signature.Parameters = append(signature.Parameters, b.walkType(u, nil, t.Params().At(i).Type())) - signature.ParameterNames = append(signature.ParameterNames, t.Params().At(i).Name()) - } - for i := 0; i < t.Results().Len(); i++ { - signature.Results = append(signature.Results, b.walkType(u, nil, t.Results().At(i).Type())) - signature.ResultNames = append(signature.ResultNames, t.Results().At(i).Name()) - } - if r := t.Recv(); r != nil { - signature.Receiver = b.walkType(u, nil, r.Type()) - } - signature.Variadic = t.Variadic() - return signature -} - -// walkType adds the type, and any necessary child types. -func (b *Builder) walkType(u types.Universe, useName *types.Name, in tc.Type) *types.Type { - // Most of the cases are underlying types of the named type. - name := tcNameToName(in.String()) - if useName != nil { - name = *useName - } - - switch t := in.(type) { - case *tc.Struct: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Struct - for i := 0; i < t.NumFields(); i++ { - f := t.Field(i) - m := types.Member{ - Name: f.Name(), - Embedded: f.Anonymous(), - Tags: t.Tag(i), - Type: b.walkType(u, nil, f.Type()), - CommentLines: splitLines(b.priorCommentLines(f.Pos(), 1).Text()), - } - out.Members = append(out.Members, m) - } - return out - case *tc.Map: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Map - out.Elem = b.walkType(u, nil, t.Elem()) - out.Key = b.walkType(u, nil, t.Key()) - return out - case *tc.Pointer: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Pointer - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Slice: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Slice - out.Elem = b.walkType(u, nil, t.Elem()) - return out - case *tc.Array: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Array - out.Elem = b.walkType(u, nil, t.Elem()) - out.Len = in.(*tc.Array).Len() - return out - case *tc.Chan: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Chan - out.Elem = b.walkType(u, nil, t.Elem()) - // TODO: need to store direction, otherwise raw type name - // cannot be properly written. - return out - case *tc.Basic: - out := u.Type(types.Name{ - Package: "", - Name: t.Name(), - }) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - return out - case *tc.Signature: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Func - out.Signature = b.convertSignature(u, t) - return out - case *tc.Interface: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Interface - t.Complete() - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - name := tcNameToName(method.String()) - mt := b.walkType(u, &name, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - return out - case *tc.Named: - var out *types.Type - switch t.Underlying().(type) { - case *tc.Named, *tc.Basic, *tc.Map, *tc.Slice: - name := tcNameToName(t.String()) - out = u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Alias - out.Underlying = b.walkType(u, nil, t.Underlying()) - default: - // tc package makes everything "named" with an - // underlying anonymous type--we remove that annoying - // "feature" for users. This flattens those types - // together. - name := tcNameToName(t.String()) - if out := u.Type(name); out.Kind != types.Unknown { - return out // short circuit if we've already made this. - } - out = b.walkType(u, &name, t.Underlying()) - } - // If the underlying type didn't already add methods, add them. - // (Interface types will have already added methods.) - if len(out.Methods) == 0 { - for i := 0; i < t.NumMethods(); i++ { - if out.Methods == nil { - out.Methods = map[string]*types.Type{} - } - method := t.Method(i) - name := tcNameToName(method.String()) - mt := b.walkType(u, &name, method.Type()) - mt.CommentLines = splitLines(b.priorCommentLines(method.Pos(), 1).Text()) - out.Methods[method.Name()] = mt - } - } - return out - default: - out := u.Type(name) - if out.Kind != types.Unknown { - return out - } - out.Kind = types.Unsupported - klog.Warningf("Making unsupported type entry %q for: %#v\n", out, t) - return out - } -} - -func (b *Builder) addFunction(u types.Universe, useName *types.Name, in *tc.Func) *types.Type { - name := tcFuncNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Function(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addVariable(u types.Universe, useName *types.Name, in *tc.Var) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Variable(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - return out -} - -func (b *Builder) addConstant(u types.Universe, useName *types.Name, in *tc.Const) *types.Type { - name := tcVarNameToName(in.String()) - if useName != nil { - name = *useName - } - out := u.Constant(name) - out.Kind = types.DeclarationOf - out.Underlying = b.walkType(u, nil, in.Type()) - - var constval string - - // For strings, we use `StringVal()` to get the un-truncated, - // un-quoted string. For other values, `.String()` is preferable to - // get something relatively human readable (especially since for - // floating point types, `ExactString()` will generate numeric - // expressions using `big.(*Float).Text()`. - switch in.Val().Kind() { - case constant.String: - constval = constant.StringVal(in.Val()) - default: - constval = in.Val().String() - } - - out.ConstValue = &constval - return out -} - -// canonicalizeImportPath takes an import path and returns the actual package. -// It doesn't support nested vendoring. -func canonicalizeImportPath(importPath string) importPathString { - if !strings.Contains(importPath, "/vendor/") { - return importPathString(importPath) - } - - return importPathString(importPath[strings.Index(importPath, "/vendor/")+len("/vendor/"):]) -} diff --git a/vendor/k8s.io/gengo/types/comments.go b/vendor/k8s.io/gengo/types/comments.go deleted file mode 100644 index 8150c383875d6..0000000000000 --- a/vendor/k8s.io/gengo/types/comments.go +++ /dev/null @@ -1,82 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types - -import ( - "fmt" - "strings" -) - -// ExtractCommentTags parses comments for lines of the form: -// -// 'marker' + "key=value". -// -// Values are optional; "" is the default. A tag can be specified more than -// one time and all values are returned. If the resulting map has an entry for -// a key, the value (a slice) is guaranteed to have at least 1 element. -// -// Example: if you pass "+" for 'marker', and the following lines are in -// the comments: -// +foo=value1 -// +bar -// +foo=value2 -// +baz="qux" -// Then this function will return: -// map[string][]string{"foo":{"value1, "value2"}, "bar": {""}, "baz": {"qux"}} -func ExtractCommentTags(marker string, lines []string) map[string][]string { - out := map[string][]string{} - for _, line := range lines { - line = strings.Trim(line, " ") - if len(line) == 0 { - continue - } - if !strings.HasPrefix(line, marker) { - continue - } - // TODO: we could support multiple values per key if we split on spaces - kv := strings.SplitN(line[len(marker):], "=", 2) - if len(kv) == 2 { - out[kv[0]] = append(out[kv[0]], kv[1]) - } else if len(kv) == 1 { - out[kv[0]] = append(out[kv[0]], "") - } - } - return out -} - -// ExtractSingleBoolCommentTag parses comments for lines of the form: -// -// 'marker' + "key=value1" -// -// If the tag is not found, the default value is returned. Values are asserted -// to be boolean ("true" or "false"), and any other value will cause an error -// to be returned. If the key has multiple values, the first one will be used. -func ExtractSingleBoolCommentTag(marker string, key string, defaultVal bool, lines []string) (bool, error) { - values := ExtractCommentTags(marker, lines)[key] - if values == nil { - return defaultVal, nil - } - if values[0] == "true" { - return true, nil - } - if values[0] == "false" { - return false, nil - } - return false, fmt.Errorf("tag value for %q is not boolean: %q", key, values[0]) -} diff --git a/vendor/k8s.io/gengo/types/doc.go b/vendor/k8s.io/gengo/types/doc.go deleted file mode 100644 index 74a969a763a14..0000000000000 --- a/vendor/k8s.io/gengo/types/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package types contains go type information, packaged in a way that makes -// auto-generation convenient, whether by template or straight go functions. -package types // import "k8s.io/gengo/types" diff --git a/vendor/k8s.io/gengo/types/flatten.go b/vendor/k8s.io/gengo/types/flatten.go deleted file mode 100644 index 585014e8ba005..0000000000000 --- a/vendor/k8s.io/gengo/types/flatten.go +++ /dev/null @@ -1,57 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -// FlattenMembers recursively takes any embedded members and puts them in the -// top level, correctly hiding them if the top level hides them. There must not -// be a cycle-- that implies infinite members. -// -// This is useful for e.g. computing all the valid keys in a json struct, -// properly considering any configuration of embedded structs. -func FlattenMembers(m []Member) []Member { - embedded := []Member{} - normal := []Member{} - type nameInfo struct { - top bool - i int - } - names := map[string]nameInfo{} - for i := range m { - if m[i].Embedded && m[i].Type.Kind == Struct { - embedded = append(embedded, m[i]) - } else { - normal = append(normal, m[i]) - names[m[i].Name] = nameInfo{true, len(normal) - 1} - } - } - for i := range embedded { - for _, e := range FlattenMembers(embedded[i].Type.Members) { - if info, found := names[e.Name]; found { - if info.top { - continue - } - if n := normal[info.i]; n.Name == e.Name && n.Type == e.Type { - continue - } - panic("conflicting members") - } - normal = append(normal, e) - names[e.Name] = nameInfo{false, len(normal) - 1} - } - } - return normal -} diff --git a/vendor/k8s.io/gengo/types/types.go b/vendor/k8s.io/gengo/types/types.go deleted file mode 100644 index 77650255acdd1..0000000000000 --- a/vendor/k8s.io/gengo/types/types.go +++ /dev/null @@ -1,537 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package types - -import "strings" - -// Ref makes a reference to the given type. It can only be used for e.g. -// passing to namers. -func Ref(packageName, typeName string) *Type { - return &Type{Name: Name{ - Name: typeName, - Package: packageName, - }} -} - -// A type name may have a package qualifier. -type Name struct { - // Empty if embedded or builtin. This is the package path unless Path is specified. - Package string - // The type name. - Name string - // An optional location of the type definition for languages that can have disjoint - // packages and paths. - Path string -} - -// String returns the name formatted as a string. -func (n Name) String() string { - if n.Package == "" { - return n.Name - } - return n.Package + "." + n.Name -} - -// ParseFullyQualifiedName parses a name like k8s.io/kubernetes/pkg/api.Pod into a Name. -func ParseFullyQualifiedName(fqn string) Name { - cs := strings.Split(fqn, ".") - pkg := "" - if len(cs) > 1 { - pkg = strings.Join(cs[0:len(cs)-1], ".") - } - return Name{ - Name: cs[len(cs)-1], - Package: pkg, - } -} - -// The possible classes of types. -type Kind string - -const ( - // Builtin is a primitive, like bool, string, int. - Builtin Kind = "Builtin" - Struct Kind = "Struct" - Map Kind = "Map" - Slice Kind = "Slice" - Pointer Kind = "Pointer" - - // Alias is an alias of another type, e.g. in: - // type Foo string - // type Bar Foo - // Bar is an alias of Foo. - // - // In the real go type system, Foo is a "Named" string; but to simplify - // generation, this type system will just say that Foo *is* a builtin. - // We then need "Alias" as a way for us to say that Bar *is* a Foo. - Alias Kind = "Alias" - - // Interface is any type that could have differing types at run time. - Interface Kind = "Interface" - - // Array is just like slice, but has a fixed length. - Array Kind = "Array" - - // The remaining types are included for completeness, but are not well - // supported. - Chan Kind = "Chan" - Func Kind = "Func" - - // DeclarationOf is different from other Kinds; it indicates that instead of - // representing an actual Type, the type is a declaration of an instance of - // a type. E.g., a top-level function, variable, or constant. See the - // comment for Type.Name for more detail. - DeclarationOf Kind = "DeclarationOf" - Unknown Kind = "" - Unsupported Kind = "Unsupported" - - // Protobuf is protobuf type. - Protobuf Kind = "Protobuf" -) - -// Package holds package-level information. -// Fields are public, as everything in this package, to enable consumption by -// templates (for example). But it is strongly encouraged for code to build by -// using the provided functions. -type Package struct { - // Canonical name of this package-- its path. - Path string - - // The location this package was loaded from - SourcePath string - - // Short name of this package; the name that appears in the - // 'package x' line. - Name string - - // The comment right above the package declaration in doc.go, if any. - DocComments []string - - // All comments from doc.go, if any. - // TODO: remove Comments and use DocComments everywhere. - Comments []string - - // Types within this package, indexed by their name (*not* including - // package name). - Types map[string]*Type - - // Functions within this package, indexed by their name (*not* including - // package name). - Functions map[string]*Type - - // Global variables within this package, indexed by their name (*not* including - // package name). - Variables map[string]*Type - - // Global constants within this package, indexed by their name (*not* including - // package name). - Constants map[string]*Type - - // Packages imported by this package, indexed by (canonicalized) - // package path. - Imports map[string]*Package -} - -// Has returns true if the given name references a type known to this package. -func (p *Package) Has(name string) bool { - _, has := p.Types[name] - return has -} - -// Type gets the given Type in this Package. If the Type is not already -// defined, this will add it and return the new Type value. The caller is -// expected to finish initialization. -func (p *Package) Type(typeName string) *Type { - if t, ok := p.Types[typeName]; ok { - return t - } - if p.Path == "" { - // Import the standard builtin types! - if t, ok := builtins.Types[typeName]; ok { - p.Types[typeName] = t - return t - } - } - t := &Type{Name: Name{Package: p.Path, Name: typeName}} - p.Types[typeName] = t - return t -} - -// Function gets the given function Type in this Package. If the function is -// not already defined, this will add it. If a function is added, it's the -// caller's responsibility to finish construction of the function by setting -// Underlying to the correct type. -func (p *Package) Function(funcName string) *Type { - if t, ok := p.Functions[funcName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: funcName}} - t.Kind = DeclarationOf - p.Functions[funcName] = t - return t -} - -// Variable gets the given variable Type in this Package. If the variable is -// not already defined, this will add it. If a variable is added, it's the caller's -// responsibility to finish construction of the variable by setting Underlying -// to the correct type. -func (p *Package) Variable(varName string) *Type { - if t, ok := p.Variables[varName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: varName}} - t.Kind = DeclarationOf - p.Variables[varName] = t - return t -} - -// Constant gets the given constant Type in this Package. If the constant is -// not already defined, this will add it. If a constant is added, it's the caller's -// responsibility to finish construction of the constant by setting Underlying -// to the correct type. -func (p *Package) Constant(constName string) *Type { - if t, ok := p.Constants[constName]; ok { - return t - } - t := &Type{Name: Name{Package: p.Path, Name: constName}} - t.Kind = DeclarationOf - p.Constants[constName] = t - return t -} - -// HasImport returns true if p imports packageName. Package names include the -// package directory. -func (p *Package) HasImport(packageName string) bool { - _, has := p.Imports[packageName] - return has -} - -// Universe is a map of all packages. The key is the package name, but you -// should use Package(), Type(), Function(), or Variable() instead of direct -// access. -type Universe map[string]*Package - -// Type returns the canonical type for the given fully-qualified name. Builtin -// types will always be found, even if they haven't been explicitly added to -// the map. If a non-existing type is requested, this will create (a marker for) -// it. -func (u Universe) Type(n Name) *Type { - return u.Package(n.Package).Type(n.Name) -} - -// Function returns the canonical function for the given fully-qualified name. -// If a non-existing function is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the function by setting Underlying to the correct type. -func (u Universe) Function(n Name) *Type { - return u.Package(n.Package).Function(n.Name) -} - -// Variable returns the canonical variable for the given fully-qualified name. -// If a non-existing variable is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the variable by setting Underlying to the correct type. -func (u Universe) Variable(n Name) *Type { - return u.Package(n.Package).Variable(n.Name) -} - -// Constant returns the canonical constant for the given fully-qualified name. -// If a non-existing constant is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the constant by setting Underlying to the correct type. -func (u Universe) Constant(n Name) *Type { - return u.Package(n.Package).Constant(n.Name) -} - -// AddImports registers import lines for packageName. May be called multiple times. -// You are responsible for canonicalizing all package paths. -func (u Universe) AddImports(packagePath string, importPaths ...string) { - p := u.Package(packagePath) - for _, i := range importPaths { - p.Imports[i] = u.Package(i) - } -} - -// Package returns the Package for the given path. -// If a non-existing package is requested, this will create (a marker for) it. -// If a marker is created, it's the caller's responsibility to finish -// construction of the package. -func (u Universe) Package(packagePath string) *Package { - if p, ok := u[packagePath]; ok { - return p - } - p := &Package{ - Path: packagePath, - Types: map[string]*Type{}, - Functions: map[string]*Type{}, - Variables: map[string]*Type{}, - Constants: map[string]*Type{}, - Imports: map[string]*Package{}, - } - u[packagePath] = p - return p -} - -// Type represents a subset of possible go types. -type Type struct { - // There are two general categories of types, those explicitly named - // and those anonymous. Named ones will have a non-empty package in the - // name field. - // - // An exception: If Kind == DeclarationOf, then this name is the name of a - // top-level function, variable, or const, and the type can be found in Underlying. - // We do this to allow the naming system to work against these objects, even - // though they aren't strictly speaking types. - Name Name - - // The general kind of this type. - Kind Kind - - // If there are comment lines immediately before the type definition, - // they will be recorded here. - CommentLines []string - - // If there are comment lines preceding the `CommentLines`, they will be - // recorded here. There are two cases: - // --- - // SecondClosestCommentLines - // a blank line - // CommentLines - // type definition - // --- - // - // or - // --- - // SecondClosestCommentLines - // a blank line - // type definition - // --- - SecondClosestCommentLines []string - - // If Kind == Struct - Members []Member - - // If Kind == Map, Slice, Pointer, or Chan - Elem *Type - - // If Kind == Map, this is the map's key type. - Key *Type - - // If Kind == Alias, this is the underlying type. - // If Kind == DeclarationOf, this is the type of the declaration. - Underlying *Type - - // If Kind == Interface, this is the set of all required functions. - // Otherwise, if this is a named type, this is the list of methods that - // type has. (All elements will have Kind=="Func") - Methods map[string]*Type - - // If Kind == func, this is the signature of the function. - Signature *Signature - - // ConstValue contains a stringified constant value if - // Kind == DeclarationOf and this is a constant value - // declaration. For string constants, this field contains - // the entire, un-quoted value. For other types, it contains - // a human-readable literal. - ConstValue *string - - // TODO: Add: - // * channel direction - - // If Kind == Array - Len int64 -} - -// String returns the name of the type. -func (t *Type) String() string { - return t.Name.String() -} - -// IsPrimitive returns whether the type is a built-in type or is an alias to a -// built-in type. For example: strings and aliases of strings are primitives, -// structs are not. -func (t *Type) IsPrimitive() bool { - if t.Kind == Builtin || (t.Kind == Alias && t.Underlying.Kind == Builtin) { - return true - } - return false -} - -// IsAssignable returns whether the type is deep-assignable. For example, -// slices and maps and pointers are shallow copies, but ints and strings are -// complete. -func (t *Type) IsAssignable() bool { - if t.IsPrimitive() { - return true - } - if t.Kind == Struct { - for _, m := range t.Members { - if !m.Type.IsAssignable() { - return false - } - } - return true - } - return false -} - -// IsAnonymousStruct returns true if the type is an anonymous struct or an alias -// to an anonymous struct. -func (t *Type) IsAnonymousStruct() bool { - return (t.Kind == Struct && t.Name.Name == "struct{}") || (t.Kind == Alias && t.Underlying.IsAnonymousStruct()) -} - -// A single struct member -type Member struct { - // The name of the member. - Name string - - // If the member is embedded (anonymous) this will be true, and the - // Name will be the type name. - Embedded bool - - // If there are comment lines immediately before the member in the type - // definition, they will be recorded here. - CommentLines []string - - // If there are tags along with this member, they will be saved here. - Tags string - - // The type of this member. - Type *Type -} - -// String returns the name and type of the member. -func (m Member) String() string { - return m.Name + " " + m.Type.String() -} - -// Signature is a function's signature. -type Signature struct { - // If a method of some type, this is the type it's a member of. - Receiver *Type - Parameters []*Type - ParameterNames []string - Results []*Type - ResultNames []string - - // True if the last in parameter is of the form ...T. - Variadic bool - - // If there are comment lines immediately before this - // signature/method/function declaration, they will be recorded here. - CommentLines []string -} - -// Built in types. -var ( - String = &Type{ - Name: Name{Name: "string"}, - Kind: Builtin, - } - Int64 = &Type{ - Name: Name{Name: "int64"}, - Kind: Builtin, - } - Int32 = &Type{ - Name: Name{Name: "int32"}, - Kind: Builtin, - } - Int16 = &Type{ - Name: Name{Name: "int16"}, - Kind: Builtin, - } - Int = &Type{ - Name: Name{Name: "int"}, - Kind: Builtin, - } - Uint64 = &Type{ - Name: Name{Name: "uint64"}, - Kind: Builtin, - } - Uint32 = &Type{ - Name: Name{Name: "uint32"}, - Kind: Builtin, - } - Uint16 = &Type{ - Name: Name{Name: "uint16"}, - Kind: Builtin, - } - Uint = &Type{ - Name: Name{Name: "uint"}, - Kind: Builtin, - } - Uintptr = &Type{ - Name: Name{Name: "uintptr"}, - Kind: Builtin, - } - Float64 = &Type{ - Name: Name{Name: "float64"}, - Kind: Builtin, - } - Float32 = &Type{ - Name: Name{Name: "float32"}, - Kind: Builtin, - } - Float = &Type{ - Name: Name{Name: "float"}, - Kind: Builtin, - } - Bool = &Type{ - Name: Name{Name: "bool"}, - Kind: Builtin, - } - Byte = &Type{ - Name: Name{Name: "byte"}, - Kind: Builtin, - } - - builtins = &Package{ - Types: map[string]*Type{ - "bool": Bool, - "string": String, - "int": Int, - "int64": Int64, - "int32": Int32, - "int16": Int16, - "int8": Byte, - "uint": Uint, - "uint64": Uint64, - "uint32": Uint32, - "uint16": Uint16, - "uint8": Byte, - "uintptr": Uintptr, - "byte": Byte, - "float": Float, - "float64": Float64, - "float32": Float32, - }, - Imports: map[string]*Package{}, - Path: "", - Name: "", - } -) - -func IsInteger(t *Type) bool { - switch t { - case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: - return true - default: - return false - } -} diff --git a/vendor/k8s.io/gengo/v2/Makefile b/vendor/k8s.io/gengo/v2/Makefile new file mode 100644 index 0000000000000..8d0fbdaa8a8a4 --- /dev/null +++ b/vendor/k8s.io/gengo/v2/Makefile @@ -0,0 +1,14 @@ +all: + go build ./... + +test: + GODEBUG=gotypesalias=0 go test -race ./... -count=1 + GODEBUG=gotypesalias=1 go test -race ./... -count=1 + +# We verify for the maximum version of the go directive as 1.20 +# here because the oldest go directive that exists on our supported +# release branches in k/k is 1.20. +verify: + GODEBUG=gotypesalias=0 ./hack/verify-examples.sh + GODEBUG=gotypesalias=1 ./hack/verify-examples.sh + ./hack/verify-go-directive.sh 1.20 diff --git a/vendor/k8s.io/gengo/v2/generator/execute.go b/vendor/k8s.io/gengo/v2/generator/execute.go index 02b4c3318a6ca..a1e052f5cc678 100644 --- a/vendor/k8s.io/gengo/v2/generator/execute.go +++ b/vendor/k8s.io/gengo/v2/generator/execute.go @@ -26,6 +26,7 @@ import ( "strings" "golang.org/x/tools/imports" + "k8s.io/gengo/v2/namer" "k8s.io/gengo/v2/types" "k8s.io/klog/v2" @@ -114,7 +115,13 @@ func assembleGoFile(w io.Writer, f *File) { } func importsWrapper(src []byte) ([]byte, error) { - return imports.Process("", src, nil) + opt := imports.Options{ + Comments: true, + TabIndent: true, + TabWidth: 8, + FormatOnly: true, // Disable the insertion and deletion of imports + } + return imports.Process("", src, &opt) } func NewGoFile() *DefaultFileType { diff --git a/vendor/k8s.io/gengo/v2/generator/import_tracker.go b/vendor/k8s.io/gengo/v2/generator/import_tracker.go index 70b86cf56b22d..22393e4d49391 100644 --- a/vendor/k8s.io/gengo/v2/generator/import_tracker.go +++ b/vendor/k8s.io/gengo/v2/generator/import_tracker.go @@ -18,6 +18,7 @@ package generator import ( "go/token" + "path/filepath" "strings" "k8s.io/klog/v2" @@ -45,7 +46,7 @@ import ( func NewImportTrackerForPackage(local string, typesToAdd ...*types.Type) *namer.DefaultImportTracker { tracker := namer.NewDefaultImportTracker(types.Name{Package: local}) tracker.IsInvalidType = func(*types.Type) bool { return false } - tracker.LocalName = func(name types.Name) string { return goTrackerLocalName(&tracker, name) } + tracker.LocalName = func(name types.Name) string { return goTrackerLocalName(&tracker, local, name) } tracker.PrintImport = func(path, name string) string { return name + " \"" + path + "\"" } tracker.AddTypes(typesToAdd...) @@ -56,7 +57,7 @@ func NewImportTracker(typesToAdd ...*types.Type) *namer.DefaultImportTracker { return NewImportTrackerForPackage("", typesToAdd...) } -func goTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { +func goTrackerLocalName(tracker namer.ImportTracker, localPkg string, t types.Name) string { path := t.Package // Using backslashes in package names causes gengo to produce Go code which @@ -64,6 +65,7 @@ func goTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { if strings.ContainsRune(path, '\\') { klog.Warningf("Warning: backslash used in import path '%v', this is unsupported.\n", path) } + localLeaf := filepath.Base(localPkg) dirs := strings.Split(path, namer.GoSeperator) for n := len(dirs) - 1; n >= 0; n-- { @@ -74,8 +76,13 @@ func goTrackerLocalName(tracker namer.ImportTracker, t types.Name) string { // packages, but aren't legal go names. So we'll sanitize. name = strings.ReplaceAll(name, ".", "") name = strings.ReplaceAll(name, "-", "") - if _, found := tracker.PathOf(name); found { - // This name collides with some other package + if _, found := tracker.PathOf(name); found || name == localLeaf { + // This name collides with some other package. + // Or, this name is tne same name as the local package, + // which we avoid because it can be confusing. For example, + // if the local package is v1, we to avoid importing + // another package using the v1 name, and instead import + // it with a more qualified name, such as metav1. continue } diff --git a/vendor/k8s.io/gengo/v2/generator/snippet_writer.go b/vendor/k8s.io/gengo/v2/generator/snippet_writer.go index 7f4610c00f7f3..550214e1635d4 100644 --- a/vendor/k8s.io/gengo/v2/generator/snippet_writer.go +++ b/vendor/k8s.io/gengo/v2/generator/snippet_writer.go @@ -123,25 +123,28 @@ func (s *SnippetWriter) Do(format string, args interface{}) *SnippetWriter { // SnippetWriter.Do. type Args map[interface{}]interface{} -// With makes a copy of a and adds the given key, value pair. +// With makes a copy of a and adds the given key, value pair. If key overlaps, +// the new value wins. func (a Args) With(key, value interface{}) Args { - a2 := Args{key: value} + result := Args{} for k, v := range a { - a2[k] = v + result[k] = v } - return a2 + result[key] = value + return result } -// WithArgs makes a copy of a and adds the given arguments. +// WithArgs makes a copy of a and adds the given arguments. If any keys +// overlap, the values from rhs win. func (a Args) WithArgs(rhs Args) Args { - a2 := Args{} - for k, v := range rhs { - a2[k] = v - } + result := Args{} for k, v := range a { - a2[k] = v + result[k] = v + } + for k, v := range rhs { + result[k] = v } - return a2 + return result } func (s *SnippetWriter) Out() io.Writer { @@ -152,3 +155,16 @@ func (s *SnippetWriter) Out() io.Writer { func (s *SnippetWriter) Error() error { return s.err } + +// Dup creates an exact duplicate SnippetWriter with a different io.Writer. +func (s *SnippetWriter) Dup(w io.Writer) *SnippetWriter { + ret := *s + ret.w = w + return &ret +} + +// Append adds the contents of the io.Reader to this SnippetWriter's buffer. +func (s *SnippetWriter) Append(r io.Reader) error { + _, err := io.Copy(s.w, r) + return err +} diff --git a/vendor/k8s.io/gengo/v2/namer/namer.go b/vendor/k8s.io/gengo/v2/namer/namer.go index e82fe66adcf2f..37877eb4921b4 100644 --- a/vendor/k8s.io/gengo/v2/namer/namer.go +++ b/vendor/k8s.io/gengo/v2/namer/namer.go @@ -281,12 +281,12 @@ func (ns *NameStrategy) Name(t *types.Type) string { case types.Func: // TODO: add to name test parts := []string{"Func"} - for _, pt := range t.Signature.Parameters { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(pt))) + for _, param := range t.Signature.Parameters { + parts = append(parts, ns.removePrefixAndSuffix(ns.Name(param.Type))) } parts = append(parts, "Returns") - for _, rt := range t.Signature.Results { - parts = append(parts, ns.removePrefixAndSuffix(ns.Name(rt))) + for _, result := range t.Signature.Results { + parts = append(parts, ns.removePrefixAndSuffix(ns.Name(result.Type))) } name = ns.Join(ns.Prefix, parts, ns.Suffix) default: @@ -374,12 +374,12 @@ func (r *rawNamer) Name(t *types.Type) string { case types.Func: // TODO: add to name test params := []string{} - for _, pt := range t.Signature.Parameters { - params = append(params, r.Name(pt)) + for _, param := range t.Signature.Parameters { + params = append(params, r.Name(param.Type)) } results := []string{} - for _, rt := range t.Signature.Results { - results = append(results, r.Name(rt)) + for _, result := range t.Signature.Results { + results = append(results, r.Name(result.Type)) } name = "func(" + strings.Join(params, ",") + ")" if len(results) == 1 { diff --git a/vendor/k8s.io/gengo/v2/parser/parse.go b/vendor/k8s.io/gengo/v2/parser/parse.go index a5993d1639310..d4de19e7699b4 100644 --- a/vendor/k8s.io/gengo/v2/parser/parse.go +++ b/vendor/k8s.io/gengo/v2/parser/parse.go @@ -29,6 +29,7 @@ import ( "time" "golang.org/x/tools/go/packages" + "k8s.io/gengo/v2/types" "k8s.io/klog/v2" ) @@ -572,6 +573,9 @@ func goVarNameToName(in string) types.Name { return goNameToName(nameParts[1]) } +// goNameToName converts a go name string to a gengo types.Name. +// It operates solely on the string on a best effort basis. The name may be updated +// in walkType for generics. func goNameToName(in string) types.Name { // Detect anonymous type names. (These may have '.' characters because // embedded types may have packages, so we detect them specially.) @@ -587,14 +591,25 @@ func goNameToName(in string) types.Name { return types.Name{Name: in} } + // There may be '.' characters within a generic. Temporarily remove + // the generic. + genericIndex := strings.IndexRune(in, '[') + if genericIndex == -1 { + genericIndex = len(in) + } + // Otherwise, if there are '.' characters present, the name has a // package path in front. - nameParts := strings.Split(in, ".") + nameParts := strings.Split(in[:genericIndex], ".") name := types.Name{Name: in} if n := len(nameParts); n >= 2 { // The final "." is the name of the type--previous ones must // have been in the package path. name.Package, name.Name = strings.Join(nameParts[:n-1], "."), nameParts[n-1] + // Add back the generic component now that the package and type name have been separated. + if genericIndex != len(in) { + name.Name = name.Name + in[genericIndex:] + } } return name } @@ -602,12 +617,16 @@ func goNameToName(in string) types.Name { func (p *Parser) convertSignature(u types.Universe, t *gotypes.Signature) *types.Signature { signature := &types.Signature{} for i := 0; i < t.Params().Len(); i++ { - signature.Parameters = append(signature.Parameters, p.walkType(u, nil, t.Params().At(i).Type())) - signature.ParameterNames = append(signature.ParameterNames, t.Params().At(i).Name()) + signature.Parameters = append(signature.Parameters, &types.ParamResult{ + Name: t.Params().At(i).Name(), + Type: p.walkType(u, nil, t.Params().At(i).Type()), + }) } for i := 0; i < t.Results().Len(); i++ { - signature.Results = append(signature.Results, p.walkType(u, nil, t.Results().At(i).Type())) - signature.ResultNames = append(signature.ResultNames, t.Results().At(i).Name()) + signature.Results = append(signature.Results, &types.ParamResult{ + Name: t.Results().At(i).Name(), + Type: p.walkType(u, nil, t.Results().At(i).Type()), + }) } if r := t.Recv(); r != nil { signature.Receiver = p.walkType(u, nil, r.Type()) @@ -624,6 +643,12 @@ func (p *Parser) walkType(u types.Universe, useName *types.Name, in gotypes.Type name = *useName } + // Handle alias types conditionally on go1.22+. + // Inline this once the minimum supported version is go1.22 + if out := p.walkAliasType(u, in); out != nil { + return out + } + switch t := in.(type) { case *gotypes.Struct: out := u.Type(name) @@ -734,6 +759,27 @@ func (p *Parser) walkType(u types.Universe, useName *types.Name, in gotypes.Type } out.Kind = types.Alias out.Underlying = p.walkType(u, nil, t.Underlying()) + case *gotypes.Struct, *gotypes.Interface: + name := goNameToName(t.String()) + tpMap := map[string]*types.Type{} + if t.TypeParams().Len() != 0 { + // Remove generics, then readd them without the encoded + // type, e.g. Foo[T any] => Foo[T] + var tpNames []string + for i := 0; i < t.TypeParams().Len(); i++ { + tp := t.TypeParams().At(i) + tpName := tp.Obj().Name() + tpNames = append(tpNames, tpName) + tpMap[tpName] = p.walkType(u, nil, tp.Constraint()) + } + name.Name = fmt.Sprintf("%s[%s]", strings.SplitN(name.Name, "[", 2)[0], strings.Join(tpNames, ",")) + } + + if out := u.Type(name); out.Kind != types.Unknown { + return out // short circuit if we've already made this. + } + out = p.walkType(u, &name, t.Underlying()) + out.TypeParams = tpMap default: // gotypes package makes everything "named" with an // underlying anonymous type--we remove that annoying @@ -760,6 +806,15 @@ func (p *Parser) walkType(u types.Universe, useName *types.Name, in gotypes.Type } } return out + case *gotypes.TypeParam: + // DO NOT retrieve the type from the universe. The default type-param name is only the + // generic variable name. Ideally, it would be namespaced by package and struct but it is + // not. Thus, if we try to use the universe, we would start polluting it. + // e.g. if Foo[T] and Bar[T] exists, we'd mistakenly use the same type T for both. + return &types.Type{ + Name: name, + Kind: types.TypeParam, + } default: out := u.Type(name) if out.Kind != types.Unknown { diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go b/vendor/k8s.io/gengo/v2/parser/parse_122.go similarity index 55% rename from vendor/k8s.io/gengo/examples/set-gen/sets/empty.go rename to vendor/k8s.io/gengo/v2/parser/parse_122.go index e11e622c5ba0b..ec2064958a909 100644 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/empty.go +++ b/vendor/k8s.io/gengo/v2/parser/parse_122.go @@ -1,11 +1,14 @@ +//go:build go1.22 +// +build go1.22 + /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,10 +17,17 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by set-gen. DO NOT EDIT. +package parser + +import ( + gotypes "go/types" -package sets + "k8s.io/gengo/v2/types" +) -// Empty is public since it is used by some internal API objects for conversions between external -// string arrays and internal sets, and conversion logic requires public types today. -type Empty struct{} +func (p *Parser) walkAliasType(u types.Universe, in gotypes.Type) *types.Type { + if t, isAlias := in.(*gotypes.Alias); isAlias { + return p.walkType(u, nil, gotypes.Unalias(t)) + } + return nil +} diff --git a/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go b/vendor/k8s.io/gengo/v2/parser/parse_pre_122.go similarity index 62% rename from vendor/k8s.io/gengo/examples/set-gen/sets/doc.go rename to vendor/k8s.io/gengo/v2/parser/parse_pre_122.go index b152a0bf00f27..6f62100c0a773 100644 --- a/vendor/k8s.io/gengo/examples/set-gen/sets/doc.go +++ b/vendor/k8s.io/gengo/v2/parser/parse_pre_122.go @@ -1,11 +1,14 @@ +//go:build !go1.22 +// +build !go1.22 + /* -Copyright The Kubernetes Authors. +Copyright 2024 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +17,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Code generated by set-gen. DO NOT EDIT. +package parser + +import ( + gotypes "go/types" + + "k8s.io/gengo/v2/types" +) -// Package sets has auto-generated set types. -package sets +func (p *Parser) walkAliasType(u types.Universe, in gotypes.Type) *types.Type { + return nil +} diff --git a/vendor/k8s.io/gengo/v2/types/types.go b/vendor/k8s.io/gengo/v2/types/types.go index e9c8319c6563b..7bbca017332d0 100644 --- a/vendor/k8s.io/gengo/v2/types/types.go +++ b/vendor/k8s.io/gengo/v2/types/types.go @@ -98,6 +98,7 @@ const ( DeclarationOf Kind = "DeclarationOf" Unknown Kind = "" Unsupported Kind = "Unsupported" + TypeParam Kind = "TypeParam" // Protobuf is protobuf type. Protobuf Kind = "Protobuf" @@ -324,6 +325,9 @@ type Type struct { // If Kind == Struct Members []Member + // If Kind == Struct + TypeParams map[string]*Type + // If Kind == Map, Slice, Pointer, or Chan Elem *Type @@ -423,14 +427,20 @@ func (m Member) String() string { return m.Name + " " + m.Type.String() } +// ParamResult represents a parameter or a result of a method's signature. +type ParamResult struct { + // The name of the parameter or result. + Name string + // The type of this parameter or result. + Type *Type +} + // Signature is a function's signature. type Signature struct { // If a method of some type, this is the type it's a member of. - Receiver *Type - Parameters []*Type - ParameterNames []string - Results []*Type - ResultNames []string + Receiver *Type + Parameters []*ParamResult + Results []*ParamResult // True if the last in parameter is of the form ...T. Variadic bool diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/markers.go b/vendor/k8s.io/kube-openapi/pkg/generators/markers.go index 7f0fe985a6afc..c4dd67d3beb3f 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/markers.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/markers.go @@ -75,7 +75,29 @@ func (c *CELTag) Validate() error { // - +listMapKeys // - +mapType type commentTags struct { - spec.SchemaProps + Nullable *bool `json:"nullable,omitempty"` + Format *string `json:"format,omitempty"` + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum *bool `json:"exclusiveMaximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum *bool `json:"exclusiveMinimum,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern *string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems *bool `json:"uniqueItems,omitempty"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []interface{} `json:"enum,omitempty"` + MaxProperties *int64 `json:"maxProperties,omitempty"` + MinProperties *int64 `json:"minProperties,omitempty"` + + // Nested commentTags for extending the schemas of subfields at point-of-use + // when you cant annotate them directly. Cannot be used to add properties + // or remove validations on the overridden schema. + Items *commentTags `json:"items,omitempty"` + Properties map[string]*commentTags `json:"properties,omitempty"` + AdditionalProperties *commentTags `json:"additionalProperties,omitempty"` CEL []CELTag `json:"cel,omitempty"` @@ -86,9 +108,75 @@ type commentTags struct { // Returns the schema for the given CommentTags instance. // This is the final authoritative schema for the comment tags -func (c commentTags) ValidationSchema() (*spec.Schema, error) { +func (c *commentTags) ValidationSchema() (*spec.Schema, error) { + if c == nil { + return nil, nil + } + + isNullable := c.Nullable != nil && *c.Nullable + format := "" + if c.Format != nil { + format = *c.Format + } + isExclusiveMaximum := c.ExclusiveMaximum != nil && *c.ExclusiveMaximum + isExclusiveMinimum := c.ExclusiveMinimum != nil && *c.ExclusiveMinimum + isUniqueItems := c.UniqueItems != nil && *c.UniqueItems + pattern := "" + if c.Pattern != nil { + pattern = *c.Pattern + } + + var transformedItems *spec.SchemaOrArray + var transformedProperties map[string]spec.Schema + var transformedAdditionalProperties *spec.SchemaOrBool + + if c.Items != nil { + items, err := c.Items.ValidationSchema() + if err != nil { + return nil, fmt.Errorf("failed to transform items: %w", err) + } + transformedItems = &spec.SchemaOrArray{Schema: items} + } + + if c.Properties != nil { + properties := make(map[string]spec.Schema) + for key, value := range c.Properties { + property, err := value.ValidationSchema() + if err != nil { + return nil, fmt.Errorf("failed to transform property %q: %w", key, err) + } + properties[key] = *property + } + transformedProperties = properties + } + + if c.AdditionalProperties != nil { + additionalProperties, err := c.AdditionalProperties.ValidationSchema() + if err != nil { + return nil, fmt.Errorf("failed to transform additionalProperties: %w", err) + } + transformedAdditionalProperties = &spec.SchemaOrBool{Schema: additionalProperties, Allows: true} + } + res := spec.Schema{ - SchemaProps: c.SchemaProps, + SchemaProps: spec.SchemaProps{ + Nullable: isNullable, + Format: format, + Maximum: c.Maximum, + ExclusiveMaximum: isExclusiveMaximum, + Minimum: c.Minimum, + ExclusiveMinimum: isExclusiveMinimum, + MaxLength: c.MaxLength, + MinLength: c.MinLength, + Pattern: pattern, + MaxItems: c.MaxItems, + MinItems: c.MinItems, + UniqueItems: isUniqueItems, + MultipleOf: c.MultipleOf, + Enum: c.Enum, + MaxProperties: c.MaxProperties, + MinProperties: c.MinProperties, + }, } if len(c.CEL) > 0 { @@ -105,6 +193,18 @@ func (c commentTags) ValidationSchema() (*spec.Schema, error) { res.VendorExtensible.AddExtension("x-kubernetes-validations", celTagMap) } + // Dont add structural properties directly to this schema. This schema + // is used only for validation. + if transformedItems != nil || len(transformedProperties) > 0 || transformedAdditionalProperties != nil { + res.AllOf = append(res.AllOf, spec.Schema{ + SchemaProps: spec.SchemaProps{ + Items: transformedItems, + Properties: transformedProperties, + AdditionalProperties: transformedAdditionalProperties, + }, + }) + } + return &res, nil } @@ -134,7 +234,7 @@ func (c commentTags) Validate() error { if c.Minimum != nil && c.Maximum != nil && *c.Minimum > *c.Maximum { err = errors.Join(err, fmt.Errorf("minimum %f is greater than maximum %f", *c.Minimum, *c.Maximum)) } - if (c.ExclusiveMinimum || c.ExclusiveMaximum) && c.Minimum != nil && c.Maximum != nil && *c.Minimum == *c.Maximum { + if (c.ExclusiveMinimum != nil || c.ExclusiveMaximum != nil) && c.Minimum != nil && c.Maximum != nil && *c.Minimum == *c.Maximum { err = errors.Join(err, fmt.Errorf("exclusiveMinimum/Maximum cannot be set when minimum == maximum")) } if c.MinLength != nil && c.MaxLength != nil && *c.MinLength > *c.MaxLength { @@ -146,10 +246,10 @@ func (c commentTags) Validate() error { if c.MinProperties != nil && c.MaxProperties != nil && *c.MinProperties > *c.MaxProperties { err = errors.Join(err, fmt.Errorf("minProperties %d is greater than maxProperties %d", *c.MinProperties, *c.MaxProperties)) } - if c.Pattern != "" { - _, e := regexp.Compile(c.Pattern) + if c.Pattern != nil { + _, e := regexp.Compile(*c.Pattern) if e != nil { - err = errors.Join(err, fmt.Errorf("invalid pattern %q: %v", c.Pattern, e)) + err = errors.Join(err, fmt.Errorf("invalid pattern %q: %v", *c.Pattern, e)) } } if c.MultipleOf != nil && *c.MultipleOf == 0 { @@ -175,10 +275,23 @@ func (c commentTags) ValidateType(t *types.Type) error { typeString, _ := openapi.OpenAPITypeFormat(resolvedType.String()) // will be empty for complicated types // Structs and interfaces may dynamically be any type, so we cant validate them - // easily. We may be able to if we check that they don't implement all the - // override functions, but for now we just skip them. + // easily. if resolvedType.Kind == types.Interface || resolvedType.Kind == types.Struct { - return nil + // Skip validation for structs and interfaces which implement custom + // overrides + // + // Only check top-level t type without resolving alias to mirror generator + // behavior. Generator only checks the top level type without resolving + // alias. The `has*Method` functions can be changed to add this behavior in the + // future if needed. + elemT := resolvePtrType(t) + if hasOpenAPIDefinitionMethod(elemT) || + hasOpenAPIDefinitionMethods(elemT) || + hasOpenAPIV3DefinitionMethod(elemT) || + hasOpenAPIV3OneOfMethod(elemT) { + + return nil + } } isArray := resolvedType.Kind == types.Slice || resolvedType.Kind == types.Array @@ -186,6 +299,7 @@ func (c commentTags) ValidateType(t *types.Type) error { isString := typeString == "string" isInt := typeString == "integer" isFloat := typeString == "number" + isStruct := resolvedType.Kind == types.Struct if c.MaxItems != nil && !isArray { err = errors.Join(err, fmt.Errorf("maxItems can only be used on array types")) @@ -193,13 +307,13 @@ func (c commentTags) ValidateType(t *types.Type) error { if c.MinItems != nil && !isArray { err = errors.Join(err, fmt.Errorf("minItems can only be used on array types")) } - if c.UniqueItems && !isArray { + if c.UniqueItems != nil && !isArray { err = errors.Join(err, fmt.Errorf("uniqueItems can only be used on array types")) } - if c.MaxProperties != nil && !isMap { + if c.MaxProperties != nil && !(isMap || isStruct) { err = errors.Join(err, fmt.Errorf("maxProperties can only be used on map types")) } - if c.MinProperties != nil && !isMap { + if c.MinProperties != nil && !(isMap || isStruct) { err = errors.Join(err, fmt.Errorf("minProperties can only be used on map types")) } if c.MinLength != nil && !isString { @@ -208,7 +322,7 @@ func (c commentTags) ValidateType(t *types.Type) error { if c.MaxLength != nil && !isString { err = errors.Join(err, fmt.Errorf("maxLength can only be used on string types")) } - if c.Pattern != "" && !isString { + if c.Pattern != nil && !isString { err = errors.Join(err, fmt.Errorf("pattern can only be used on string types")) } if c.Minimum != nil && !isInt && !isFloat { @@ -220,16 +334,57 @@ func (c commentTags) ValidateType(t *types.Type) error { if c.MultipleOf != nil && !isInt && !isFloat { err = errors.Join(err, fmt.Errorf("multipleOf can only be used on numeric types")) } - if c.ExclusiveMinimum && !isInt && !isFloat { + if c.ExclusiveMinimum != nil && !isInt && !isFloat { err = errors.Join(err, fmt.Errorf("exclusiveMinimum can only be used on numeric types")) } - if c.ExclusiveMaximum && !isInt && !isFloat { + if c.ExclusiveMaximum != nil && !isInt && !isFloat { err = errors.Join(err, fmt.Errorf("exclusiveMaximum can only be used on numeric types")) } + if c.AdditionalProperties != nil && !isMap { + err = errors.Join(err, fmt.Errorf("additionalProperties can only be used on map types")) + + if err == nil { + err = errors.Join(err, c.AdditionalProperties.ValidateType(t)) + } + } + if c.Items != nil && !isArray { + err = errors.Join(err, fmt.Errorf("items can only be used on array types")) + + if err == nil { + err = errors.Join(err, c.Items.ValidateType(t)) + } + } + if c.Properties != nil { + if !isStruct && !isMap { + err = errors.Join(err, fmt.Errorf("properties can only be used on struct types")) + } else if isStruct && err == nil { + for key, tags := range c.Properties { + if member := memberWithJSONName(resolvedType, key); member == nil { + err = errors.Join(err, fmt.Errorf("property used in comment tag %q not found in struct %s", key, resolvedType.String())) + } else if nestedErr := tags.ValidateType(member.Type); nestedErr != nil { + err = errors.Join(err, fmt.Errorf("failed to validate property %q: %w", key, nestedErr)) + } + } + } + } return err } +func memberWithJSONName(t *types.Type, key string) *types.Member { + for _, member := range t.Members { + tags := getJsonTags(&member) + if len(tags) > 0 && tags[0] == key { + return &member + } else if member.Embedded { + if embeddedMember := memberWithJSONName(member.Type, key); embeddedMember != nil { + return embeddedMember + } + } + } + return nil +} + // Parses the given comments into a CommentTags type. Validates the parsed comment tags, and returns the result. // Accepts an optional type to validate against, and a prefix to filter out markers not related to validation. // Accepts a prefix to filter out markers not related to validation. diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go index 1ffcf9094913a..c5c0093818363 100644 --- a/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go +++ b/vendor/k8s.io/kube-openapi/pkg/generators/openapi.go @@ -249,7 +249,7 @@ func methodReturnsValue(mt *types.Type, pkg, name string) bool { return false } r := mt.Signature.Results[0] - return r.Name.Name == name && r.Name.Package == pkg + return r.Type.Name.Name == name && r.Type.Name.Package == pkg } func hasOpenAPIV3DefinitionMethod(t *types.Type) bool { @@ -362,6 +362,88 @@ func (g openAPITypeWriter) generateCall(t *types.Type) error { return g.Error() } +// Generates Go code to represent an OpenAPI schema. May be refactored in +// the future to take more responsibility as we transition from an on-line +// approach to parsing the comments to spec.Schema +func (g openAPITypeWriter) generateSchema(s *spec.Schema) error { + if !reflect.DeepEqual(s.SchemaProps, spec.SchemaProps{}) { + g.Do("SchemaProps: spec.SchemaProps{\n", nil) + err := g.generateValueValidations(&s.SchemaProps) + if err != nil { + return err + } + + if len(s.Properties) > 0 { + g.Do("Properties: map[string]spec.Schema{\n", nil) + + // Sort property names to generate deterministic output + keys := []string{} + for k := range s.Properties { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := s.Properties[k] + g.Do("$.$: {\n", fmt.Sprintf("%#v", k)) + err := g.generateSchema(&v) + if err != nil { + return err + } + g.Do("},\n", nil) + } + g.Do("},\n", nil) + } + + if s.AdditionalProperties != nil && s.AdditionalProperties.Schema != nil { + g.Do("AdditionalProperties: &spec.SchemaOrBool{\n", nil) + g.Do("Allows: true,\n", nil) + g.Do("Schema: &spec.Schema{\n", nil) + err := g.generateSchema(s.AdditionalProperties.Schema) + if err != nil { + return err + } + g.Do("},\n", nil) + g.Do("},\n", nil) + } + + if s.Items != nil && s.Items.Schema != nil { + g.Do("Items: &spec.SchemaOrArray{\n", nil) + g.Do("Schema: &spec.Schema{\n", nil) + err := g.generateSchema(s.Items.Schema) + if err != nil { + return err + } + g.Do("},\n", nil) + g.Do("},\n", nil) + } + + g.Do("},\n", nil) + } + + if len(s.Extensions) > 0 { + g.Do("VendorExtensible: spec.VendorExtensible{\nExtensions: spec.Extensions{\n", nil) + + // Sort extension keys to generate deterministic output + keys := []string{} + for k := range s.Extensions { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := s.Extensions[k] + g.Do("$.key$: $.value$,\n", map[string]interface{}{ + "key": fmt.Sprintf("%#v", k), + "value": fmt.Sprintf("%#v", v), + }) + } + g.Do("},\n},\n", nil) + } + + return nil +} + func (g openAPITypeWriter) generateValueValidations(vs *spec.SchemaProps) error { if vs == nil { @@ -420,6 +502,18 @@ func (g openAPITypeWriter) generateValueValidations(vs *spec.SchemaProps) error g.Do("UniqueItems: true,\n", nil) } + if len(vs.AllOf) > 0 { + g.Do("AllOf: []spec.Schema{\n", nil) + for _, s := range vs.AllOf { + g.Do("{\n", nil) + if err := g.generateSchema(&s); err != nil { + return err + } + g.Do("},\n", nil) + } + g.Do("},\n", nil) + } + return nil } @@ -429,7 +523,7 @@ func (g openAPITypeWriter) generate(t *types.Type) error { case types.Struct: validationSchema, err := ParseCommentTags(t, t.CommentLines, markerPrefix) if err != nil { - return err + return fmt.Errorf("failed parsing comment tags for %v: %w", t.String(), err) } hasV2Definition := hasOpenAPIDefinitionMethod(t) @@ -644,7 +738,15 @@ func (g openAPITypeWriter) emitExtensions(extensions []extension, unions []union } if len(otherExtensions) > 0 { - for k, v := range otherExtensions { + // Sort extension keys to generate deterministic output + keys := []string{} + for k := range otherExtensions { + keys = append(keys, k) + } + sort.Strings(keys) + + for _, k := range keys { + v := otherExtensions[k] g.Do("$.key$: $.value$,\n", map[string]interface{}{ "key": fmt.Sprintf("%#v", k), "value": fmt.Sprintf("%#v", v), @@ -928,6 +1030,17 @@ func (g openAPITypeWriter) generateReferenceProperty(t *types.Type) { g.Do("Ref: ref(\"$.$\"),\n", t.Name.String()) } +func resolvePtrType(t *types.Type) *types.Type { + var prev *types.Type + for prev != t { + prev = t + if t.Kind == types.Pointer { + t = t.Elem + } + } + return t +} + func resolveAliasAndPtrType(t *types.Type) *types.Type { var prev *types.Type for prev != t { diff --git a/vendor/modules.txt b/vendor/modules.txt index 6042ec6d3b104..19feaa765f2f9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -234,9 +234,10 @@ github.com/cilium/charts github.com/cilium/coverbee github.com/cilium/coverbee/pkg/cparser github.com/cilium/coverbee/pkg/verifierlog -# github.com/cilium/deepequal-gen v0.0.0-20231116094812-0d6c075c335f +# github.com/cilium/deepequal-gen v0.0.0-20241002105916-4c4165f47b6c ## explicit; go 1.20 github.com/cilium/deepequal-gen +github.com/cilium/deepequal-gen/args github.com/cilium/deepequal-gen/generators # github.com/cilium/dns v1.1.51-0.20240603182237-af788769786a ## explicit; go 1.18 @@ -2465,8 +2466,8 @@ k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil k8s.io/client-go/util/watchlist k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.31.1 -## explicit; go 1.22.0 +# k8s.io/code-generator v0.31.1 => k8s.io/code-generator v0.30.0-alpha.3.0.20240920005538-61df8a8f0355 +## explicit; go 1.23.0 k8s.io/code-generator k8s.io/code-generator/cmd/applyconfiguration-gen k8s.io/code-generator/cmd/applyconfiguration-gen/args @@ -2514,15 +2515,7 @@ k8s.io/component-base/version ## explicit; go 1.22.0 k8s.io/endpointslice/metrics k8s.io/endpointslice/util -# k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 -## explicit; go 1.13 -k8s.io/gengo/args -k8s.io/gengo/examples/set-gen/sets -k8s.io/gengo/generator -k8s.io/gengo/namer -k8s.io/gengo/parser -k8s.io/gengo/types -# k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 +# k8s.io/gengo/v2 v2.0.0-20240911193312-2b36238f13e9 ## explicit; go 1.20 k8s.io/gengo/v2 k8s.io/gengo/v2/generator @@ -2538,7 +2531,7 @@ k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler -# k8s.io/kube-openapi v0.0.0-20240423202451-8948a665c108 +# k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 ## explicit; go 1.20 k8s.io/kube-openapi/cmd/openapi-gen k8s.io/kube-openapi/cmd/openapi-gen/args @@ -2641,7 +2634,7 @@ sigs.k8s.io/controller-runtime/pkg/webhook/admission sigs.k8s.io/controller-runtime/pkg/webhook/admission/metrics sigs.k8s.io/controller-runtime/pkg/webhook/conversion sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics -# sigs.k8s.io/controller-tools v0.16.3 => github.com/cilium/controller-tools v0.16.1-1 +# sigs.k8s.io/controller-tools v0.16.4-0.20240923084800-3b70a40398f4 => github.com/sayboras/controller-tools v0.0.0-20240925150353-20695830368c ## explicit; go 1.22.0 sigs.k8s.io/controller-tools/cmd/controller-gen sigs.k8s.io/controller-tools/pkg/crd @@ -2787,4 +2780,5 @@ sigs.k8s.io/yaml sigs.k8s.io/yaml/goyaml.v2 sigs.k8s.io/yaml/goyaml.v3 # go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20220829170633-5d7dfb1129f7 -# sigs.k8s.io/controller-tools => github.com/cilium/controller-tools v0.16.1-1 +# k8s.io/code-generator => k8s.io/code-generator v0.30.0-alpha.3.0.20240920005538-61df8a8f0355 +# sigs.k8s.io/controller-tools => github.com/sayboras/controller-tools v0.0.0-20240925150353-20695830368c diff --git a/vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go b/vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go index 55fdc1f8e6f20..4e76234460e35 100644 --- a/vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go +++ b/vendor/sigs.k8s.io/controller-tools/pkg/crd/schema.go @@ -266,7 +266,7 @@ func localNamedToSchema(ctx *schemaContext, ident *ast.Ident) *apiext.JSONSchema } // NB(directxman12): if there are dot imports, this might be an external reference, // so use typechecking info to get the actual object - typeNameInfo := typeInfo.(*types.Named).Obj() + typeNameInfo := typeInfo.(interface{ Obj() *types.TypeName }).Obj() pkg := typeNameInfo.Pkg() pkgPath := loader.NonVendorPath(pkg.Path()) if pkg == ctx.pkg.Types {