diff --git a/.config/api-rules/violation_exceptions.list b/.config/api-rules/violation_exceptions.list index 53944b987d..04e5a4a698 100644 --- a/.config/api-rules/violation_exceptions.list +++ b/.config/api-rules/violation_exceptions.list @@ -1,7 +1,3 @@ -API rule violation: list_type_missing,k8s.io/api/core/v1,RangeAllocation,Data -API rule violation: list_type_missing,k8s.io/apimachinery/pkg/apis/meta/v1,FieldsV1,Raw -API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,RawExtension,Raw -API rule violation: list_type_missing,k8s.io/apimachinery/pkg/runtime,Unknown,Raw API rule violation: list_type_missing,kmodules.xyz/client-go/api/v1,CertificateSpec,DNSNames API rule violation: list_type_missing,kmodules.xyz/client-go/api/v1,CertificateSpec,EmailAddresses API rule violation: list_type_missing,kmodules.xyz/client-go/api/v1,CertificateSpec,IPAddresses @@ -119,8 +115,17 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString, API rule violation: names_match,kmodules.xyz/client-go/api/v1,CertificateSpec,URIs API rule violation: names_match,kmodules.xyz/client-go/api/v1,TimeOfDay,Time API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,ContainerRuntimeSettings,IONice +API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,PersistentVolumeClaim,PartialObjectMeta +API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,PersistentVolumeClaimTemplate,PartialObjectMeta +API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,PodTemplateSpec,ObjectMeta +API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,ServiceTemplateSpec,ObjectMeta API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,VolumeSource,CephFS API rule violation: names_match,kmodules.xyz/offshoot-api/api/v1,VolumeSource,StorageOS API rule violation: names_match,kmodules.xyz/resource-metadata/apis/shared,Action,OperationID API rule violation: names_match,kmodules.xyz/resource-metadata/apis/shared,ActionTemplate,OperationID API rule violation: names_match,kmodules.xyz/resource-metadata/apis/shared,RegistryProxies,AppsCode +API rule violation: streaming_list_type_json_tags,kmodules.xyz/resource-metadata/apis/ui/v1alpha1,FeatureList,Items +API rule violation: streaming_list_type_json_tags,kmodules.xyz/resource-metadata/apis/ui/v1alpha1,FeatureSetList,Items +API rule violation: streaming_list_type_json_tags,kmodules.xyz/resource-metadata/apis/ui/v1alpha1,ResourceDashboardList,Items +API rule violation: streaming_list_type_json_tags,kmodules.xyz/resource-metadata/apis/ui/v1alpha1,ResourceEditorList,Items +API rule violation: streaming_list_type_json_tags,kmodules.xyz/resource-metadata/apis/ui/v1alpha1,ResourceOutlineFilterList,Items diff --git a/Makefile b/Makefile index 77668f5d47..820fd0b057 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ COMPRESS ?= no # Produce CRDs that work back to Kubernetes 1.11 (no version conversion) # CRD_OPTIONS ?= "crd:trivialVersions=true" CRD_OPTIONS ?= "crd:allowDangerousTypes=true,crdVersions={v1}" -CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.32 +CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.34 API_GROUPS ?= core:v1alpha1 editor:v1alpha1 identity:v1alpha1 management:v1alpha1 meta:v1alpha1 node:v1alpha1 ui:v1alpha1 # Where to push the docker image. @@ -130,9 +130,23 @@ version: @echo commit_hash=$(commit_hash) @echo commit_timestamp=$(commit_timestamp) -# Generate code for Kubernetes types -.PHONY: clientset -clientset: +# Generate code for Kubernetes types, using update-codegen.sh -- a generic +# script bundled into $(CODE_GENERATOR_IMAGE) (see +# https://github.com/appscodelabs/gengo-builder/blob/master/scripts/update-codegen.sh +# for the full env-var interface) driving k8s.io/code-generator's +# kube_codegen.sh toolchain. Generation scope is configured entirely through +# the env vars below rather than a repo-local copy of this script. +# GENERATORS is scoped to deepcopy+client only (no lister/informer), matching +# what the old generate-groups.sh call here actually generated. apis/shared +# has no client of its own (it's not part of API_GROUPS) but still needs +# deepcopy, hence EXTRA_DEEPCOPY_PKGS. Staleness is checked by verify-gen +# (which re-runs `gen`, including this target, and diffs against HEAD) +# rather than a separate verify-codegen target. +GENERATORS ?= deepcopy,client +EXTRA_DEEPCOPY_PKGS ?= $(GO_PKG)/$(REPO)/apis/shared + +.PHONY: update-codegen +update-codegen: @docker run --rm \ -u $$(id -u):$$(id -g) \ -v /tmp:/.cache \ @@ -140,55 +154,11 @@ clientset: -w $(DOCKER_REPO_ROOT) \ --env HTTP_PROXY=$(HTTP_PROXY) \ --env HTTPS_PROXY=$(HTTPS_PROXY) \ + --env API_GROUPS="$(API_GROUPS)" \ + --env GENERATORS="$(GENERATORS)" \ + --env EXTRA_DEEPCOPY_PKGS="$(EXTRA_DEEPCOPY_PKGS)" \ $(CODE_GENERATOR_IMAGE) \ - deepcopy-gen \ - --go-header-file "./hack/license/go.txt" \ - --input-dirs "$(GO_PKG)/$(REPO)/apis/shared" \ - --output-file-base zz_generated.deepcopy - @docker run --rm \ - -u $$(id -u):$$(id -g) \ - -v /tmp:/.cache \ - -v $$(pwd):$(DOCKER_REPO_ROOT) \ - -w $(DOCKER_REPO_ROOT) \ - --env HTTP_PROXY=$(HTTP_PROXY) \ - --env HTTPS_PROXY=$(HTTPS_PROXY) \ - $(CODE_GENERATOR_IMAGE) \ - /go/src/k8s.io/code-generator/generate-groups.sh \ - deepcopy,client \ - $(GO_PKG)/$(REPO)/client \ - $(GO_PKG)/$(REPO)/apis \ - "$(API_GROUPS)" \ - --go-header-file "./hack/license/go.txt" -# @docker run --rm \ -# -u $$(id -u):$$(id -g) \ -# -v /tmp:/.cache \ -# -v $$(pwd):$(DOCKER_REPO_ROOT) \ -# -w $(DOCKER_REPO_ROOT) \ -# --env HTTP_PROXY=$(HTTP_PROXY) \ -# --env HTTPS_PROXY=$(HTTPS_PROXY) \ -# $(CODE_GENERATOR_IMAGE) \ -# /go/src/k8s.io/code-generator/generate-internal-groups.sh \ -# "conversion" \ -# $(GO_PKG)/$(REPO)/client \ -# $(GO_PKG)/$(REPO)/apis \ -# $(GO_PKG)/$(REPO)/apis \ -# "$(API_GROUPS)" \ -# --go-header-file "./hack/license/go.txt" --extra-dirs k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 -# # for both CRD and EAS types -# @docker run --rm \ -# -u $$(id -u):$$(id -g) \ -# -v /tmp:/.cache \ -# -v $$(pwd):$(DOCKER_REPO_ROOT) \ -# -w $(DOCKER_REPO_ROOT) \ -# --env HTTP_PROXY=$(HTTP_PROXY) \ -# --env HTTPS_PROXY=$(HTTPS_PROXY) \ -# $(CODE_GENERATOR_IMAGE) \ -# /go/src/k8s.io/code-generator/generate-groups.sh \ -# all \ -# $(GO_PKG)/$(REPO)/client \ -# $(GO_PKG)/$(REPO)/apis \ -# "$(API_GROUPS)" \ -# --go-header-file "./hack/license/go.txt" + update-codegen.sh # Generate openapi schema .PHONY: openapi @@ -206,9 +176,11 @@ openapi-shared: openapi-gen \ --v 1 --logtostderr \ --go-header-file "./hack/license/go.txt" \ - --input-dirs "$(GO_PKG)/$(REPO)/apis/shared" \ - --output-package "$(GO_PKG)/$(REPO)/apis/shared" \ - --report-filename /tmp/violation_exceptions.list + --output-dir "$(DOCKER_REPO_ROOT)/apis/shared" \ + --output-pkg "$(GO_PKG)/$(REPO)/apis/shared" \ + --output-file "openapi_generated.go" \ + --report-filename /tmp/violation_exceptions.list \ + $(GO_PKG)/$(REPO)/apis/shared openapi-%: @echo "Generating openapi schema for $(subst _,/,$*)" @mkdir -p .config/api-rules @@ -223,9 +195,20 @@ openapi-%: openapi-gen \ --v 1 --logtostderr \ --go-header-file "./hack/license/go.txt" \ - --input-dirs "$(GO_PKG)/$(REPO)/apis/$(subst _,/,$*),$(GO_PKG)/$(REPO)/apis/shared,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/api/resource,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version,k8s.io/api/core/v1,k8s.io/apimachinery/pkg/util/intstr,kmodules.xyz/client-go/api/v1,go.bytebuilders.dev/catalog/api/v1alpha1,kmodules.xyz/offshoot-api/api/v1" \ - --output-package "$(GO_PKG)/$(REPO)/apis/$(subst _,/,$*)" \ - --report-filename .config/api-rules/violation_exceptions.list + --output-dir "$(DOCKER_REPO_ROOT)/apis/$(subst _,/,$*)" \ + --output-pkg "$(GO_PKG)/$(REPO)/apis/$(subst _,/,$*)" \ + --output-file "openapi_generated.go" \ + --report-filename .config/api-rules/violation_exceptions.list \ + $(GO_PKG)/$(REPO)/apis/$(subst _,/,$*) \ + $(GO_PKG)/$(REPO)/apis/shared \ + k8s.io/apimachinery/pkg/apis/meta/v1 \ + k8s.io/apimachinery/pkg/api/resource \ + k8s.io/apimachinery/pkg/runtime \ + k8s.io/apimachinery/pkg/version \ + k8s.io/api/core/v1 \ + k8s.io/apimachinery/pkg/util/intstr \ + kmodules.xyz/client-go/api/v1 \ + kmodules.xyz/offshoot-api/api/v1 # Generate CRD manifests .PHONY: gen-crds @@ -254,7 +237,7 @@ patch-schema: $(BUILD_DIRS) @mv bin/core.k8s.appscode.com_podviews.yaml crds/core.k8s.appscode.com_podviews.yaml .PHONY: gen -gen: clientset manifests openapi +gen: update-codegen manifests openapi fmt: $(BUILD_DIRS) @docker run \ diff --git a/apis/core/v1alpha1/openapi_generated.go b/apis/core/v1alpha1/openapi_generated.go index b4558e12f1..496fe15b7e 100644 --- a/apis/core/v1alpha1/openapi_generated.go +++ b/apis/core/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2311,6 +2309,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2353,6 +2352,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7278,6 +7278,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7375,6 +7376,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7448,6 +7450,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7899,6 +7902,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8415,6 +8419,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9657,7 +9662,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11272,6 +11277,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12786,10 +12792,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12827,6 +12833,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19246,10 +19253,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/apis/editor/v1alpha1/openapi_generated.go b/apis/editor/v1alpha1/openapi_generated.go index ee169f2e2a..f932bd35a8 100644 --- a/apis/editor/v1alpha1/openapi_generated.go +++ b/apis/editor/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2284,6 +2282,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2326,6 +2325,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7251,6 +7251,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7348,6 +7349,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7421,6 +7423,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7872,6 +7875,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8388,6 +8392,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9630,7 +9635,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11245,6 +11250,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12759,10 +12765,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12800,6 +12806,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19219,10 +19226,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/apis/identity/v1alpha1/openapi_generated.go b/apis/identity/v1alpha1/openapi_generated.go index 42e1423306..f5c96ed6f4 100644 --- a/apis/identity/v1alpha1/openapi_generated.go +++ b/apis/identity/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2301,6 +2299,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2343,6 +2342,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7268,6 +7268,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7365,6 +7366,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7438,6 +7440,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7889,6 +7892,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8405,6 +8409,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9647,7 +9652,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11262,6 +11267,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12776,10 +12782,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12817,6 +12823,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19236,10 +19243,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/apis/management/v1alpha1/openapi_generated.go b/apis/management/v1alpha1/openapi_generated.go index 02f3e954a8..24e04212ce 100644 --- a/apis/management/v1alpha1/openapi_generated.go +++ b/apis/management/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2286,6 +2284,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2328,6 +2327,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7253,6 +7253,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7350,6 +7351,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7423,6 +7425,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7874,6 +7877,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8390,6 +8394,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9632,7 +9637,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11247,6 +11252,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12761,10 +12767,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12802,6 +12808,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19221,10 +19228,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/apis/meta/v1alpha1/openapi_generated.go b/apis/meta/v1alpha1/openapi_generated.go index a54d24cf35..c500d376e8 100644 --- a/apis/meta/v1alpha1/openapi_generated.go +++ b/apis/meta/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2384,6 +2382,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2426,6 +2425,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7351,6 +7351,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7448,6 +7449,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7521,6 +7523,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7972,6 +7975,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8488,6 +8492,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9730,7 +9735,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11345,6 +11350,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12859,10 +12865,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12900,6 +12906,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19319,10 +19326,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -24463,12 +24470,14 @@ func schema_resource_metadata_apis_meta_v1alpha1_TableCell(ref common.ReferenceC "data": { SchemaProps: spec.SchemaProps{ Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", - Ref: ref("any"), + Type: []string{"object"}, + Format: "", }, }, "sort": { SchemaProps: spec.SchemaProps{ - Ref: ref("any"), + Type: []string{"object"}, + Format: "", }, }, "link": { @@ -24499,8 +24508,6 @@ func schema_resource_metadata_apis_meta_v1alpha1_TableCell(ref common.ReferenceC Required: []string{"data"}, }, }, - Dependencies: []string{ - "any"}, } } diff --git a/apis/node/v1alpha1/openapi_generated.go b/apis/node/v1alpha1/openapi_generated.go index 514eaa9c98..a36f4f80ef 100644 --- a/apis/node/v1alpha1/openapi_generated.go +++ b/apis/node/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2285,6 +2283,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2327,6 +2326,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7252,6 +7252,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7349,6 +7350,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7422,6 +7424,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7873,6 +7876,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8389,6 +8393,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9631,7 +9636,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11246,6 +11251,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12760,10 +12766,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12801,6 +12807,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19220,10 +19227,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/apis/shared/openapi_generated.go b/apis/shared/openapi_generated.go index 7971514165..1af3f833a2 100644 --- a/apis/shared/openapi_generated.go +++ b/apis/shared/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package shared import ( diff --git a/apis/ui/v1alpha1/openapi_generated.go b/apis/ui/v1alpha1/openapi_generated.go index 119fc62db9..9db2c4ff9d 100644 --- a/apis/ui/v1alpha1/openapi_generated.go +++ b/apis/ui/v1alpha1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1alpha1 import ( @@ -2315,6 +2313,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) }, }, }, + Required: []string{"action"}, }, }, Dependencies: []string{ @@ -2357,6 +2356,7 @@ func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.Referen }, }, }, + Required: []string{"operator"}, }, }, } @@ -7282,6 +7282,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7379,6 +7380,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -7452,6 +7454,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ControllerResizeInProgress", "ControllerResizeInfeasible", "NodeResizeInProgress", "NodeResizeInfeasible", "NodeResizePending"}, }, }, }, @@ -7903,6 +7906,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce", "ReadWriteOncePod"}, }, }, }, @@ -8419,6 +8423,7 @@ func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallb }, }, }, + Required: []string{"signerName", "keyType"}, }, }, } @@ -9661,7 +9666,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "setHostnameAsFQDN": { SchemaProps: spec.SchemaProps{ - Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", + Description: "If true the pod's hostname will be configured as the pod's FQDN, rather than the leaf name (the default). In Linux containers, this means setting the FQDN in the hostname field of the kernel (the nodename field of struct utsname). In Windows containers, this means setting the registry value of hostname for the registry key HKEY_LOCAL_MACHINE\\\\SYSTEM\\\\CurrentControlSet\\\\Services\\\\Tcpip\\\\Parameters to FQDN. If a pod does not have FQDN, this has no effect. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -11276,6 +11281,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, }, @@ -12790,10 +12796,10 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { @@ -12831,6 +12837,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Default: "", Type: []string{"string"}, Format: "", + Enum: []interface{}{"", "IPv4", "IPv6"}, }, }, }, @@ -19250,10 +19257,10 @@ func schema_kmodulesxyz_offshoot_api_api_v1_ServiceSpec(ref common.ReferenceCall }, "externalTrafficPolicy": { SchemaProps: spec.SchemaProps{ - Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", + Description: "externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. \"Local\" preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. \"Cluster\" obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, }, }, "healthCheckNodePort": { diff --git a/client/clientset/versioned/clientset.go b/client/clientset/versioned/clientset.go index e7075535cf..b9474ff3ac 100644 --- a/client/clientset/versioned/clientset.go +++ b/client/clientset/versioned/clientset.go @@ -19,12 +19,9 @@ limitations under the License. package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" editorv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/editor/v1alpha1" identityv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" @@ -32,6 +29,10 @@ import ( metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" nodev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/node/v1alpha1" uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" ) type Interface interface { diff --git a/client/clientset/versioned/fake/clientset_generated.go b/client/clientset/versioned/fake/clientset_generated.go index 57e757ad55..d8e103e09c 100644 --- a/client/clientset/versioned/fake/clientset_generated.go +++ b/client/clientset/versioned/fake/clientset_generated.go @@ -19,11 +19,6 @@ limitations under the License. package fake import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/discovery" - fakediscovery "k8s.io/client-go/discovery/fake" - "k8s.io/client-go/testing" clientset "kmodules.xyz/resource-metadata/client/clientset/versioned" corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" fakecorev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1/fake" @@ -39,12 +34,23 @@ import ( fakenodev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/node/v1alpha1/fake" uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" fakeuiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1/fake" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. // It's backed by a very simple object tracker that processes creates, updates and deletions as-is, -// without applying any validations and/or defaults. It shouldn't be considered a replacement +// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement // for a real clientset and is mostly useful in simple unit tests. +// +// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves +// server side apply testing. NewClientset is only available when apply configurations are generated (e.g. +// via --with-applyconfig). func NewSimpleClientset(objects ...runtime.Object) *Clientset { o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) for _, obj := range objects { @@ -57,9 +63,13 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} cs.AddReactor("*", "*", testing.ObjectReaction(o)) cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + var opts metav1.ListOptions + if watchActcion, ok := action.(testing.WatchActionImpl); ok { + opts = watchActcion.ListOptions + } gvr := action.GetResource() ns := action.GetNamespace() - watch, err := o.Watch(gvr, ns) + watch, err := o.Watch(gvr, ns, opts) if err != nil { return false, nil, err } diff --git a/client/clientset/versioned/fake/register.go b/client/clientset/versioned/fake/register.go index 5934b876a4..691e005c1f 100644 --- a/client/clientset/versioned/fake/register.go +++ b/client/clientset/versioned/fake/register.go @@ -19,11 +19,6 @@ limitations under the License. package fake import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" editorv1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" @@ -31,6 +26,12 @@ import ( metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" nodev1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var scheme = runtime.NewScheme() diff --git a/client/clientset/versioned/scheme/register.go b/client/clientset/versioned/scheme/register.go index ac488df9cb..cda227a93c 100644 --- a/client/clientset/versioned/scheme/register.go +++ b/client/clientset/versioned/scheme/register.go @@ -19,11 +19,6 @@ limitations under the License. package scheme import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - schema "k8s.io/apimachinery/pkg/runtime/schema" - serializer "k8s.io/apimachinery/pkg/runtime/serializer" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" editorv1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" @@ -31,6 +26,12 @@ import ( metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" nodev1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var Scheme = runtime.NewScheme() diff --git a/client/clientset/versioned/typed/core/v1alpha1/core_client.go b/client/clientset/versioned/typed/core/v1alpha1/core_client.go index 9ac3ac794f..31677c33e7 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/core_client.go +++ b/client/clientset/versioned/typed/core/v1alpha1/core_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type CoreV1alpha1Interface interface { @@ -65,9 +66,7 @@ func (c *CoreV1alpha1Client) ResourceSummaries(namespace string) ResourceSummary // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*CoreV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -79,9 +78,7 @@ func NewForConfig(c *rest.Config) (*CoreV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoreV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -104,17 +101,15 @@ func New(c rest.Interface) *CoreV1alpha1Client { return &CoreV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := corev1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_core_client.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_core_client.go index b9e4a84814..dc8207dd57 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_core_client.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_core_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" ) type FakeCoreV1alpha1 struct { @@ -29,23 +30,23 @@ type FakeCoreV1alpha1 struct { } func (c *FakeCoreV1alpha1) GenericResources(namespace string) v1alpha1.GenericResourceInterface { - return &FakeGenericResources{c, namespace} + return newFakeGenericResources(c, namespace) } func (c *FakeCoreV1alpha1) GenericResourceServices(namespace string) v1alpha1.GenericResourceServiceInterface { - return &FakeGenericResourceServices{c, namespace} + return newFakeGenericResourceServices(c, namespace) } func (c *FakeCoreV1alpha1) PodViews(namespace string) v1alpha1.PodViewInterface { - return &FakePodViews{c, namespace} + return newFakePodViews(c, namespace) } func (c *FakeCoreV1alpha1) Projects() v1alpha1.ProjectInterface { - return &FakeProjects{c} + return newFakeProjects(c) } func (c *FakeCoreV1alpha1) ResourceSummaries(namespace string) v1alpha1.ResourceSummaryInterface { - return &FakeResourceSummaries{c, namespace} + return newFakeResourceSummaries(c, namespace) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresource.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresource.go index d81b68abb0..7c6c2bcfa3 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresource.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresource.go @@ -19,53 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeGenericResources implements GenericResourceInterface -type FakeGenericResources struct { +// fakeGenericResources implements GenericResourceInterface +type fakeGenericResources struct { + *gentype.FakeClientWithList[*v1alpha1.GenericResource, *v1alpha1.GenericResourceList] Fake *FakeCoreV1alpha1 - ns string -} - -var genericresourcesResource = v1alpha1.SchemeGroupVersion.WithResource("genericresources") - -var genericresourcesKind = v1alpha1.SchemeGroupVersion.WithKind("GenericResource") - -// Get takes name of the genericResource, and returns the corresponding genericResource object, and an error if there is any. -func (c *FakeGenericResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GenericResource, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(genericresourcesResource, c.ns, name), &v1alpha1.GenericResource{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.GenericResource), err } -// List takes label and field selectors, and returns the list of GenericResources that match those selectors. -func (c *FakeGenericResources) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GenericResourceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(genericresourcesResource, genericresourcesKind, c.ns, opts), &v1alpha1.GenericResourceList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.GenericResourceList{ListMeta: obj.(*v1alpha1.GenericResourceList).ListMeta} - for _, item := range obj.(*v1alpha1.GenericResourceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } +func newFakeGenericResources(fake *FakeCoreV1alpha1, namespace string) corev1alpha1.GenericResourceInterface { + return &fakeGenericResources{ + gentype.NewFakeClientWithList[*v1alpha1.GenericResource, *v1alpha1.GenericResourceList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("genericresources"), + v1alpha1.SchemeGroupVersion.WithKind("GenericResource"), + func() *v1alpha1.GenericResource { return &v1alpha1.GenericResource{} }, + func() *v1alpha1.GenericResourceList { return &v1alpha1.GenericResourceList{} }, + func(dst, src *v1alpha1.GenericResourceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.GenericResourceList) []*v1alpha1.GenericResource { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.GenericResourceList, items []*v1alpha1.GenericResource) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return list, err } diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresourceservice.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresourceservice.go index 3e4751fae2..f1945e2e83 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresourceservice.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_genericresourceservice.go @@ -19,53 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeGenericResourceServices implements GenericResourceServiceInterface -type FakeGenericResourceServices struct { +// fakeGenericResourceServices implements GenericResourceServiceInterface +type fakeGenericResourceServices struct { + *gentype.FakeClientWithList[*v1alpha1.GenericResourceService, *v1alpha1.GenericResourceServiceList] Fake *FakeCoreV1alpha1 - ns string -} - -var genericresourceservicesResource = v1alpha1.SchemeGroupVersion.WithResource("genericresourceservices") - -var genericresourceservicesKind = v1alpha1.SchemeGroupVersion.WithKind("GenericResourceService") - -// Get takes name of the genericResourceService, and returns the corresponding genericResourceService object, and an error if there is any. -func (c *FakeGenericResourceServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GenericResourceService, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(genericresourceservicesResource, c.ns, name), &v1alpha1.GenericResourceService{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.GenericResourceService), err } -// List takes label and field selectors, and returns the list of GenericResourceServices that match those selectors. -func (c *FakeGenericResourceServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GenericResourceServiceList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(genericresourceservicesResource, genericresourceservicesKind, c.ns, opts), &v1alpha1.GenericResourceServiceList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.GenericResourceServiceList{ListMeta: obj.(*v1alpha1.GenericResourceServiceList).ListMeta} - for _, item := range obj.(*v1alpha1.GenericResourceServiceList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } +func newFakeGenericResourceServices(fake *FakeCoreV1alpha1, namespace string) corev1alpha1.GenericResourceServiceInterface { + return &fakeGenericResourceServices{ + gentype.NewFakeClientWithList[*v1alpha1.GenericResourceService, *v1alpha1.GenericResourceServiceList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("genericresourceservices"), + v1alpha1.SchemeGroupVersion.WithKind("GenericResourceService"), + func() *v1alpha1.GenericResourceService { return &v1alpha1.GenericResourceService{} }, + func() *v1alpha1.GenericResourceServiceList { return &v1alpha1.GenericResourceServiceList{} }, + func(dst, src *v1alpha1.GenericResourceServiceList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.GenericResourceServiceList) []*v1alpha1.GenericResourceService { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.GenericResourceServiceList, items []*v1alpha1.GenericResourceService) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return list, err } diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_podview.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_podview.go index a81d41712e..db5d924fc1 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_podview.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_podview.go @@ -19,53 +19,33 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakePodViews implements PodViewInterface -type FakePodViews struct { +// fakePodViews implements PodViewInterface +type fakePodViews struct { + *gentype.FakeClientWithList[*v1alpha1.PodView, *v1alpha1.PodViewList] Fake *FakeCoreV1alpha1 - ns string -} - -var podviewsResource = v1alpha1.SchemeGroupVersion.WithResource("podviews") - -var podviewsKind = v1alpha1.SchemeGroupVersion.WithKind("PodView") - -// Get takes name of the podView, and returns the corresponding podView object, and an error if there is any. -func (c *FakePodViews) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PodView, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(podviewsResource, c.ns, name), &v1alpha1.PodView{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.PodView), err } -// List takes label and field selectors, and returns the list of PodViews that match those selectors. -func (c *FakePodViews) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PodViewList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(podviewsResource, podviewsKind, c.ns, opts), &v1alpha1.PodViewList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.PodViewList{ListMeta: obj.(*v1alpha1.PodViewList).ListMeta} - for _, item := range obj.(*v1alpha1.PodViewList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } +func newFakePodViews(fake *FakeCoreV1alpha1, namespace string) corev1alpha1.PodViewInterface { + return &fakePodViews{ + gentype.NewFakeClientWithList[*v1alpha1.PodView, *v1alpha1.PodViewList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("podviews"), + v1alpha1.SchemeGroupVersion.WithKind("PodView"), + func() *v1alpha1.PodView { return &v1alpha1.PodView{} }, + func() *v1alpha1.PodViewList { return &v1alpha1.PodViewList{} }, + func(dst, src *v1alpha1.PodViewList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.PodViewList) []*v1alpha1.PodView { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.PodViewList, items []*v1alpha1.PodView) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return list, err } diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_project.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_project.go index 3c84828432..b01bfbad4e 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_project.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_project.go @@ -19,50 +19,33 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeProjects implements ProjectInterface -type FakeProjects struct { +// fakeProjects implements ProjectInterface +type fakeProjects struct { + *gentype.FakeClientWithList[*v1alpha1.Project, *v1alpha1.ProjectList] Fake *FakeCoreV1alpha1 } -var projectsResource = v1alpha1.SchemeGroupVersion.WithResource("projects") - -var projectsKind = v1alpha1.SchemeGroupVersion.WithKind("Project") - -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *FakeProjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Project, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(projectsResource, name), &v1alpha1.Project{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Project), err -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *FakeProjects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ProjectList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(projectsResource, projectsKind, opts), &v1alpha1.ProjectList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ProjectList{ListMeta: obj.(*v1alpha1.ProjectList).ListMeta} - for _, item := range obj.(*v1alpha1.ProjectList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } +func newFakeProjects(fake *FakeCoreV1alpha1) corev1alpha1.ProjectInterface { + return &fakeProjects{ + gentype.NewFakeClientWithList[*v1alpha1.Project, *v1alpha1.ProjectList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("projects"), + v1alpha1.SchemeGroupVersion.WithKind("Project"), + func() *v1alpha1.Project { return &v1alpha1.Project{} }, + func() *v1alpha1.ProjectList { return &v1alpha1.ProjectList{} }, + func(dst, src *v1alpha1.ProjectList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ProjectList) []*v1alpha1.Project { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.ProjectList, items []*v1alpha1.Project) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return list, err } diff --git a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_resourcesummary.go b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_resourcesummary.go index 9b1a751f86..eb3785a6c0 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/fake/fake_resourcesummary.go +++ b/client/clientset/versioned/typed/core/v1alpha1/fake/fake_resourcesummary.go @@ -19,53 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/core/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceSummaries implements ResourceSummaryInterface -type FakeResourceSummaries struct { +// fakeResourceSummaries implements ResourceSummaryInterface +type fakeResourceSummaries struct { + *gentype.FakeClientWithList[*v1alpha1.ResourceSummary, *v1alpha1.ResourceSummaryList] Fake *FakeCoreV1alpha1 - ns string -} - -var resourcesummariesResource = v1alpha1.SchemeGroupVersion.WithResource("resourcesummaries") - -var resourcesummariesKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceSummary") - -// Get takes name of the resourceSummary, and returns the corresponding resourceSummary object, and an error if there is any. -func (c *FakeResourceSummaries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceSummary, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(resourcesummariesResource, c.ns, name), &v1alpha1.ResourceSummary{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceSummary), err } -// List takes label and field selectors, and returns the list of ResourceSummaries that match those selectors. -func (c *FakeResourceSummaries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceSummaryList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(resourcesummariesResource, resourcesummariesKind, c.ns, opts), &v1alpha1.ResourceSummaryList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ResourceSummaryList{ListMeta: obj.(*v1alpha1.ResourceSummaryList).ListMeta} - for _, item := range obj.(*v1alpha1.ResourceSummaryList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } +func newFakeResourceSummaries(fake *FakeCoreV1alpha1, namespace string) corev1alpha1.ResourceSummaryInterface { + return &fakeResourceSummaries{ + gentype.NewFakeClientWithList[*v1alpha1.ResourceSummary, *v1alpha1.ResourceSummaryList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("resourcesummaries"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceSummary"), + func() *v1alpha1.ResourceSummary { return &v1alpha1.ResourceSummary{} }, + func() *v1alpha1.ResourceSummaryList { return &v1alpha1.ResourceSummaryList{} }, + func(dst, src *v1alpha1.ResourceSummaryList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ResourceSummaryList) []*v1alpha1.ResourceSummary { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ResourceSummaryList, items []*v1alpha1.ResourceSummary) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return list, err } diff --git a/client/clientset/versioned/typed/core/v1alpha1/genericresource.go b/client/clientset/versioned/typed/core/v1alpha1/genericresource.go index e78637af3f..eb2b01a765 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/genericresource.go +++ b/client/clientset/versioned/typed/core/v1alpha1/genericresource.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // GenericResourcesGetter has a method to return a GenericResourceInterface. @@ -36,51 +36,26 @@ type GenericResourcesGetter interface { // GenericResourceInterface has methods to work with GenericResource resources. type GenericResourceInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.GenericResource, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.GenericResourceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1alpha1.GenericResource, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1alpha1.GenericResourceList, error) GenericResourceExpansion } // genericResources implements GenericResourceInterface type genericResources struct { - client rest.Interface - ns string + *gentype.ClientWithList[*corev1alpha1.GenericResource, *corev1alpha1.GenericResourceList] } // newGenericResources returns a GenericResources func newGenericResources(c *CoreV1alpha1Client, namespace string) *genericResources { return &genericResources{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the genericResource, and returns the corresponding genericResource object, and an error if there is any. -func (c *genericResources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GenericResource, err error) { - result = &v1alpha1.GenericResource{} - err = c.client.Get(). - Namespace(c.ns). - Resource("genericresources"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GenericResources that match those selectors. -func (c *genericResources) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GenericResourceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*corev1alpha1.GenericResource, *corev1alpha1.GenericResourceList]( + "genericresources", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1alpha1.GenericResource { return &corev1alpha1.GenericResource{} }, + func() *corev1alpha1.GenericResourceList { return &corev1alpha1.GenericResourceList{} }, + ), } - result = &v1alpha1.GenericResourceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("genericresources"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/core/v1alpha1/genericresourceservice.go b/client/clientset/versioned/typed/core/v1alpha1/genericresourceservice.go index 891f2948d8..d78d4f7caa 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/genericresourceservice.go +++ b/client/clientset/versioned/typed/core/v1alpha1/genericresourceservice.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // GenericResourceServicesGetter has a method to return a GenericResourceServiceInterface. @@ -36,51 +36,26 @@ type GenericResourceServicesGetter interface { // GenericResourceServiceInterface has methods to work with GenericResourceService resources. type GenericResourceServiceInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.GenericResourceService, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.GenericResourceServiceList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1alpha1.GenericResourceService, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1alpha1.GenericResourceServiceList, error) GenericResourceServiceExpansion } // genericResourceServices implements GenericResourceServiceInterface type genericResourceServices struct { - client rest.Interface - ns string + *gentype.ClientWithList[*corev1alpha1.GenericResourceService, *corev1alpha1.GenericResourceServiceList] } // newGenericResourceServices returns a GenericResourceServices func newGenericResourceServices(c *CoreV1alpha1Client, namespace string) *genericResourceServices { return &genericResourceServices{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the genericResourceService, and returns the corresponding genericResourceService object, and an error if there is any. -func (c *genericResourceServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.GenericResourceService, err error) { - result = &v1alpha1.GenericResourceService{} - err = c.client.Get(). - Namespace(c.ns). - Resource("genericresourceservices"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of GenericResourceServices that match those selectors. -func (c *genericResourceServices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.GenericResourceServiceList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*corev1alpha1.GenericResourceService, *corev1alpha1.GenericResourceServiceList]( + "genericresourceservices", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1alpha1.GenericResourceService { return &corev1alpha1.GenericResourceService{} }, + func() *corev1alpha1.GenericResourceServiceList { return &corev1alpha1.GenericResourceServiceList{} }, + ), } - result = &v1alpha1.GenericResourceServiceList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("genericresourceservices"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/core/v1alpha1/podview.go b/client/clientset/versioned/typed/core/v1alpha1/podview.go index 4091220c53..98f8c04149 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/podview.go +++ b/client/clientset/versioned/typed/core/v1alpha1/podview.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // PodViewsGetter has a method to return a PodViewInterface. @@ -36,51 +36,26 @@ type PodViewsGetter interface { // PodViewInterface has methods to work with PodView resources. type PodViewInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PodView, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PodViewList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1alpha1.PodView, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1alpha1.PodViewList, error) PodViewExpansion } // podViews implements PodViewInterface type podViews struct { - client rest.Interface - ns string + *gentype.ClientWithList[*corev1alpha1.PodView, *corev1alpha1.PodViewList] } // newPodViews returns a PodViews func newPodViews(c *CoreV1alpha1Client, namespace string) *podViews { return &podViews{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the podView, and returns the corresponding podView object, and an error if there is any. -func (c *podViews) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PodView, err error) { - result = &v1alpha1.PodView{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podviews"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of PodViews that match those selectors. -func (c *podViews) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PodViewList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*corev1alpha1.PodView, *corev1alpha1.PodViewList]( + "podviews", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1alpha1.PodView { return &corev1alpha1.PodView{} }, + func() *corev1alpha1.PodViewList { return &corev1alpha1.PodViewList{} }, + ), } - result = &v1alpha1.PodViewList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("podviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/core/v1alpha1/project.go b/client/clientset/versioned/typed/core/v1alpha1/project.go index 555867e76c..693c9c3dff 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/project.go +++ b/client/clientset/versioned/typed/core/v1alpha1/project.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ProjectsGetter has a method to return a ProjectInterface. @@ -36,47 +36,26 @@ type ProjectsGetter interface { // ProjectInterface has methods to work with Project resources. type ProjectInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Project, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ProjectList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1alpha1.Project, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1alpha1.ProjectList, error) ProjectExpansion } // projects implements ProjectInterface type projects struct { - client rest.Interface + *gentype.ClientWithList[*corev1alpha1.Project, *corev1alpha1.ProjectList] } // newProjects returns a Projects func newProjects(c *CoreV1alpha1Client) *projects { return &projects{ - client: c.RESTClient(), - } -} - -// Get takes name of the project, and returns the corresponding project object, and an error if there is any. -func (c *projects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Project, err error) { - result = &v1alpha1.Project{} - err = c.client.Get(). - Resource("projects"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Projects that match those selectors. -func (c *projects) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ProjectList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*corev1alpha1.Project, *corev1alpha1.ProjectList]( + "projects", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *corev1alpha1.Project { return &corev1alpha1.Project{} }, + func() *corev1alpha1.ProjectList { return &corev1alpha1.ProjectList{} }, + ), } - result = &v1alpha1.ProjectList{} - err = c.client.Get(). - Resource("projects"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/core/v1alpha1/resourcesummary.go b/client/clientset/versioned/typed/core/v1alpha1/resourcesummary.go index c5791513a8..7b6be70b41 100644 --- a/client/clientset/versioned/typed/core/v1alpha1/resourcesummary.go +++ b/client/clientset/versioned/typed/core/v1alpha1/resourcesummary.go @@ -19,13 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" + corev1alpha1 "kmodules.xyz/resource-metadata/apis/core/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceSummariesGetter has a method to return a ResourceSummaryInterface. @@ -36,51 +36,26 @@ type ResourceSummariesGetter interface { // ResourceSummaryInterface has methods to work with ResourceSummary resources. type ResourceSummaryInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceSummary, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResourceSummaryList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*corev1alpha1.ResourceSummary, error) + List(ctx context.Context, opts v1.ListOptions) (*corev1alpha1.ResourceSummaryList, error) ResourceSummaryExpansion } // resourceSummaries implements ResourceSummaryInterface type resourceSummaries struct { - client rest.Interface - ns string + *gentype.ClientWithList[*corev1alpha1.ResourceSummary, *corev1alpha1.ResourceSummaryList] } // newResourceSummaries returns a ResourceSummaries func newResourceSummaries(c *CoreV1alpha1Client, namespace string) *resourceSummaries { return &resourceSummaries{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the resourceSummary, and returns the corresponding resourceSummary object, and an error if there is any. -func (c *resourceSummaries) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceSummary, err error) { - result = &v1alpha1.ResourceSummary{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcesummaries"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceSummaries that match those selectors. -func (c *resourceSummaries) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceSummaryList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*corev1alpha1.ResourceSummary, *corev1alpha1.ResourceSummaryList]( + "resourcesummaries", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *corev1alpha1.ResourceSummary { return &corev1alpha1.ResourceSummary{} }, + func() *corev1alpha1.ResourceSummaryList { return &corev1alpha1.ResourceSummaryList{} }, + ), } - result = &v1alpha1.ResourceSummaryList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("resourcesummaries"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/editor/v1alpha1/editor_client.go b/client/clientset/versioned/typed/editor/v1alpha1/editor_client.go index 22987e7ec9..0060557c84 100644 --- a/client/clientset/versioned/typed/editor/v1alpha1/editor_client.go +++ b/client/clientset/versioned/typed/editor/v1alpha1/editor_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + editorv1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type EditorV1alpha1Interface interface { @@ -45,9 +46,7 @@ func (c *EditorV1alpha1Client) EditorModels() EditorModelInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*EditorV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +58,7 @@ func NewForConfig(c *rest.Config) (*EditorV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EditorV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,17 +81,15 @@ func New(c rest.Interface) *EditorV1alpha1Client { return &EditorV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := editorv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/editor/v1alpha1/editormodel.go b/client/clientset/versioned/typed/editor/v1alpha1/editormodel.go index 3946eb5ecb..f9ae1a950b 100644 --- a/client/clientset/versioned/typed/editor/v1alpha1/editormodel.go +++ b/client/clientset/versioned/typed/editor/v1alpha1/editormodel.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" + editorv1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // EditorModelsGetter has a method to return a EditorModelInterface. @@ -35,30 +36,24 @@ type EditorModelsGetter interface { // EditorModelInterface has methods to work with EditorModel resources. type EditorModelInterface interface { - Create(ctx context.Context, editorModel *v1alpha1.EditorModel, opts v1.CreateOptions) (*v1alpha1.EditorModel, error) + Create(ctx context.Context, editorModel *editorv1alpha1.EditorModel, opts v1.CreateOptions) (*editorv1alpha1.EditorModel, error) EditorModelExpansion } // editorModels implements EditorModelInterface type editorModels struct { - client rest.Interface + *gentype.Client[*editorv1alpha1.EditorModel] } // newEditorModels returns a EditorModels func newEditorModels(c *EditorV1alpha1Client) *editorModels { return &editorModels{ - client: c.RESTClient(), + gentype.NewClient[*editorv1alpha1.EditorModel]( + "editormodels", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *editorv1alpha1.EditorModel { return &editorv1alpha1.EditorModel{} }, + ), } } - -// Create takes the representation of a editorModel and creates it. Returns the server's representation of the editorModel, and an error, if there is any. -func (c *editorModels) Create(ctx context.Context, editorModel *v1alpha1.EditorModel, opts v1.CreateOptions) (result *v1alpha1.EditorModel, err error) { - result = &v1alpha1.EditorModel{} - err = c.client.Post(). - Resource("editormodels"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(editorModel). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editor_client.go b/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editor_client.go index d1aa371510..311133baa1 100644 --- a/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editor_client.go +++ b/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editor_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/editor/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/editor/v1alpha1" ) type FakeEditorV1alpha1 struct { @@ -29,7 +30,7 @@ type FakeEditorV1alpha1 struct { } func (c *FakeEditorV1alpha1) EditorModels() v1alpha1.EditorModelInterface { - return &FakeEditorModels{c} + return newFakeEditorModels(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editormodel.go b/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editormodel.go index c1d92ef26f..8ed3caacf8 100644 --- a/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editormodel.go +++ b/client/clientset/versioned/typed/editor/v1alpha1/fake/fake_editormodel.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/editor/v1alpha1" + editorv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/editor/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeEditorModels implements EditorModelInterface -type FakeEditorModels struct { +// fakeEditorModels implements EditorModelInterface +type fakeEditorModels struct { + *gentype.FakeClient[*v1alpha1.EditorModel] Fake *FakeEditorV1alpha1 } -var editormodelsResource = v1alpha1.SchemeGroupVersion.WithResource("editormodels") - -var editormodelsKind = v1alpha1.SchemeGroupVersion.WithKind("EditorModel") - -// Create takes the representation of a editorModel and creates it. Returns the server's representation of the editorModel, and an error, if there is any. -func (c *FakeEditorModels) Create(ctx context.Context, editorModel *v1alpha1.EditorModel, opts v1.CreateOptions) (result *v1alpha1.EditorModel, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(editormodelsResource, editorModel), &v1alpha1.EditorModel{}) - if obj == nil { - return nil, err +func newFakeEditorModels(fake *FakeEditorV1alpha1) editorv1alpha1.EditorModelInterface { + return &fakeEditorModels{ + gentype.NewFakeClient[*v1alpha1.EditorModel]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("editormodels"), + v1alpha1.SchemeGroupVersion.WithKind("EditorModel"), + func() *v1alpha1.EditorModel { return &v1alpha1.EditorModel{} }, + ), + fake, } - return obj.(*v1alpha1.EditorModel), err } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/audittokenrequest.go b/client/clientset/versioned/typed/identity/v1alpha1/audittokenrequest.go index 69614801ef..09f07fd319 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/audittokenrequest.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/audittokenrequest.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // AuditTokenRequestsGetter has a method to return a AuditTokenRequestInterface. @@ -35,30 +36,24 @@ type AuditTokenRequestsGetter interface { // AuditTokenRequestInterface has methods to work with AuditTokenRequest resources. type AuditTokenRequestInterface interface { - Create(ctx context.Context, auditTokenRequest *v1alpha1.AuditTokenRequest, opts v1.CreateOptions) (*v1alpha1.AuditTokenRequest, error) + Create(ctx context.Context, auditTokenRequest *identityv1alpha1.AuditTokenRequest, opts v1.CreateOptions) (*identityv1alpha1.AuditTokenRequest, error) AuditTokenRequestExpansion } // auditTokenRequests implements AuditTokenRequestInterface type auditTokenRequests struct { - client rest.Interface + *gentype.Client[*identityv1alpha1.AuditTokenRequest] } // newAuditTokenRequests returns a AuditTokenRequests func newAuditTokenRequests(c *IdentityV1alpha1Client) *auditTokenRequests { return &auditTokenRequests{ - client: c.RESTClient(), + gentype.NewClient[*identityv1alpha1.AuditTokenRequest]( + "audittokenrequests", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *identityv1alpha1.AuditTokenRequest { return &identityv1alpha1.AuditTokenRequest{} }, + ), } } - -// Create takes the representation of a auditTokenRequest and creates it. Returns the server's representation of the auditTokenRequest, and an error, if there is any. -func (c *auditTokenRequests) Create(ctx context.Context, auditTokenRequest *v1alpha1.AuditTokenRequest, opts v1.CreateOptions) (result *v1alpha1.AuditTokenRequest, err error) { - result = &v1alpha1.AuditTokenRequest{} - err = c.client.Post(). - Resource("audittokenrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(auditTokenRequest). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/identity/v1alpha1/clusteridentity.go b/client/clientset/versioned/typed/identity/v1alpha1/clusteridentity.go index 388680bc6f..ffb13ed545 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/clusteridentity.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/clusteridentity.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ClusterIdentitiesGetter has a method to return a ClusterIdentityInterface. @@ -38,158 +38,34 @@ type ClusterIdentitiesGetter interface { // ClusterIdentityInterface has methods to work with ClusterIdentity resources. type ClusterIdentityInterface interface { - Create(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.CreateOptions) (*v1alpha1.ClusterIdentity, error) - Update(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (*v1alpha1.ClusterIdentity, error) - UpdateStatus(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (*v1alpha1.ClusterIdentity, error) + Create(ctx context.Context, clusterIdentity *identityv1alpha1.ClusterIdentity, opts v1.CreateOptions) (*identityv1alpha1.ClusterIdentity, error) + Update(ctx context.Context, clusterIdentity *identityv1alpha1.ClusterIdentity, opts v1.UpdateOptions) (*identityv1alpha1.ClusterIdentity, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, clusterIdentity *identityv1alpha1.ClusterIdentity, opts v1.UpdateOptions) (*identityv1alpha1.ClusterIdentity, 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) (*v1alpha1.ClusterIdentity, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterIdentityList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*identityv1alpha1.ClusterIdentity, error) + List(ctx context.Context, opts v1.ListOptions) (*identityv1alpha1.ClusterIdentityList, 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 *v1alpha1.ClusterIdentity, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *identityv1alpha1.ClusterIdentity, err error) ClusterIdentityExpansion } // clusterIdentities implements ClusterIdentityInterface type clusterIdentities struct { - client rest.Interface - ns string + *gentype.ClientWithList[*identityv1alpha1.ClusterIdentity, *identityv1alpha1.ClusterIdentityList] } // newClusterIdentities returns a ClusterIdentities func newClusterIdentities(c *IdentityV1alpha1Client, namespace string) *clusterIdentities { return &clusterIdentities{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the clusterIdentity, and returns the corresponding clusterIdentity object, and an error if there is any. -func (c *clusterIdentities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterIdentity, err error) { - result = &v1alpha1.ClusterIdentity{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteridentities"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterIdentities that match those selectors. -func (c *clusterIdentities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterIdentityList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterIdentityList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("clusteridentities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterIdentities. -func (c *clusterIdentities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("clusteridentities"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterIdentity and creates it. Returns the server's representation of the clusterIdentity, and an error, if there is any. -func (c *clusterIdentities) Create(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.CreateOptions) (result *v1alpha1.ClusterIdentity, err error) { - result = &v1alpha1.ClusterIdentity{} - err = c.client.Post(). - Namespace(c.ns). - Resource("clusteridentities"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterIdentity). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterIdentity and updates it. Returns the server's representation of the clusterIdentity, and an error, if there is any. -func (c *clusterIdentities) Update(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (result *v1alpha1.ClusterIdentity, err error) { - result = &v1alpha1.ClusterIdentity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusteridentities"). - Name(clusterIdentity.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterIdentity). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *clusterIdentities) UpdateStatus(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (result *v1alpha1.ClusterIdentity, err error) { - result = &v1alpha1.ClusterIdentity{} - err = c.client.Put(). - Namespace(c.ns). - Resource("clusteridentities"). - Name(clusterIdentity.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterIdentity). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterIdentity and deletes it. Returns an error if one occurs. -func (c *clusterIdentities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteridentities"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterIdentities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*identityv1alpha1.ClusterIdentity, *identityv1alpha1.ClusterIdentityList]( + "clusteridentities", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *identityv1alpha1.ClusterIdentity { return &identityv1alpha1.ClusterIdentity{} }, + func() *identityv1alpha1.ClusterIdentityList { return &identityv1alpha1.ClusterIdentityList{} }, + ), } - return c.client.Delete(). - Namespace(c.ns). - Resource("clusteridentities"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterIdentity. -func (c *clusterIdentities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterIdentity, err error) { - result = &v1alpha1.ClusterIdentity{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("clusteridentities"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_audittokenrequest.go b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_audittokenrequest.go index ac674cfb08..81dead26d0 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_audittokenrequest.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_audittokenrequest.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeAuditTokenRequests implements AuditTokenRequestInterface -type FakeAuditTokenRequests struct { +// fakeAuditTokenRequests implements AuditTokenRequestInterface +type fakeAuditTokenRequests struct { + *gentype.FakeClient[*v1alpha1.AuditTokenRequest] Fake *FakeIdentityV1alpha1 } -var audittokenrequestsResource = v1alpha1.SchemeGroupVersion.WithResource("audittokenrequests") - -var audittokenrequestsKind = v1alpha1.SchemeGroupVersion.WithKind("AuditTokenRequest") - -// Create takes the representation of a auditTokenRequest and creates it. Returns the server's representation of the auditTokenRequest, and an error, if there is any. -func (c *FakeAuditTokenRequests) Create(ctx context.Context, auditTokenRequest *v1alpha1.AuditTokenRequest, opts v1.CreateOptions) (result *v1alpha1.AuditTokenRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(audittokenrequestsResource, auditTokenRequest), &v1alpha1.AuditTokenRequest{}) - if obj == nil { - return nil, err +func newFakeAuditTokenRequests(fake *FakeIdentityV1alpha1) identityv1alpha1.AuditTokenRequestInterface { + return &fakeAuditTokenRequests{ + gentype.NewFakeClient[*v1alpha1.AuditTokenRequest]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("audittokenrequests"), + v1alpha1.SchemeGroupVersion.WithKind("AuditTokenRequest"), + func() *v1alpha1.AuditTokenRequest { return &v1alpha1.AuditTokenRequest{} }, + ), + fake, } - return obj.(*v1alpha1.AuditTokenRequest), err } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_clusteridentity.go b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_clusteridentity.go index 17605b73a5..f40faa3d65 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_clusteridentity.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_clusteridentity.go @@ -19,123 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeClusterIdentities implements ClusterIdentityInterface -type FakeClusterIdentities struct { +// fakeClusterIdentities implements ClusterIdentityInterface +type fakeClusterIdentities struct { + *gentype.FakeClientWithList[*v1alpha1.ClusterIdentity, *v1alpha1.ClusterIdentityList] Fake *FakeIdentityV1alpha1 - ns string -} - -var clusteridentitiesResource = v1alpha1.SchemeGroupVersion.WithResource("clusteridentities") - -var clusteridentitiesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterIdentity") - -// Get takes name of the clusterIdentity, and returns the corresponding clusterIdentity object, and an error if there is any. -func (c *FakeClusterIdentities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterIdentity, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(clusteridentitiesResource, c.ns, name), &v1alpha1.ClusterIdentity{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterIdentity), err } -// List takes label and field selectors, and returns the list of ClusterIdentities that match those selectors. -func (c *FakeClusterIdentities) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterIdentityList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(clusteridentitiesResource, clusteridentitiesKind, c.ns, opts), &v1alpha1.ClusterIdentityList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterIdentityList{ListMeta: obj.(*v1alpha1.ClusterIdentityList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterIdentityList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterIdentities. -func (c *FakeClusterIdentities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(clusteridentitiesResource, c.ns, opts)) - -} - -// Create takes the representation of a clusterIdentity and creates it. Returns the server's representation of the clusterIdentity, and an error, if there is any. -func (c *FakeClusterIdentities) Create(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.CreateOptions) (result *v1alpha1.ClusterIdentity, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(clusteridentitiesResource, c.ns, clusterIdentity), &v1alpha1.ClusterIdentity{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterIdentity), err -} - -// Update takes the representation of a clusterIdentity and updates it. Returns the server's representation of the clusterIdentity, and an error, if there is any. -func (c *FakeClusterIdentities) Update(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (result *v1alpha1.ClusterIdentity, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(clusteridentitiesResource, c.ns, clusterIdentity), &v1alpha1.ClusterIdentity{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterIdentity), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterIdentities) UpdateStatus(ctx context.Context, clusterIdentity *v1alpha1.ClusterIdentity, opts v1.UpdateOptions) (*v1alpha1.ClusterIdentity, error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceAction(clusteridentitiesResource, "status", c.ns, clusterIdentity), &v1alpha1.ClusterIdentity{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterIdentity), err -} - -// Delete takes name of the clusterIdentity and deletes it. Returns an error if one occurs. -func (c *FakeClusterIdentities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(clusteridentitiesResource, c.ns, name, opts), &v1alpha1.ClusterIdentity{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterIdentities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(clusteridentitiesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterIdentityList{}) - return err -} - -// Patch applies the patch and returns the patched clusterIdentity. -func (c *FakeClusterIdentities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterIdentity, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(clusteridentitiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ClusterIdentity{}) - - if obj == nil { - return nil, err +func newFakeClusterIdentities(fake *FakeIdentityV1alpha1, namespace string) identityv1alpha1.ClusterIdentityInterface { + return &fakeClusterIdentities{ + gentype.NewFakeClientWithList[*v1alpha1.ClusterIdentity, *v1alpha1.ClusterIdentityList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("clusteridentities"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterIdentity"), + func() *v1alpha1.ClusterIdentity { return &v1alpha1.ClusterIdentity{} }, + func() *v1alpha1.ClusterIdentityList { return &v1alpha1.ClusterIdentityList{} }, + func(dst, src *v1alpha1.ClusterIdentityList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterIdentityList) []*v1alpha1.ClusterIdentity { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterIdentityList, items []*v1alpha1.ClusterIdentity) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ClusterIdentity), err } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_identity_client.go b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_identity_client.go index e730fcca84..5145a1b88c 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_identity_client.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_identity_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" ) type FakeIdentityV1alpha1 struct { @@ -29,19 +30,19 @@ type FakeIdentityV1alpha1 struct { } func (c *FakeIdentityV1alpha1) AuditTokenRequests() v1alpha1.AuditTokenRequestInterface { - return &FakeAuditTokenRequests{c} + return newFakeAuditTokenRequests(c) } func (c *FakeIdentityV1alpha1) ClusterIdentities(namespace string) v1alpha1.ClusterIdentityInterface { - return &FakeClusterIdentities{c, namespace} + return newFakeClusterIdentities(c, namespace) } func (c *FakeIdentityV1alpha1) InboxTokenRequests() v1alpha1.InboxTokenRequestInterface { - return &FakeInboxTokenRequests{c} + return newFakeInboxTokenRequests(c) } func (c *FakeIdentityV1alpha1) SelfSubjectNamespaceAccessReviews() v1alpha1.SelfSubjectNamespaceAccessReviewInterface { - return &FakeSelfSubjectNamespaceAccessReviews{c} + return newFakeSelfSubjectNamespaceAccessReviews(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_inboxtokenrequest.go b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_inboxtokenrequest.go index 69b9b6b4de..323082931c 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_inboxtokenrequest.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_inboxtokenrequest.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeInboxTokenRequests implements InboxTokenRequestInterface -type FakeInboxTokenRequests struct { +// fakeInboxTokenRequests implements InboxTokenRequestInterface +type fakeInboxTokenRequests struct { + *gentype.FakeClient[*v1alpha1.InboxTokenRequest] Fake *FakeIdentityV1alpha1 } -var inboxtokenrequestsResource = v1alpha1.SchemeGroupVersion.WithResource("inboxtokenrequests") - -var inboxtokenrequestsKind = v1alpha1.SchemeGroupVersion.WithKind("InboxTokenRequest") - -// Create takes the representation of a inboxTokenRequest and creates it. Returns the server's representation of the inboxTokenRequest, and an error, if there is any. -func (c *FakeInboxTokenRequests) Create(ctx context.Context, inboxTokenRequest *v1alpha1.InboxTokenRequest, opts v1.CreateOptions) (result *v1alpha1.InboxTokenRequest, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(inboxtokenrequestsResource, inboxTokenRequest), &v1alpha1.InboxTokenRequest{}) - if obj == nil { - return nil, err +func newFakeInboxTokenRequests(fake *FakeIdentityV1alpha1) identityv1alpha1.InboxTokenRequestInterface { + return &fakeInboxTokenRequests{ + gentype.NewFakeClient[*v1alpha1.InboxTokenRequest]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("inboxtokenrequests"), + v1alpha1.SchemeGroupVersion.WithKind("InboxTokenRequest"), + func() *v1alpha1.InboxTokenRequest { return &v1alpha1.InboxTokenRequest{} }, + ), + fake, } - return obj.(*v1alpha1.InboxTokenRequest), err } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_selfsubjectnamespaceaccessreview.go b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_selfsubjectnamespaceaccessreview.go index cbc3f56836..df992d42b2 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_selfsubjectnamespaceaccessreview.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/fake/fake_selfsubjectnamespaceaccessreview.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/identity/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeSelfSubjectNamespaceAccessReviews implements SelfSubjectNamespaceAccessReviewInterface -type FakeSelfSubjectNamespaceAccessReviews struct { +// fakeSelfSubjectNamespaceAccessReviews implements SelfSubjectNamespaceAccessReviewInterface +type fakeSelfSubjectNamespaceAccessReviews struct { + *gentype.FakeClient[*v1alpha1.SelfSubjectNamespaceAccessReview] Fake *FakeIdentityV1alpha1 } -var selfsubjectnamespaceaccessreviewsResource = v1alpha1.SchemeGroupVersion.WithResource("selfsubjectnamespaceaccessreviews") - -var selfsubjectnamespaceaccessreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectNamespaceAccessReview") - -// Create takes the representation of a selfSubjectNamespaceAccessReview and creates it. Returns the server's representation of the selfSubjectNamespaceAccessReview, and an error, if there is any. -func (c *FakeSelfSubjectNamespaceAccessReviews) Create(ctx context.Context, selfSubjectNamespaceAccessReview *v1alpha1.SelfSubjectNamespaceAccessReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectNamespaceAccessReview, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(selfsubjectnamespaceaccessreviewsResource, selfSubjectNamespaceAccessReview), &v1alpha1.SelfSubjectNamespaceAccessReview{}) - if obj == nil { - return nil, err +func newFakeSelfSubjectNamespaceAccessReviews(fake *FakeIdentityV1alpha1) identityv1alpha1.SelfSubjectNamespaceAccessReviewInterface { + return &fakeSelfSubjectNamespaceAccessReviews{ + gentype.NewFakeClient[*v1alpha1.SelfSubjectNamespaceAccessReview]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("selfsubjectnamespaceaccessreviews"), + v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectNamespaceAccessReview"), + func() *v1alpha1.SelfSubjectNamespaceAccessReview { return &v1alpha1.SelfSubjectNamespaceAccessReview{} }, + ), + fake, } - return obj.(*v1alpha1.SelfSubjectNamespaceAccessReview), err } diff --git a/client/clientset/versioned/typed/identity/v1alpha1/identity_client.go b/client/clientset/versioned/typed/identity/v1alpha1/identity_client.go index d83e8bb659..8e8a596cf7 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/identity_client.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/identity_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type IdentityV1alpha1Interface interface { @@ -60,9 +61,7 @@ func (c *IdentityV1alpha1Client) SelfSubjectNamespaceAccessReviews() SelfSubject // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*IdentityV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -74,9 +73,7 @@ func NewForConfig(c *rest.Config) (*IdentityV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*IdentityV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -99,17 +96,15 @@ func New(c rest.Interface) *IdentityV1alpha1Client { return &IdentityV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := identityv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/identity/v1alpha1/inboxtokenrequest.go b/client/clientset/versioned/typed/identity/v1alpha1/inboxtokenrequest.go index 1e27b0b0db..ab6ab8be66 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/inboxtokenrequest.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/inboxtokenrequest.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // InboxTokenRequestsGetter has a method to return a InboxTokenRequestInterface. @@ -35,30 +36,24 @@ type InboxTokenRequestsGetter interface { // InboxTokenRequestInterface has methods to work with InboxTokenRequest resources. type InboxTokenRequestInterface interface { - Create(ctx context.Context, inboxTokenRequest *v1alpha1.InboxTokenRequest, opts v1.CreateOptions) (*v1alpha1.InboxTokenRequest, error) + Create(ctx context.Context, inboxTokenRequest *identityv1alpha1.InboxTokenRequest, opts v1.CreateOptions) (*identityv1alpha1.InboxTokenRequest, error) InboxTokenRequestExpansion } // inboxTokenRequests implements InboxTokenRequestInterface type inboxTokenRequests struct { - client rest.Interface + *gentype.Client[*identityv1alpha1.InboxTokenRequest] } // newInboxTokenRequests returns a InboxTokenRequests func newInboxTokenRequests(c *IdentityV1alpha1Client) *inboxTokenRequests { return &inboxTokenRequests{ - client: c.RESTClient(), + gentype.NewClient[*identityv1alpha1.InboxTokenRequest]( + "inboxtokenrequests", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *identityv1alpha1.InboxTokenRequest { return &identityv1alpha1.InboxTokenRequest{} }, + ), } } - -// Create takes the representation of a inboxTokenRequest and creates it. Returns the server's representation of the inboxTokenRequest, and an error, if there is any. -func (c *inboxTokenRequests) Create(ctx context.Context, inboxTokenRequest *v1alpha1.InboxTokenRequest, opts v1.CreateOptions) (result *v1alpha1.InboxTokenRequest, err error) { - result = &v1alpha1.InboxTokenRequest{} - err = c.client.Post(). - Resource("inboxtokenrequests"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(inboxTokenRequest). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/identity/v1alpha1/selfsubjectnamespaceaccessreview.go b/client/clientset/versioned/typed/identity/v1alpha1/selfsubjectnamespaceaccessreview.go index 377532640c..886d145ed4 100644 --- a/client/clientset/versioned/typed/identity/v1alpha1/selfsubjectnamespaceaccessreview.go +++ b/client/clientset/versioned/typed/identity/v1alpha1/selfsubjectnamespaceaccessreview.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" + identityv1alpha1 "kmodules.xyz/resource-metadata/apis/identity/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // SelfSubjectNamespaceAccessReviewsGetter has a method to return a SelfSubjectNamespaceAccessReviewInterface. @@ -35,30 +36,26 @@ type SelfSubjectNamespaceAccessReviewsGetter interface { // SelfSubjectNamespaceAccessReviewInterface has methods to work with SelfSubjectNamespaceAccessReview resources. type SelfSubjectNamespaceAccessReviewInterface interface { - Create(ctx context.Context, selfSubjectNamespaceAccessReview *v1alpha1.SelfSubjectNamespaceAccessReview, opts v1.CreateOptions) (*v1alpha1.SelfSubjectNamespaceAccessReview, error) + Create(ctx context.Context, selfSubjectNamespaceAccessReview *identityv1alpha1.SelfSubjectNamespaceAccessReview, opts v1.CreateOptions) (*identityv1alpha1.SelfSubjectNamespaceAccessReview, error) SelfSubjectNamespaceAccessReviewExpansion } // selfSubjectNamespaceAccessReviews implements SelfSubjectNamespaceAccessReviewInterface type selfSubjectNamespaceAccessReviews struct { - client rest.Interface + *gentype.Client[*identityv1alpha1.SelfSubjectNamespaceAccessReview] } // newSelfSubjectNamespaceAccessReviews returns a SelfSubjectNamespaceAccessReviews func newSelfSubjectNamespaceAccessReviews(c *IdentityV1alpha1Client) *selfSubjectNamespaceAccessReviews { return &selfSubjectNamespaceAccessReviews{ - client: c.RESTClient(), + gentype.NewClient[*identityv1alpha1.SelfSubjectNamespaceAccessReview]( + "selfsubjectnamespaceaccessreviews", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *identityv1alpha1.SelfSubjectNamespaceAccessReview { + return &identityv1alpha1.SelfSubjectNamespaceAccessReview{} + }, + ), } } - -// Create takes the representation of a selfSubjectNamespaceAccessReview and creates it. Returns the server's representation of the selfSubjectNamespaceAccessReview, and an error, if there is any. -func (c *selfSubjectNamespaceAccessReviews) Create(ctx context.Context, selfSubjectNamespaceAccessReview *v1alpha1.SelfSubjectNamespaceAccessReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectNamespaceAccessReview, err error) { - result = &v1alpha1.SelfSubjectNamespaceAccessReview{} - err = c.client.Post(). - Resource("selfsubjectnamespaceaccessreviews"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(selfSubjectNamespaceAccessReview). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/management/v1alpha1/fake/fake_management_client.go b/client/clientset/versioned/typed/management/v1alpha1/fake/fake_management_client.go index 4645a1c583..5ed9fd201e 100644 --- a/client/clientset/versioned/typed/management/v1alpha1/fake/fake_management_client.go +++ b/client/clientset/versioned/typed/management/v1alpha1/fake/fake_management_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/management/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/management/v1alpha1" ) type FakeManagementV1alpha1 struct { @@ -29,7 +30,7 @@ type FakeManagementV1alpha1 struct { } func (c *FakeManagementV1alpha1) ProjectQuotas() v1alpha1.ProjectQuotaInterface { - return &FakeProjectQuotas{c} + return newFakeProjectQuotas(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/management/v1alpha1/fake/fake_projectquota.go b/client/clientset/versioned/typed/management/v1alpha1/fake/fake_projectquota.go index 2215f2cfe8..0d18681792 100644 --- a/client/clientset/versioned/typed/management/v1alpha1/fake/fake_projectquota.go +++ b/client/clientset/versioned/typed/management/v1alpha1/fake/fake_projectquota.go @@ -19,114 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/management/v1alpha1" + managementv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/management/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeProjectQuotas implements ProjectQuotaInterface -type FakeProjectQuotas struct { +// fakeProjectQuotas implements ProjectQuotaInterface +type fakeProjectQuotas struct { + *gentype.FakeClientWithList[*v1alpha1.ProjectQuota, *v1alpha1.ProjectQuotaList] Fake *FakeManagementV1alpha1 } -var projectquotasResource = v1alpha1.SchemeGroupVersion.WithResource("projectquotas") - -var projectquotasKind = v1alpha1.SchemeGroupVersion.WithKind("ProjectQuota") - -// Get takes name of the projectQuota, and returns the corresponding projectQuota object, and an error if there is any. -func (c *FakeProjectQuotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ProjectQuota, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(projectquotasResource, name), &v1alpha1.ProjectQuota{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ProjectQuota), err -} - -// List takes label and field selectors, and returns the list of ProjectQuotas that match those selectors. -func (c *FakeProjectQuotas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ProjectQuotaList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(projectquotasResource, projectquotasKind, opts), &v1alpha1.ProjectQuotaList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ProjectQuotaList{ListMeta: obj.(*v1alpha1.ProjectQuotaList).ListMeta} - for _, item := range obj.(*v1alpha1.ProjectQuotaList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested projectQuotas. -func (c *FakeProjectQuotas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(projectquotasResource, opts)) -} - -// Create takes the representation of a projectQuota and creates it. Returns the server's representation of the projectQuota, and an error, if there is any. -func (c *FakeProjectQuotas) Create(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.CreateOptions) (result *v1alpha1.ProjectQuota, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(projectquotasResource, projectQuota), &v1alpha1.ProjectQuota{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ProjectQuota), err -} - -// Update takes the representation of a projectQuota and updates it. Returns the server's representation of the projectQuota, and an error, if there is any. -func (c *FakeProjectQuotas) Update(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (result *v1alpha1.ProjectQuota, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(projectquotasResource, projectQuota), &v1alpha1.ProjectQuota{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ProjectQuota), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeProjectQuotas) UpdateStatus(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (*v1alpha1.ProjectQuota, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(projectquotasResource, "status", projectQuota), &v1alpha1.ProjectQuota{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ProjectQuota), err -} - -// Delete takes name of the projectQuota and deletes it. Returns an error if one occurs. -func (c *FakeProjectQuotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(projectquotasResource, name, opts), &v1alpha1.ProjectQuota{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeProjectQuotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(projectquotasResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ProjectQuotaList{}) - return err -} - -// Patch applies the patch and returns the patched projectQuota. -func (c *FakeProjectQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ProjectQuota, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(projectquotasResource, name, pt, data, subresources...), &v1alpha1.ProjectQuota{}) - if obj == nil { - return nil, err +func newFakeProjectQuotas(fake *FakeManagementV1alpha1) managementv1alpha1.ProjectQuotaInterface { + return &fakeProjectQuotas{ + gentype.NewFakeClientWithList[*v1alpha1.ProjectQuota, *v1alpha1.ProjectQuotaList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("projectquotas"), + v1alpha1.SchemeGroupVersion.WithKind("ProjectQuota"), + func() *v1alpha1.ProjectQuota { return &v1alpha1.ProjectQuota{} }, + func() *v1alpha1.ProjectQuotaList { return &v1alpha1.ProjectQuotaList{} }, + func(dst, src *v1alpha1.ProjectQuotaList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ProjectQuotaList) []*v1alpha1.ProjectQuota { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ProjectQuotaList, items []*v1alpha1.ProjectQuota) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ProjectQuota), err } diff --git a/client/clientset/versioned/typed/management/v1alpha1/management_client.go b/client/clientset/versioned/typed/management/v1alpha1/management_client.go index c0726a2248..f794ed882d 100644 --- a/client/clientset/versioned/typed/management/v1alpha1/management_client.go +++ b/client/clientset/versioned/typed/management/v1alpha1/management_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + managementv1alpha1 "kmodules.xyz/resource-metadata/apis/management/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/management/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type ManagementV1alpha1Interface interface { @@ -45,9 +46,7 @@ func (c *ManagementV1alpha1Client) ProjectQuotas() ProjectQuotaInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*ManagementV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +58,7 @@ func NewForConfig(c *rest.Config) (*ManagementV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ManagementV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,17 +81,15 @@ func New(c rest.Interface) *ManagementV1alpha1Client { return &ManagementV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := managementv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/management/v1alpha1/projectquota.go b/client/clientset/versioned/typed/management/v1alpha1/projectquota.go index 2103858879..c6f8f891ea 100644 --- a/client/clientset/versioned/typed/management/v1alpha1/projectquota.go +++ b/client/clientset/versioned/typed/management/v1alpha1/projectquota.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + managementv1alpha1 "kmodules.xyz/resource-metadata/apis/management/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/management/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ProjectQuotasGetter has a method to return a ProjectQuotaInterface. @@ -38,147 +38,34 @@ type ProjectQuotasGetter interface { // ProjectQuotaInterface has methods to work with ProjectQuota resources. type ProjectQuotaInterface interface { - Create(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.CreateOptions) (*v1alpha1.ProjectQuota, error) - Update(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (*v1alpha1.ProjectQuota, error) - UpdateStatus(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (*v1alpha1.ProjectQuota, error) + Create(ctx context.Context, projectQuota *managementv1alpha1.ProjectQuota, opts v1.CreateOptions) (*managementv1alpha1.ProjectQuota, error) + Update(ctx context.Context, projectQuota *managementv1alpha1.ProjectQuota, opts v1.UpdateOptions) (*managementv1alpha1.ProjectQuota, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, projectQuota *managementv1alpha1.ProjectQuota, opts v1.UpdateOptions) (*managementv1alpha1.ProjectQuota, 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) (*v1alpha1.ProjectQuota, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ProjectQuotaList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*managementv1alpha1.ProjectQuota, error) + List(ctx context.Context, opts v1.ListOptions) (*managementv1alpha1.ProjectQuotaList, 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 *v1alpha1.ProjectQuota, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *managementv1alpha1.ProjectQuota, err error) ProjectQuotaExpansion } // projectQuotas implements ProjectQuotaInterface type projectQuotas struct { - client rest.Interface + *gentype.ClientWithList[*managementv1alpha1.ProjectQuota, *managementv1alpha1.ProjectQuotaList] } // newProjectQuotas returns a ProjectQuotas func newProjectQuotas(c *ManagementV1alpha1Client) *projectQuotas { return &projectQuotas{ - client: c.RESTClient(), - } -} - -// Get takes name of the projectQuota, and returns the corresponding projectQuota object, and an error if there is any. -func (c *projectQuotas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ProjectQuota, err error) { - result = &v1alpha1.ProjectQuota{} - err = c.client.Get(). - Resource("projectquotas"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ProjectQuotas that match those selectors. -func (c *projectQuotas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ProjectQuotaList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ProjectQuotaList{} - err = c.client.Get(). - Resource("projectquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested projectQuotas. -func (c *projectQuotas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("projectquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a projectQuota and creates it. Returns the server's representation of the projectQuota, and an error, if there is any. -func (c *projectQuotas) Create(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.CreateOptions) (result *v1alpha1.ProjectQuota, err error) { - result = &v1alpha1.ProjectQuota{} - err = c.client.Post(). - Resource("projectquotas"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(projectQuota). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a projectQuota and updates it. Returns the server's representation of the projectQuota, and an error, if there is any. -func (c *projectQuotas) Update(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (result *v1alpha1.ProjectQuota, err error) { - result = &v1alpha1.ProjectQuota{} - err = c.client.Put(). - Resource("projectquotas"). - Name(projectQuota.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(projectQuota). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *projectQuotas) UpdateStatus(ctx context.Context, projectQuota *v1alpha1.ProjectQuota, opts v1.UpdateOptions) (result *v1alpha1.ProjectQuota, err error) { - result = &v1alpha1.ProjectQuota{} - err = c.client.Put(). - Resource("projectquotas"). - Name(projectQuota.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(projectQuota). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the projectQuota and deletes it. Returns an error if one occurs. -func (c *projectQuotas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("projectquotas"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *projectQuotas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*managementv1alpha1.ProjectQuota, *managementv1alpha1.ProjectQuotaList]( + "projectquotas", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *managementv1alpha1.ProjectQuota { return &managementv1alpha1.ProjectQuota{} }, + func() *managementv1alpha1.ProjectQuotaList { return &managementv1alpha1.ProjectQuotaList{} }, + ), } - return c.client.Delete(). - Resource("projectquotas"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched projectQuota. -func (c *projectQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ProjectQuota, err error) { - result = &v1alpha1.ProjectQuota{} - err = c.client.Patch(pt). - Resource("projectquotas"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/chartpresetquery.go b/client/clientset/versioned/typed/meta/v1alpha1/chartpresetquery.go index 44a3b4e8b6..595cc4b6a7 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/chartpresetquery.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/chartpresetquery.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // ChartPresetQueriesGetter has a method to return a ChartPresetQueryInterface. @@ -35,30 +36,24 @@ type ChartPresetQueriesGetter interface { // ChartPresetQueryInterface has methods to work with ChartPresetQuery resources. type ChartPresetQueryInterface interface { - Create(ctx context.Context, chartPresetQuery *v1alpha1.ChartPresetQuery, opts v1.CreateOptions) (*v1alpha1.ChartPresetQuery, error) + Create(ctx context.Context, chartPresetQuery *metav1alpha1.ChartPresetQuery, opts v1.CreateOptions) (*metav1alpha1.ChartPresetQuery, error) ChartPresetQueryExpansion } // chartPresetQueries implements ChartPresetQueryInterface type chartPresetQueries struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ChartPresetQuery] } // newChartPresetQueries returns a ChartPresetQueries func newChartPresetQueries(c *MetaV1alpha1Client) *chartPresetQueries { return &chartPresetQueries{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ChartPresetQuery]( + "chartpresetqueries", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ChartPresetQuery { return &metav1alpha1.ChartPresetQuery{} }, + ), } } - -// Create takes the representation of a chartPresetQuery and creates it. Returns the server's representation of the chartPresetQuery, and an error, if there is any. -func (c *chartPresetQueries) Create(ctx context.Context, chartPresetQuery *v1alpha1.ChartPresetQuery, opts v1.CreateOptions) (result *v1alpha1.ChartPresetQuery, err error) { - result = &v1alpha1.ChartPresetQuery{} - err = c.client.Post(). - Resource("chartpresetqueries"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(chartPresetQuery). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/clusterprofile.go b/client/clientset/versioned/typed/meta/v1alpha1/clusterprofile.go index 5ddda21a2f..49c68798f4 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/clusterprofile.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/clusterprofile.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ClusterProfilesGetter has a method to return a ClusterProfileInterface. @@ -38,131 +38,32 @@ type ClusterProfilesGetter interface { // ClusterProfileInterface has methods to work with ClusterProfile resources. type ClusterProfileInterface interface { - Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (*v1alpha1.ClusterProfile, error) - Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (*v1alpha1.ClusterProfile, error) + Create(ctx context.Context, clusterProfile *metav1alpha1.ClusterProfile, opts v1.CreateOptions) (*metav1alpha1.ClusterProfile, error) + Update(ctx context.Context, clusterProfile *metav1alpha1.ClusterProfile, opts v1.UpdateOptions) (*metav1alpha1.ClusterProfile, 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) (*v1alpha1.ClusterProfile, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterProfileList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ClusterProfile, error) + List(ctx context.Context, opts v1.ListOptions) (*metav1alpha1.ClusterProfileList, 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 *v1alpha1.ClusterProfile, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *metav1alpha1.ClusterProfile, err error) ClusterProfileExpansion } // clusterProfiles implements ClusterProfileInterface type clusterProfiles struct { - client rest.Interface + *gentype.ClientWithList[*metav1alpha1.ClusterProfile, *metav1alpha1.ClusterProfileList] } // newClusterProfiles returns a ClusterProfiles func newClusterProfiles(c *MetaV1alpha1Client) *clusterProfiles { return &clusterProfiles{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterProfile, and returns the corresponding clusterProfile object, and an error if there is any. -func (c *clusterProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Get(). - Resource("clusterprofiles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterProfiles that match those selectors. -func (c *clusterProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterProfileList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterProfileList{} - err = c.client.Get(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterProfiles. -func (c *clusterProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*metav1alpha1.ClusterProfile, *metav1alpha1.ClusterProfileList]( + "clusterprofiles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ClusterProfile { return &metav1alpha1.ClusterProfile{} }, + func() *metav1alpha1.ClusterProfileList { return &metav1alpha1.ClusterProfileList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterProfile and creates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *clusterProfiles) Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Post(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterProfile). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterProfile and updates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *clusterProfiles) Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Put(). - Resource("clusterprofiles"). - Name(clusterProfile.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterProfile). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterProfile and deletes it. Returns an error if one occurs. -func (c *clusterProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterprofiles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterprofiles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterProfile. -func (c *clusterProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Patch(pt). - Resource("clusterprofiles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/clusterstatus.go b/client/clientset/versioned/typed/meta/v1alpha1/clusterstatus.go index 5a8ac49f92..12c476d421 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/clusterstatus.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/clusterstatus.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // ClusterStatusesGetter has a method to return a ClusterStatusInterface. @@ -35,30 +36,24 @@ type ClusterStatusesGetter interface { // ClusterStatusInterface has methods to work with ClusterStatus resources. type ClusterStatusInterface interface { - Create(ctx context.Context, clusterStatus *v1alpha1.ClusterStatus, opts v1.CreateOptions) (*v1alpha1.ClusterStatus, error) + Create(ctx context.Context, clusterStatus *metav1alpha1.ClusterStatus, opts v1.CreateOptions) (*metav1alpha1.ClusterStatus, error) ClusterStatusExpansion } // clusterStatuses implements ClusterStatusInterface type clusterStatuses struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ClusterStatus] } // newClusterStatuses returns a ClusterStatuses func newClusterStatuses(c *MetaV1alpha1Client) *clusterStatuses { return &clusterStatuses{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ClusterStatus]( + "clusterstatuses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ClusterStatus { return &metav1alpha1.ClusterStatus{} }, + ), } } - -// Create takes the representation of a clusterStatus and creates it. Returns the server's representation of the clusterStatus, and an error, if there is any. -func (c *clusterStatuses) Create(ctx context.Context, clusterStatus *v1alpha1.ClusterStatus, opts v1.CreateOptions) (result *v1alpha1.ClusterStatus, err error) { - result = &v1alpha1.ClusterStatus{} - err = c.client.Post(). - Resource("clusterstatuses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterStatus). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_chartpresetquery.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_chartpresetquery.go index 5bac03cb2c..850a78a833 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_chartpresetquery.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_chartpresetquery.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeChartPresetQueries implements ChartPresetQueryInterface -type FakeChartPresetQueries struct { +// fakeChartPresetQueries implements ChartPresetQueryInterface +type fakeChartPresetQueries struct { + *gentype.FakeClient[*v1alpha1.ChartPresetQuery] Fake *FakeMetaV1alpha1 } -var chartpresetqueriesResource = v1alpha1.SchemeGroupVersion.WithResource("chartpresetqueries") - -var chartpresetqueriesKind = v1alpha1.SchemeGroupVersion.WithKind("ChartPresetQuery") - -// Create takes the representation of a chartPresetQuery and creates it. Returns the server's representation of the chartPresetQuery, and an error, if there is any. -func (c *FakeChartPresetQueries) Create(ctx context.Context, chartPresetQuery *v1alpha1.ChartPresetQuery, opts v1.CreateOptions) (result *v1alpha1.ChartPresetQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(chartpresetqueriesResource, chartPresetQuery), &v1alpha1.ChartPresetQuery{}) - if obj == nil { - return nil, err +func newFakeChartPresetQueries(fake *FakeMetaV1alpha1) metav1alpha1.ChartPresetQueryInterface { + return &fakeChartPresetQueries{ + gentype.NewFakeClient[*v1alpha1.ChartPresetQuery]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("chartpresetqueries"), + v1alpha1.SchemeGroupVersion.WithKind("ChartPresetQuery"), + func() *v1alpha1.ChartPresetQuery { return &v1alpha1.ChartPresetQuery{} }, + ), + fake, } - return obj.(*v1alpha1.ChartPresetQuery), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterprofile.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterprofile.go index 4340deac2b..b1f06426ca 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterprofile.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterprofile.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeClusterProfiles implements ClusterProfileInterface -type FakeClusterProfiles struct { +// fakeClusterProfiles implements ClusterProfileInterface +type fakeClusterProfiles struct { + *gentype.FakeClientWithList[*v1alpha1.ClusterProfile, *v1alpha1.ClusterProfileList] Fake *FakeMetaV1alpha1 } -var clusterprofilesResource = v1alpha1.SchemeGroupVersion.WithResource("clusterprofiles") - -var clusterprofilesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterProfile") - -// Get takes name of the clusterProfile, and returns the corresponding clusterProfile object, and an error if there is any. -func (c *FakeClusterProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterprofilesResource, name), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// List takes label and field selectors, and returns the list of ClusterProfiles that match those selectors. -func (c *FakeClusterProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterProfileList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterprofilesResource, clusterprofilesKind, opts), &v1alpha1.ClusterProfileList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterProfileList{ListMeta: obj.(*v1alpha1.ClusterProfileList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterProfileList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterProfiles. -func (c *FakeClusterProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterprofilesResource, opts)) -} - -// Create takes the representation of a clusterProfile and creates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *FakeClusterProfiles) Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterprofilesResource, clusterProfile), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// Update takes the representation of a clusterProfile and updates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *FakeClusterProfiles) Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterprofilesResource, clusterProfile), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// Delete takes name of the clusterProfile and deletes it. Returns an error if one occurs. -func (c *FakeClusterProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterprofilesResource, name, opts), &v1alpha1.ClusterProfile{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterprofilesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterProfileList{}) - return err -} - -// Patch applies the patch and returns the patched clusterProfile. -func (c *FakeClusterProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterprofilesResource, name, pt, data, subresources...), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err +func newFakeClusterProfiles(fake *FakeMetaV1alpha1) metav1alpha1.ClusterProfileInterface { + return &fakeClusterProfiles{ + gentype.NewFakeClientWithList[*v1alpha1.ClusterProfile, *v1alpha1.ClusterProfileList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("clusterprofiles"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterProfile"), + func() *v1alpha1.ClusterProfile { return &v1alpha1.ClusterProfile{} }, + func() *v1alpha1.ClusterProfileList { return &v1alpha1.ClusterProfileList{} }, + func(dst, src *v1alpha1.ClusterProfileList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterProfileList) []*v1alpha1.ClusterProfile { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterProfileList, items []*v1alpha1.ClusterProfile) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ClusterProfile), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterstatus.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterstatus.go index d75cdd525f..5985244135 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterstatus.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_clusterstatus.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeClusterStatuses implements ClusterStatusInterface -type FakeClusterStatuses struct { +// fakeClusterStatuses implements ClusterStatusInterface +type fakeClusterStatuses struct { + *gentype.FakeClient[*v1alpha1.ClusterStatus] Fake *FakeMetaV1alpha1 } -var clusterstatusesResource = v1alpha1.SchemeGroupVersion.WithResource("clusterstatuses") - -var clusterstatusesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterStatus") - -// Create takes the representation of a clusterStatus and creates it. Returns the server's representation of the clusterStatus, and an error, if there is any. -func (c *FakeClusterStatuses) Create(ctx context.Context, clusterStatus *v1alpha1.ClusterStatus, opts v1.CreateOptions) (result *v1alpha1.ClusterStatus, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterstatusesResource, clusterStatus), &v1alpha1.ClusterStatus{}) - if obj == nil { - return nil, err +func newFakeClusterStatuses(fake *FakeMetaV1alpha1) metav1alpha1.ClusterStatusInterface { + return &fakeClusterStatuses{ + gentype.NewFakeClient[*v1alpha1.ClusterStatus]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("clusterstatuses"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterStatus"), + func() *v1alpha1.ClusterStatus { return &v1alpha1.ClusterStatus{} }, + ), + fake, } - return obj.(*v1alpha1.ClusterStatus), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_menuoutline.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_menuoutline.go index 23ce0c7f19..e92c0a2636 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_menuoutline.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_menuoutline.go @@ -19,111 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeMenuOutlines implements MenuOutlineInterface -type FakeMenuOutlines struct { +// fakeMenuOutlines implements MenuOutlineInterface +type fakeMenuOutlines struct { + *gentype.FakeClientWithList[*v1alpha1.MenuOutline, *v1alpha1.MenuOutlineList] Fake *FakeMetaV1alpha1 - ns string } -var menuoutlinesResource = v1alpha1.SchemeGroupVersion.WithResource("menuoutlines") - -var menuoutlinesKind = v1alpha1.SchemeGroupVersion.WithKind("MenuOutline") - -// Get takes name of the menuOutline, and returns the corresponding menuOutline object, and an error if there is any. -func (c *FakeMenuOutlines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MenuOutline, err error) { - obj, err := c.Fake. - Invokes(testing.NewGetAction(menuoutlinesResource, c.ns, name), &v1alpha1.MenuOutline{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MenuOutline), err -} - -// List takes label and field selectors, and returns the list of MenuOutlines that match those selectors. -func (c *FakeMenuOutlines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MenuOutlineList, err error) { - obj, err := c.Fake. - Invokes(testing.NewListAction(menuoutlinesResource, menuoutlinesKind, c.ns, opts), &v1alpha1.MenuOutlineList{}) - - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.MenuOutlineList{ListMeta: obj.(*v1alpha1.MenuOutlineList).ListMeta} - for _, item := range obj.(*v1alpha1.MenuOutlineList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested menuOutlines. -func (c *FakeMenuOutlines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchAction(menuoutlinesResource, c.ns, opts)) - -} - -// Create takes the representation of a menuOutline and creates it. Returns the server's representation of the menuOutline, and an error, if there is any. -func (c *FakeMenuOutlines) Create(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.CreateOptions) (result *v1alpha1.MenuOutline, err error) { - obj, err := c.Fake. - Invokes(testing.NewCreateAction(menuoutlinesResource, c.ns, menuOutline), &v1alpha1.MenuOutline{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MenuOutline), err -} - -// Update takes the representation of a menuOutline and updates it. Returns the server's representation of the menuOutline, and an error, if there is any. -func (c *FakeMenuOutlines) Update(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.UpdateOptions) (result *v1alpha1.MenuOutline, err error) { - obj, err := c.Fake. - Invokes(testing.NewUpdateAction(menuoutlinesResource, c.ns, menuOutline), &v1alpha1.MenuOutline{}) - - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.MenuOutline), err -} - -// Delete takes name of the menuOutline and deletes it. Returns an error if one occurs. -func (c *FakeMenuOutlines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(menuoutlinesResource, c.ns, name, opts), &v1alpha1.MenuOutline{}) - - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeMenuOutlines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(menuoutlinesResource, c.ns, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.MenuOutlineList{}) - return err -} - -// Patch applies the patch and returns the patched menuOutline. -func (c *FakeMenuOutlines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MenuOutline, err error) { - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(menuoutlinesResource, c.ns, name, pt, data, subresources...), &v1alpha1.MenuOutline{}) - - if obj == nil { - return nil, err +func newFakeMenuOutlines(fake *FakeMetaV1alpha1, namespace string) metav1alpha1.MenuOutlineInterface { + return &fakeMenuOutlines{ + gentype.NewFakeClientWithList[*v1alpha1.MenuOutline, *v1alpha1.MenuOutlineList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("menuoutlines"), + v1alpha1.SchemeGroupVersion.WithKind("MenuOutline"), + func() *v1alpha1.MenuOutline { return &v1alpha1.MenuOutline{} }, + func() *v1alpha1.MenuOutlineList { return &v1alpha1.MenuOutlineList{} }, + func(dst, src *v1alpha1.MenuOutlineList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.MenuOutlineList) []*v1alpha1.MenuOutline { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.MenuOutlineList, items []*v1alpha1.MenuOutline) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.MenuOutline), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_meta_client.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_meta_client.go index 60b19cd1e6..26f8423d73 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_meta_client.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_meta_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" ) type FakeMetaV1alpha1 struct { @@ -29,79 +30,79 @@ type FakeMetaV1alpha1 struct { } func (c *FakeMetaV1alpha1) ChartPresetQueries() v1alpha1.ChartPresetQueryInterface { - return &FakeChartPresetQueries{c} + return newFakeChartPresetQueries(c) } func (c *FakeMetaV1alpha1) ClusterProfiles() v1alpha1.ClusterProfileInterface { - return &FakeClusterProfiles{c} + return newFakeClusterProfiles(c) } func (c *FakeMetaV1alpha1) ClusterStatuses() v1alpha1.ClusterStatusInterface { - return &FakeClusterStatuses{c} + return newFakeClusterStatuses(c) } func (c *FakeMetaV1alpha1) MenuOutlines(namespace string) v1alpha1.MenuOutlineInterface { - return &FakeMenuOutlines{c, namespace} + return newFakeMenuOutlines(c, namespace) } func (c *FakeMetaV1alpha1) Renders() v1alpha1.RenderInterface { - return &FakeRenders{c} + return newFakeRenders(c) } func (c *FakeMetaV1alpha1) RenderDashboards() v1alpha1.RenderDashboardInterface { - return &FakeRenderDashboards{c} + return newFakeRenderDashboards(c) } func (c *FakeMetaV1alpha1) RenderMenus() v1alpha1.RenderMenuInterface { - return &FakeRenderMenus{c} + return newFakeRenderMenus(c) } func (c *FakeMetaV1alpha1) RenderRawGraphs() v1alpha1.RenderRawGraphInterface { - return &FakeRenderRawGraphs{c} + return newFakeRenderRawGraphs(c) } func (c *FakeMetaV1alpha1) ResourceBlockDefinitions() v1alpha1.ResourceBlockDefinitionInterface { - return &FakeResourceBlockDefinitions{c} + return newFakeResourceBlockDefinitions(c) } func (c *FakeMetaV1alpha1) ResourceCalculators() v1alpha1.ResourceCalculatorInterface { - return &FakeResourceCalculators{c} + return newFakeResourceCalculators(c) } func (c *FakeMetaV1alpha1) ResourceDescriptors() v1alpha1.ResourceDescriptorInterface { - return &FakeResourceDescriptors{c} + return newFakeResourceDescriptors(c) } func (c *FakeMetaV1alpha1) ResourceEditors() v1alpha1.ResourceEditorInterface { - return &FakeResourceEditors{c} + return newFakeResourceEditors(c) } func (c *FakeMetaV1alpha1) ResourceGraphs() v1alpha1.ResourceGraphInterface { - return &FakeResourceGraphs{c} + return newFakeResourceGraphs(c) } func (c *FakeMetaV1alpha1) ResourceLayouts() v1alpha1.ResourceLayoutInterface { - return &FakeResourceLayouts{c} + return newFakeResourceLayouts(c) } func (c *FakeMetaV1alpha1) ResourceManifestses() v1alpha1.ResourceManifestsInterface { - return &FakeResourceManifestses{c} + return newFakeResourceManifestses(c) } func (c *FakeMetaV1alpha1) ResourceOutlines() v1alpha1.ResourceOutlineInterface { - return &FakeResourceOutlines{c} + return newFakeResourceOutlines(c) } func (c *FakeMetaV1alpha1) ResourceOutlineFilters() v1alpha1.ResourceOutlineFilterInterface { - return &FakeResourceOutlineFilters{c} + return newFakeResourceOutlineFilters(c) } func (c *FakeMetaV1alpha1) ResourceQueries() v1alpha1.ResourceQueryInterface { - return &FakeResourceQueries{c} + return newFakeResourceQueries(c) } func (c *FakeMetaV1alpha1) ResourceTableDefinitions() v1alpha1.ResourceTableDefinitionInterface { - return &FakeResourceTableDefinitions{c} + return newFakeResourceTableDefinitions(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_render.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_render.go index 6526258118..f3d4ec269d 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_render.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_render.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeRenders implements RenderInterface -type FakeRenders struct { +// fakeRenders implements RenderInterface +type fakeRenders struct { + *gentype.FakeClient[*v1alpha1.Render] Fake *FakeMetaV1alpha1 } -var rendersResource = v1alpha1.SchemeGroupVersion.WithResource("renders") - -var rendersKind = v1alpha1.SchemeGroupVersion.WithKind("Render") - -// Create takes the representation of a render and creates it. Returns the server's representation of the render, and an error, if there is any. -func (c *FakeRenders) Create(ctx context.Context, render *v1alpha1.Render, opts v1.CreateOptions) (result *v1alpha1.Render, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(rendersResource, render), &v1alpha1.Render{}) - if obj == nil { - return nil, err +func newFakeRenders(fake *FakeMetaV1alpha1) metav1alpha1.RenderInterface { + return &fakeRenders{ + gentype.NewFakeClient[*v1alpha1.Render]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("renders"), + v1alpha1.SchemeGroupVersion.WithKind("Render"), + func() *v1alpha1.Render { return &v1alpha1.Render{} }, + ), + fake, } - return obj.(*v1alpha1.Render), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderdashboard.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderdashboard.go index abcf7ad2dd..da4c302bba 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderdashboard.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderdashboard.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeRenderDashboards implements RenderDashboardInterface -type FakeRenderDashboards struct { +// fakeRenderDashboards implements RenderDashboardInterface +type fakeRenderDashboards struct { + *gentype.FakeClient[*v1alpha1.RenderDashboard] Fake *FakeMetaV1alpha1 } -var renderdashboardsResource = v1alpha1.SchemeGroupVersion.WithResource("renderdashboards") - -var renderdashboardsKind = v1alpha1.SchemeGroupVersion.WithKind("RenderDashboard") - -// Create takes the representation of a renderDashboard and creates it. Returns the server's representation of the renderDashboard, and an error, if there is any. -func (c *FakeRenderDashboards) Create(ctx context.Context, renderDashboard *v1alpha1.RenderDashboard, opts v1.CreateOptions) (result *v1alpha1.RenderDashboard, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(renderdashboardsResource, renderDashboard), &v1alpha1.RenderDashboard{}) - if obj == nil { - return nil, err +func newFakeRenderDashboards(fake *FakeMetaV1alpha1) metav1alpha1.RenderDashboardInterface { + return &fakeRenderDashboards{ + gentype.NewFakeClient[*v1alpha1.RenderDashboard]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("renderdashboards"), + v1alpha1.SchemeGroupVersion.WithKind("RenderDashboard"), + func() *v1alpha1.RenderDashboard { return &v1alpha1.RenderDashboard{} }, + ), + fake, } - return obj.(*v1alpha1.RenderDashboard), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_rendermenu.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_rendermenu.go index 760544657e..104d288719 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_rendermenu.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_rendermenu.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeRenderMenus implements RenderMenuInterface -type FakeRenderMenus struct { +// fakeRenderMenus implements RenderMenuInterface +type fakeRenderMenus struct { + *gentype.FakeClient[*v1alpha1.RenderMenu] Fake *FakeMetaV1alpha1 } -var rendermenusResource = v1alpha1.SchemeGroupVersion.WithResource("rendermenus") - -var rendermenusKind = v1alpha1.SchemeGroupVersion.WithKind("RenderMenu") - -// Create takes the representation of a renderMenu and creates it. Returns the server's representation of the renderMenu, and an error, if there is any. -func (c *FakeRenderMenus) Create(ctx context.Context, renderMenu *v1alpha1.RenderMenu, opts v1.CreateOptions) (result *v1alpha1.RenderMenu, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(rendermenusResource, renderMenu), &v1alpha1.RenderMenu{}) - if obj == nil { - return nil, err +func newFakeRenderMenus(fake *FakeMetaV1alpha1) metav1alpha1.RenderMenuInterface { + return &fakeRenderMenus{ + gentype.NewFakeClient[*v1alpha1.RenderMenu]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("rendermenus"), + v1alpha1.SchemeGroupVersion.WithKind("RenderMenu"), + func() *v1alpha1.RenderMenu { return &v1alpha1.RenderMenu{} }, + ), + fake, } - return obj.(*v1alpha1.RenderMenu), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderrawgraph.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderrawgraph.go index e8ec8e18d9..c58842f51d 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderrawgraph.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_renderrawgraph.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeRenderRawGraphs implements RenderRawGraphInterface -type FakeRenderRawGraphs struct { +// fakeRenderRawGraphs implements RenderRawGraphInterface +type fakeRenderRawGraphs struct { + *gentype.FakeClient[*v1alpha1.RenderRawGraph] Fake *FakeMetaV1alpha1 } -var renderrawgraphsResource = v1alpha1.SchemeGroupVersion.WithResource("renderrawgraphs") - -var renderrawgraphsKind = v1alpha1.SchemeGroupVersion.WithKind("RenderRawGraph") - -// Create takes the representation of a renderRawGraph and creates it. Returns the server's representation of the renderRawGraph, and an error, if there is any. -func (c *FakeRenderRawGraphs) Create(ctx context.Context, renderRawGraph *v1alpha1.RenderRawGraph, opts v1.CreateOptions) (result *v1alpha1.RenderRawGraph, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(renderrawgraphsResource, renderRawGraph), &v1alpha1.RenderRawGraph{}) - if obj == nil { - return nil, err +func newFakeRenderRawGraphs(fake *FakeMetaV1alpha1) metav1alpha1.RenderRawGraphInterface { + return &fakeRenderRawGraphs{ + gentype.NewFakeClient[*v1alpha1.RenderRawGraph]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("renderrawgraphs"), + v1alpha1.SchemeGroupVersion.WithKind("RenderRawGraph"), + func() *v1alpha1.RenderRawGraph { return &v1alpha1.RenderRawGraph{} }, + ), + fake, } - return obj.(*v1alpha1.RenderRawGraph), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceblockdefinition.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceblockdefinition.go index 80cb9de166..4f93b76399 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceblockdefinition.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceblockdefinition.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceBlockDefinitions implements ResourceBlockDefinitionInterface -type FakeResourceBlockDefinitions struct { +// fakeResourceBlockDefinitions implements ResourceBlockDefinitionInterface +type fakeResourceBlockDefinitions struct { + *gentype.FakeClient[*v1alpha1.ResourceBlockDefinition] Fake *FakeMetaV1alpha1 } -var resourceblockdefinitionsResource = v1alpha1.SchemeGroupVersion.WithResource("resourceblockdefinitions") - -var resourceblockdefinitionsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceBlockDefinition") - -// Get takes name of the resourceBlockDefinition, and returns the corresponding resourceBlockDefinition object, and an error if there is any. -func (c *FakeResourceBlockDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceBlockDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceblockdefinitionsResource, name), &v1alpha1.ResourceBlockDefinition{}) - if obj == nil { - return nil, err +func newFakeResourceBlockDefinitions(fake *FakeMetaV1alpha1) metav1alpha1.ResourceBlockDefinitionInterface { + return &fakeResourceBlockDefinitions{ + gentype.NewFakeClient[*v1alpha1.ResourceBlockDefinition]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceblockdefinitions"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceBlockDefinition"), + func() *v1alpha1.ResourceBlockDefinition { return &v1alpha1.ResourceBlockDefinition{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceBlockDefinition), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcecalculator.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcecalculator.go index 3cc08af2ff..df101c10e4 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcecalculator.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcecalculator.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceCalculators implements ResourceCalculatorInterface -type FakeResourceCalculators struct { +// fakeResourceCalculators implements ResourceCalculatorInterface +type fakeResourceCalculators struct { + *gentype.FakeClient[*v1alpha1.ResourceCalculator] Fake *FakeMetaV1alpha1 } -var resourcecalculatorsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcecalculators") - -var resourcecalculatorsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceCalculator") - -// Create takes the representation of a resourceCalculator and creates it. Returns the server's representation of the resourceCalculator, and an error, if there is any. -func (c *FakeResourceCalculators) Create(ctx context.Context, resourceCalculator *v1alpha1.ResourceCalculator, opts v1.CreateOptions) (result *v1alpha1.ResourceCalculator, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourcecalculatorsResource, resourceCalculator), &v1alpha1.ResourceCalculator{}) - if obj == nil { - return nil, err +func newFakeResourceCalculators(fake *FakeMetaV1alpha1) metav1alpha1.ResourceCalculatorInterface { + return &fakeResourceCalculators{ + gentype.NewFakeClient[*v1alpha1.ResourceCalculator]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcecalculators"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceCalculator"), + func() *v1alpha1.ResourceCalculator { return &v1alpha1.ResourceCalculator{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceCalculator), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcedescriptor.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcedescriptor.go index 1cb488ecef..0fd082c5a9 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcedescriptor.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcedescriptor.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceDescriptors implements ResourceDescriptorInterface -type FakeResourceDescriptors struct { +// fakeResourceDescriptors implements ResourceDescriptorInterface +type fakeResourceDescriptors struct { + *gentype.FakeClient[*v1alpha1.ResourceDescriptor] Fake *FakeMetaV1alpha1 } -var resourcedescriptorsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcedescriptors") - -var resourcedescriptorsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceDescriptor") - -// Get takes name of the resourceDescriptor, and returns the corresponding resourceDescriptor object, and an error if there is any. -func (c *FakeResourceDescriptors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceDescriptor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourcedescriptorsResource, name), &v1alpha1.ResourceDescriptor{}) - if obj == nil { - return nil, err +func newFakeResourceDescriptors(fake *FakeMetaV1alpha1) metav1alpha1.ResourceDescriptorInterface { + return &fakeResourceDescriptors{ + gentype.NewFakeClient[*v1alpha1.ResourceDescriptor]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcedescriptors"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceDescriptor"), + func() *v1alpha1.ResourceDescriptor { return &v1alpha1.ResourceDescriptor{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceDescriptor), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceeditor.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceeditor.go index 610abc2cf9..9a2328eb1b 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceeditor.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceeditor.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceEditors implements ResourceEditorInterface -type FakeResourceEditors struct { +// fakeResourceEditors implements ResourceEditorInterface +type fakeResourceEditors struct { + *gentype.FakeClientWithList[*v1alpha1.ResourceEditor, *v1alpha1.ResourceEditorList] Fake *FakeMetaV1alpha1 } -var resourceeditorsResource = v1alpha1.SchemeGroupVersion.WithResource("resourceeditors") - -var resourceeditorsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceEditor") - -// Get takes name of the resourceEditor, and returns the corresponding resourceEditor object, and an error if there is any. -func (c *FakeResourceEditors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceeditorsResource, name), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// List takes label and field selectors, and returns the list of ResourceEditors that match those selectors. -func (c *FakeResourceEditors) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceEditorList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceeditorsResource, resourceeditorsKind, opts), &v1alpha1.ResourceEditorList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ResourceEditorList{ListMeta: obj.(*v1alpha1.ResourceEditorList).ListMeta} - for _, item := range obj.(*v1alpha1.ResourceEditorList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceEditors. -func (c *FakeResourceEditors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resourceeditorsResource, opts)) -} - -// Create takes the representation of a resourceEditor and creates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *FakeResourceEditors) Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceeditorsResource, resourceEditor), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// Update takes the representation of a resourceEditor and updates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *FakeResourceEditors) Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceeditorsResource, resourceEditor), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// Delete takes name of the resourceEditor and deletes it. Returns an error if one occurs. -func (c *FakeResourceEditors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceeditorsResource, name, opts), &v1alpha1.ResourceEditor{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceEditors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resourceeditorsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ResourceEditorList{}) - return err -} - -// Patch applies the patch and returns the patched resourceEditor. -func (c *FakeResourceEditors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceeditorsResource, name, pt, data, subresources...), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err +func newFakeResourceEditors(fake *FakeMetaV1alpha1) metav1alpha1.ResourceEditorInterface { + return &fakeResourceEditors{ + gentype.NewFakeClientWithList[*v1alpha1.ResourceEditor, *v1alpha1.ResourceEditorList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceeditors"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceEditor"), + func() *v1alpha1.ResourceEditor { return &v1alpha1.ResourceEditor{} }, + func() *v1alpha1.ResourceEditorList { return &v1alpha1.ResourceEditorList{} }, + func(dst, src *v1alpha1.ResourceEditorList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ResourceEditorList) []*v1alpha1.ResourceEditor { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ResourceEditorList, items []*v1alpha1.ResourceEditor) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ResourceEditor), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcegraph.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcegraph.go index 6d51104843..3eca023928 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcegraph.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcegraph.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeResourceGraphs implements ResourceGraphInterface -type FakeResourceGraphs struct { +// fakeResourceGraphs implements ResourceGraphInterface +type fakeResourceGraphs struct { + *gentype.FakeClient[*v1alpha1.ResourceGraph] Fake *FakeMetaV1alpha1 } -var resourcegraphsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcegraphs") - -var resourcegraphsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceGraph") - -// Create takes the representation of a resourceGraph and creates it. Returns the server's representation of the resourceGraph, and an error, if there is any. -func (c *FakeResourceGraphs) Create(ctx context.Context, resourceGraph *v1alpha1.ResourceGraph, opts v1.CreateOptions) (result *v1alpha1.ResourceGraph, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourcegraphsResource, resourceGraph), &v1alpha1.ResourceGraph{}) - if obj == nil { - return nil, err +func newFakeResourceGraphs(fake *FakeMetaV1alpha1) metav1alpha1.ResourceGraphInterface { + return &fakeResourceGraphs{ + gentype.NewFakeClient[*v1alpha1.ResourceGraph]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcegraphs"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceGraph"), + func() *v1alpha1.ResourceGraph { return &v1alpha1.ResourceGraph{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceGraph), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcelayout.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcelayout.go index c6de385759..32c66c7a19 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcelayout.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcelayout.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceLayouts implements ResourceLayoutInterface -type FakeResourceLayouts struct { +// fakeResourceLayouts implements ResourceLayoutInterface +type fakeResourceLayouts struct { + *gentype.FakeClient[*v1alpha1.ResourceLayout] Fake *FakeMetaV1alpha1 } -var resourcelayoutsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcelayouts") - -var resourcelayoutsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceLayout") - -// Get takes name of the resourceLayout, and returns the corresponding resourceLayout object, and an error if there is any. -func (c *FakeResourceLayouts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceLayout, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourcelayoutsResource, name), &v1alpha1.ResourceLayout{}) - if obj == nil { - return nil, err +func newFakeResourceLayouts(fake *FakeMetaV1alpha1) metav1alpha1.ResourceLayoutInterface { + return &fakeResourceLayouts{ + gentype.NewFakeClient[*v1alpha1.ResourceLayout]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcelayouts"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceLayout"), + func() *v1alpha1.ResourceLayout { return &v1alpha1.ResourceLayout{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceLayout), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcemanifests.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcemanifests.go index 0fd2fa90ec..119adef957 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcemanifests.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcemanifests.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeResourceManifestses implements ResourceManifestsInterface -type FakeResourceManifestses struct { +// fakeResourceManifestses implements ResourceManifestsInterface +type fakeResourceManifestses struct { + *gentype.FakeClient[*v1alpha1.ResourceManifests] Fake *FakeMetaV1alpha1 } -var resourcemanifestsesResource = v1alpha1.SchemeGroupVersion.WithResource("resourcemanifestses") - -var resourcemanifestsesKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceManifests") - -// Create takes the representation of a resourceManifests and creates it. Returns the server's representation of the resourceManifests, and an error, if there is any. -func (c *FakeResourceManifestses) Create(ctx context.Context, resourceManifests *v1alpha1.ResourceManifests, opts v1.CreateOptions) (result *v1alpha1.ResourceManifests, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourcemanifestsesResource, resourceManifests), &v1alpha1.ResourceManifests{}) - if obj == nil { - return nil, err +func newFakeResourceManifestses(fake *FakeMetaV1alpha1) metav1alpha1.ResourceManifestsInterface { + return &fakeResourceManifestses{ + gentype.NewFakeClient[*v1alpha1.ResourceManifests]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcemanifestses"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceManifests"), + func() *v1alpha1.ResourceManifests { return &v1alpha1.ResourceManifests{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceManifests), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutline.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutline.go index 64db7357b1..5f003c080c 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutline.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutline.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceOutlines implements ResourceOutlineInterface -type FakeResourceOutlines struct { +// fakeResourceOutlines implements ResourceOutlineInterface +type fakeResourceOutlines struct { + *gentype.FakeClient[*v1alpha1.ResourceOutline] Fake *FakeMetaV1alpha1 } -var resourceoutlinesResource = v1alpha1.SchemeGroupVersion.WithResource("resourceoutlines") - -var resourceoutlinesKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceOutline") - -// Get takes name of the resourceOutline, and returns the corresponding resourceOutline object, and an error if there is any. -func (c *FakeResourceOutlines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutline, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceoutlinesResource, name), &v1alpha1.ResourceOutline{}) - if obj == nil { - return nil, err +func newFakeResourceOutlines(fake *FakeMetaV1alpha1) metav1alpha1.ResourceOutlineInterface { + return &fakeResourceOutlines{ + gentype.NewFakeClient[*v1alpha1.ResourceOutline]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceoutlines"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceOutline"), + func() *v1alpha1.ResourceOutline { return &v1alpha1.ResourceOutline{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceOutline), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutlinefilter.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutlinefilter.go index 97ee7f6223..57b286fcc8 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutlinefilter.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourceoutlinefilter.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceOutlineFilters implements ResourceOutlineFilterInterface -type FakeResourceOutlineFilters struct { +// fakeResourceOutlineFilters implements ResourceOutlineFilterInterface +type fakeResourceOutlineFilters struct { + *gentype.FakeClient[*v1alpha1.ResourceOutlineFilter] Fake *FakeMetaV1alpha1 } -var resourceoutlinefiltersResource = v1alpha1.SchemeGroupVersion.WithResource("resourceoutlinefilters") - -var resourceoutlinefiltersKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceOutlineFilter") - -// Get takes name of the resourceOutlineFilter, and returns the corresponding resourceOutlineFilter object, and an error if there is any. -func (c *FakeResourceOutlineFilters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutlineFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceoutlinefiltersResource, name), &v1alpha1.ResourceOutlineFilter{}) - if obj == nil { - return nil, err +func newFakeResourceOutlineFilters(fake *FakeMetaV1alpha1) metav1alpha1.ResourceOutlineFilterInterface { + return &fakeResourceOutlineFilters{ + gentype.NewFakeClient[*v1alpha1.ResourceOutlineFilter]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceoutlinefilters"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceOutlineFilter"), + func() *v1alpha1.ResourceOutlineFilter { return &v1alpha1.ResourceOutlineFilter{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceOutlineFilter), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcequery.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcequery.go index 5ec0105fa3..9f72b17e31 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcequery.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcequery.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "kmodules.xyz/client-go/gentype" ) -// FakeResourceQueries implements ResourceQueryInterface -type FakeResourceQueries struct { +// fakeResourceQueries implements ResourceQueryInterface +type fakeResourceQueries struct { + *gentype.FakeClient[*v1alpha1.ResourceQuery] Fake *FakeMetaV1alpha1 } -var resourcequeriesResource = v1alpha1.SchemeGroupVersion.WithResource("resourcequeries") - -var resourcequeriesKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceQuery") - -// Create takes the representation of a resourceQuery and creates it. Returns the server's representation of the resourceQuery, and an error, if there is any. -func (c *FakeResourceQueries) Create(ctx context.Context, resourceQuery *v1alpha1.ResourceQuery, opts v1.CreateOptions) (result *v1alpha1.ResourceQuery, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourcequeriesResource, resourceQuery), &v1alpha1.ResourceQuery{}) - if obj == nil { - return nil, err +func newFakeResourceQueries(fake *FakeMetaV1alpha1) metav1alpha1.ResourceQueryInterface { + return &fakeResourceQueries{ + gentype.NewFakeClient[*v1alpha1.ResourceQuery]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcequeries"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceQuery"), + func() *v1alpha1.ResourceQuery { return &v1alpha1.ResourceQuery{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceQuery), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcetabledefinition.go b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcetabledefinition.go index 6a28252768..5d1f7ba772 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcetabledefinition.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/fake/fake_resourcetabledefinition.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/meta/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceTableDefinitions implements ResourceTableDefinitionInterface -type FakeResourceTableDefinitions struct { +// fakeResourceTableDefinitions implements ResourceTableDefinitionInterface +type fakeResourceTableDefinitions struct { + *gentype.FakeClient[*v1alpha1.ResourceTableDefinition] Fake *FakeMetaV1alpha1 } -var resourcetabledefinitionsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcetabledefinitions") - -var resourcetabledefinitionsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceTableDefinition") - -// Get takes name of the resourceTableDefinition, and returns the corresponding resourceTableDefinition object, and an error if there is any. -func (c *FakeResourceTableDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceTableDefinition, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourcetabledefinitionsResource, name), &v1alpha1.ResourceTableDefinition{}) - if obj == nil { - return nil, err +func newFakeResourceTableDefinitions(fake *FakeMetaV1alpha1) metav1alpha1.ResourceTableDefinitionInterface { + return &fakeResourceTableDefinitions{ + gentype.NewFakeClient[*v1alpha1.ResourceTableDefinition]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcetabledefinitions"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceTableDefinition"), + func() *v1alpha1.ResourceTableDefinition { return &v1alpha1.ResourceTableDefinition{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceTableDefinition), err } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/menuoutline.go b/client/clientset/versioned/typed/meta/v1alpha1/menuoutline.go index b250d1d56d..67f95edff2 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/menuoutline.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/menuoutline.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // MenuOutlinesGetter has a method to return a MenuOutlineInterface. @@ -38,141 +38,32 @@ type MenuOutlinesGetter interface { // MenuOutlineInterface has methods to work with MenuOutline resources. type MenuOutlineInterface interface { - Create(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.CreateOptions) (*v1alpha1.MenuOutline, error) - Update(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.UpdateOptions) (*v1alpha1.MenuOutline, error) + Create(ctx context.Context, menuOutline *metav1alpha1.MenuOutline, opts v1.CreateOptions) (*metav1alpha1.MenuOutline, error) + Update(ctx context.Context, menuOutline *metav1alpha1.MenuOutline, opts v1.UpdateOptions) (*metav1alpha1.MenuOutline, 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) (*v1alpha1.MenuOutline, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.MenuOutlineList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.MenuOutline, error) + List(ctx context.Context, opts v1.ListOptions) (*metav1alpha1.MenuOutlineList, 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 *v1alpha1.MenuOutline, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *metav1alpha1.MenuOutline, err error) MenuOutlineExpansion } // menuOutlines implements MenuOutlineInterface type menuOutlines struct { - client rest.Interface - ns string + *gentype.ClientWithList[*metav1alpha1.MenuOutline, *metav1alpha1.MenuOutlineList] } // newMenuOutlines returns a MenuOutlines func newMenuOutlines(c *MetaV1alpha1Client, namespace string) *menuOutlines { return &menuOutlines{ - client: c.RESTClient(), - ns: namespace, - } -} - -// Get takes name of the menuOutline, and returns the corresponding menuOutline object, and an error if there is any. -func (c *menuOutlines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MenuOutline, err error) { - result = &v1alpha1.MenuOutline{} - err = c.client.Get(). - Namespace(c.ns). - Resource("menuoutlines"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of MenuOutlines that match those selectors. -func (c *menuOutlines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MenuOutlineList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.MenuOutlineList{} - err = c.client.Get(). - Namespace(c.ns). - Resource("menuoutlines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested menuOutlines. -func (c *menuOutlines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*metav1alpha1.MenuOutline, *metav1alpha1.MenuOutlineList]( + "menuoutlines", + c.RESTClient(), + scheme.ParameterCodec, + namespace, + func() *metav1alpha1.MenuOutline { return &metav1alpha1.MenuOutline{} }, + func() *metav1alpha1.MenuOutlineList { return &metav1alpha1.MenuOutlineList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Namespace(c.ns). - Resource("menuoutlines"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a menuOutline and creates it. Returns the server's representation of the menuOutline, and an error, if there is any. -func (c *menuOutlines) Create(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.CreateOptions) (result *v1alpha1.MenuOutline, err error) { - result = &v1alpha1.MenuOutline{} - err = c.client.Post(). - Namespace(c.ns). - Resource("menuoutlines"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(menuOutline). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a menuOutline and updates it. Returns the server's representation of the menuOutline, and an error, if there is any. -func (c *menuOutlines) Update(ctx context.Context, menuOutline *v1alpha1.MenuOutline, opts v1.UpdateOptions) (result *v1alpha1.MenuOutline, err error) { - result = &v1alpha1.MenuOutline{} - err = c.client.Put(). - Namespace(c.ns). - Resource("menuoutlines"). - Name(menuOutline.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(menuOutline). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the menuOutline and deletes it. Returns an error if one occurs. -func (c *menuOutlines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Namespace(c.ns). - Resource("menuoutlines"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *menuOutlines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Namespace(c.ns). - Resource("menuoutlines"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched menuOutline. -func (c *menuOutlines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MenuOutline, err error) { - result = &v1alpha1.MenuOutline{} - err = c.client.Patch(pt). - Namespace(c.ns). - Resource("menuoutlines"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/meta_client.go b/client/clientset/versioned/typed/meta/v1alpha1/meta_client.go index b9456240ab..390e18a47d 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/meta_client.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/meta_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type MetaV1alpha1Interface interface { @@ -135,9 +136,7 @@ func (c *MetaV1alpha1Client) ResourceTableDefinitions() ResourceTableDefinitionI // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*MetaV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -149,9 +148,7 @@ func NewForConfig(c *rest.Config) (*MetaV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MetaV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -174,17 +171,15 @@ func New(c rest.Interface) *MetaV1alpha1Client { return &MetaV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := metav1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/meta/v1alpha1/render.go b/client/clientset/versioned/typed/meta/v1alpha1/render.go index d8162d3bcb..6384ec21fd 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/render.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/render.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // RendersGetter has a method to return a RenderInterface. @@ -35,30 +36,24 @@ type RendersGetter interface { // RenderInterface has methods to work with Render resources. type RenderInterface interface { - Create(ctx context.Context, render *v1alpha1.Render, opts v1.CreateOptions) (*v1alpha1.Render, error) + Create(ctx context.Context, render *metav1alpha1.Render, opts v1.CreateOptions) (*metav1alpha1.Render, error) RenderExpansion } // renders implements RenderInterface type renders struct { - client rest.Interface + *gentype.Client[*metav1alpha1.Render] } // newRenders returns a Renders func newRenders(c *MetaV1alpha1Client) *renders { return &renders{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.Render]( + "renders", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.Render { return &metav1alpha1.Render{} }, + ), } } - -// Create takes the representation of a render and creates it. Returns the server's representation of the render, and an error, if there is any. -func (c *renders) Create(ctx context.Context, render *v1alpha1.Render, opts v1.CreateOptions) (result *v1alpha1.Render, err error) { - result = &v1alpha1.Render{} - err = c.client.Post(). - Resource("renders"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(render). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/renderdashboard.go b/client/clientset/versioned/typed/meta/v1alpha1/renderdashboard.go index 5586ce9b13..fc7c74f887 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/renderdashboard.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/renderdashboard.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // RenderDashboardsGetter has a method to return a RenderDashboardInterface. @@ -35,30 +36,24 @@ type RenderDashboardsGetter interface { // RenderDashboardInterface has methods to work with RenderDashboard resources. type RenderDashboardInterface interface { - Create(ctx context.Context, renderDashboard *v1alpha1.RenderDashboard, opts v1.CreateOptions) (*v1alpha1.RenderDashboard, error) + Create(ctx context.Context, renderDashboard *metav1alpha1.RenderDashboard, opts v1.CreateOptions) (*metav1alpha1.RenderDashboard, error) RenderDashboardExpansion } // renderDashboards implements RenderDashboardInterface type renderDashboards struct { - client rest.Interface + *gentype.Client[*metav1alpha1.RenderDashboard] } // newRenderDashboards returns a RenderDashboards func newRenderDashboards(c *MetaV1alpha1Client) *renderDashboards { return &renderDashboards{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.RenderDashboard]( + "renderdashboards", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.RenderDashboard { return &metav1alpha1.RenderDashboard{} }, + ), } } - -// Create takes the representation of a renderDashboard and creates it. Returns the server's representation of the renderDashboard, and an error, if there is any. -func (c *renderDashboards) Create(ctx context.Context, renderDashboard *v1alpha1.RenderDashboard, opts v1.CreateOptions) (result *v1alpha1.RenderDashboard, err error) { - result = &v1alpha1.RenderDashboard{} - err = c.client.Post(). - Resource("renderdashboards"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(renderDashboard). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/rendermenu.go b/client/clientset/versioned/typed/meta/v1alpha1/rendermenu.go index 98d964836a..7c314da4bc 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/rendermenu.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/rendermenu.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // RenderMenusGetter has a method to return a RenderMenuInterface. @@ -35,30 +36,24 @@ type RenderMenusGetter interface { // RenderMenuInterface has methods to work with RenderMenu resources. type RenderMenuInterface interface { - Create(ctx context.Context, renderMenu *v1alpha1.RenderMenu, opts v1.CreateOptions) (*v1alpha1.RenderMenu, error) + Create(ctx context.Context, renderMenu *metav1alpha1.RenderMenu, opts v1.CreateOptions) (*metav1alpha1.RenderMenu, error) RenderMenuExpansion } // renderMenus implements RenderMenuInterface type renderMenus struct { - client rest.Interface + *gentype.Client[*metav1alpha1.RenderMenu] } // newRenderMenus returns a RenderMenus func newRenderMenus(c *MetaV1alpha1Client) *renderMenus { return &renderMenus{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.RenderMenu]( + "rendermenus", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.RenderMenu { return &metav1alpha1.RenderMenu{} }, + ), } } - -// Create takes the representation of a renderMenu and creates it. Returns the server's representation of the renderMenu, and an error, if there is any. -func (c *renderMenus) Create(ctx context.Context, renderMenu *v1alpha1.RenderMenu, opts v1.CreateOptions) (result *v1alpha1.RenderMenu, err error) { - result = &v1alpha1.RenderMenu{} - err = c.client.Post(). - Resource("rendermenus"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(renderMenu). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/renderrawgraph.go b/client/clientset/versioned/typed/meta/v1alpha1/renderrawgraph.go index 7b91e12d1f..3dab025cda 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/renderrawgraph.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/renderrawgraph.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // RenderRawGraphsGetter has a method to return a RenderRawGraphInterface. @@ -35,30 +36,24 @@ type RenderRawGraphsGetter interface { // RenderRawGraphInterface has methods to work with RenderRawGraph resources. type RenderRawGraphInterface interface { - Create(ctx context.Context, renderRawGraph *v1alpha1.RenderRawGraph, opts v1.CreateOptions) (*v1alpha1.RenderRawGraph, error) + Create(ctx context.Context, renderRawGraph *metav1alpha1.RenderRawGraph, opts v1.CreateOptions) (*metav1alpha1.RenderRawGraph, error) RenderRawGraphExpansion } // renderRawGraphs implements RenderRawGraphInterface type renderRawGraphs struct { - client rest.Interface + *gentype.Client[*metav1alpha1.RenderRawGraph] } // newRenderRawGraphs returns a RenderRawGraphs func newRenderRawGraphs(c *MetaV1alpha1Client) *renderRawGraphs { return &renderRawGraphs{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.RenderRawGraph]( + "renderrawgraphs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.RenderRawGraph { return &metav1alpha1.RenderRawGraph{} }, + ), } } - -// Create takes the representation of a renderRawGraph and creates it. Returns the server's representation of the renderRawGraph, and an error, if there is any. -func (c *renderRawGraphs) Create(ctx context.Context, renderRawGraph *v1alpha1.RenderRawGraph, opts v1.CreateOptions) (result *v1alpha1.RenderRawGraph, err error) { - result = &v1alpha1.RenderRawGraph{} - err = c.client.Post(). - Resource("renderrawgraphs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(renderRawGraph). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourceblockdefinition.go b/client/clientset/versioned/typed/meta/v1alpha1/resourceblockdefinition.go index a7ba928739..86919f6f4f 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourceblockdefinition.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourceblockdefinition.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceBlockDefinitionsGetter has a method to return a ResourceBlockDefinitionInterface. @@ -35,30 +36,24 @@ type ResourceBlockDefinitionsGetter interface { // ResourceBlockDefinitionInterface has methods to work with ResourceBlockDefinition resources. type ResourceBlockDefinitionInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceBlockDefinition, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceBlockDefinition, error) ResourceBlockDefinitionExpansion } // resourceBlockDefinitions implements ResourceBlockDefinitionInterface type resourceBlockDefinitions struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceBlockDefinition] } // newResourceBlockDefinitions returns a ResourceBlockDefinitions func newResourceBlockDefinitions(c *MetaV1alpha1Client) *resourceBlockDefinitions { return &resourceBlockDefinitions{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceBlockDefinition]( + "resourceblockdefinitions", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceBlockDefinition { return &metav1alpha1.ResourceBlockDefinition{} }, + ), } } - -// Get takes name of the resourceBlockDefinition, and returns the corresponding resourceBlockDefinition object, and an error if there is any. -func (c *resourceBlockDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceBlockDefinition, err error) { - result = &v1alpha1.ResourceBlockDefinition{} - err = c.client.Get(). - Resource("resourceblockdefinitions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcecalculator.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcecalculator.go index 1062228b0b..a1221e48d3 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcecalculator.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcecalculator.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceCalculatorsGetter has a method to return a ResourceCalculatorInterface. @@ -35,30 +36,24 @@ type ResourceCalculatorsGetter interface { // ResourceCalculatorInterface has methods to work with ResourceCalculator resources. type ResourceCalculatorInterface interface { - Create(ctx context.Context, resourceCalculator *v1alpha1.ResourceCalculator, opts v1.CreateOptions) (*v1alpha1.ResourceCalculator, error) + Create(ctx context.Context, resourceCalculator *metav1alpha1.ResourceCalculator, opts v1.CreateOptions) (*metav1alpha1.ResourceCalculator, error) ResourceCalculatorExpansion } // resourceCalculators implements ResourceCalculatorInterface type resourceCalculators struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceCalculator] } // newResourceCalculators returns a ResourceCalculators func newResourceCalculators(c *MetaV1alpha1Client) *resourceCalculators { return &resourceCalculators{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceCalculator]( + "resourcecalculators", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceCalculator { return &metav1alpha1.ResourceCalculator{} }, + ), } } - -// Create takes the representation of a resourceCalculator and creates it. Returns the server's representation of the resourceCalculator, and an error, if there is any. -func (c *resourceCalculators) Create(ctx context.Context, resourceCalculator *v1alpha1.ResourceCalculator, opts v1.CreateOptions) (result *v1alpha1.ResourceCalculator, err error) { - result = &v1alpha1.ResourceCalculator{} - err = c.client.Post(). - Resource("resourcecalculators"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceCalculator). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcedescriptor.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcedescriptor.go index f49382a2fe..82b0e40429 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcedescriptor.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcedescriptor.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceDescriptorsGetter has a method to return a ResourceDescriptorInterface. @@ -35,30 +36,24 @@ type ResourceDescriptorsGetter interface { // ResourceDescriptorInterface has methods to work with ResourceDescriptor resources. type ResourceDescriptorInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceDescriptor, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceDescriptor, error) ResourceDescriptorExpansion } // resourceDescriptors implements ResourceDescriptorInterface type resourceDescriptors struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceDescriptor] } // newResourceDescriptors returns a ResourceDescriptors func newResourceDescriptors(c *MetaV1alpha1Client) *resourceDescriptors { return &resourceDescriptors{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceDescriptor]( + "resourcedescriptors", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceDescriptor { return &metav1alpha1.ResourceDescriptor{} }, + ), } } - -// Get takes name of the resourceDescriptor, and returns the corresponding resourceDescriptor object, and an error if there is any. -func (c *resourceDescriptors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceDescriptor, err error) { - result = &v1alpha1.ResourceDescriptor{} - err = c.client.Get(). - Resource("resourcedescriptors"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourceeditor.go b/client/clientset/versioned/typed/meta/v1alpha1/resourceeditor.go index cc544f1cf8..3775314bb5 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourceeditor.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourceeditor.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ResourceEditorsGetter has a method to return a ResourceEditorInterface. @@ -38,131 +38,32 @@ type ResourceEditorsGetter interface { // ResourceEditorInterface has methods to work with ResourceEditor resources. type ResourceEditorInterface interface { - Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (*v1alpha1.ResourceEditor, error) - Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (*v1alpha1.ResourceEditor, error) + Create(ctx context.Context, resourceEditor *metav1alpha1.ResourceEditor, opts v1.CreateOptions) (*metav1alpha1.ResourceEditor, error) + Update(ctx context.Context, resourceEditor *metav1alpha1.ResourceEditor, opts v1.UpdateOptions) (*metav1alpha1.ResourceEditor, 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) (*v1alpha1.ResourceEditor, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResourceEditorList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceEditor, error) + List(ctx context.Context, opts v1.ListOptions) (*metav1alpha1.ResourceEditorList, 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 *v1alpha1.ResourceEditor, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *metav1alpha1.ResourceEditor, err error) ResourceEditorExpansion } // resourceEditors implements ResourceEditorInterface type resourceEditors struct { - client rest.Interface + *gentype.ClientWithList[*metav1alpha1.ResourceEditor, *metav1alpha1.ResourceEditorList] } // newResourceEditors returns a ResourceEditors func newResourceEditors(c *MetaV1alpha1Client) *resourceEditors { return &resourceEditors{ - client: c.RESTClient(), - } -} - -// Get takes name of the resourceEditor, and returns the corresponding resourceEditor object, and an error if there is any. -func (c *resourceEditors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Get(). - Resource("resourceeditors"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceEditors that match those selectors. -func (c *resourceEditors) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceEditorList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ResourceEditorList{} - err = c.client.Get(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceEditors. -func (c *resourceEditors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*metav1alpha1.ResourceEditor, *metav1alpha1.ResourceEditorList]( + "resourceeditors", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceEditor { return &metav1alpha1.ResourceEditor{} }, + func() *metav1alpha1.ResourceEditorList { return &metav1alpha1.ResourceEditorList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceEditor and creates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *resourceEditors) Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Post(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceEditor). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceEditor and updates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *resourceEditors) Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Put(). - Resource("resourceeditors"). - Name(resourceEditor.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceEditor). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceEditor and deletes it. Returns an error if one occurs. -func (c *resourceEditors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("resourceeditors"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceEditors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("resourceeditors"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceEditor. -func (c *resourceEditors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Patch(pt). - Resource("resourceeditors"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcegraph.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcegraph.go index 94c47b9532..d0f40cac4c 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcegraph.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcegraph.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // ResourceGraphsGetter has a method to return a ResourceGraphInterface. @@ -35,30 +36,24 @@ type ResourceGraphsGetter interface { // ResourceGraphInterface has methods to work with ResourceGraph resources. type ResourceGraphInterface interface { - Create(ctx context.Context, resourceGraph *v1alpha1.ResourceGraph, opts v1.CreateOptions) (*v1alpha1.ResourceGraph, error) + Create(ctx context.Context, resourceGraph *metav1alpha1.ResourceGraph, opts v1.CreateOptions) (*metav1alpha1.ResourceGraph, error) ResourceGraphExpansion } // resourceGraphs implements ResourceGraphInterface type resourceGraphs struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceGraph] } // newResourceGraphs returns a ResourceGraphs func newResourceGraphs(c *MetaV1alpha1Client) *resourceGraphs { return &resourceGraphs{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceGraph]( + "resourcegraphs", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceGraph { return &metav1alpha1.ResourceGraph{} }, + ), } } - -// Create takes the representation of a resourceGraph and creates it. Returns the server's representation of the resourceGraph, and an error, if there is any. -func (c *resourceGraphs) Create(ctx context.Context, resourceGraph *v1alpha1.ResourceGraph, opts v1.CreateOptions) (result *v1alpha1.ResourceGraph, err error) { - result = &v1alpha1.ResourceGraph{} - err = c.client.Post(). - Resource("resourcegraphs"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceGraph). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcelayout.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcelayout.go index 8e692fa64b..87a67be2d9 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcelayout.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcelayout.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceLayoutsGetter has a method to return a ResourceLayoutInterface. @@ -35,30 +36,24 @@ type ResourceLayoutsGetter interface { // ResourceLayoutInterface has methods to work with ResourceLayout resources. type ResourceLayoutInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceLayout, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceLayout, error) ResourceLayoutExpansion } // resourceLayouts implements ResourceLayoutInterface type resourceLayouts struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceLayout] } // newResourceLayouts returns a ResourceLayouts func newResourceLayouts(c *MetaV1alpha1Client) *resourceLayouts { return &resourceLayouts{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceLayout]( + "resourcelayouts", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceLayout { return &metav1alpha1.ResourceLayout{} }, + ), } } - -// Get takes name of the resourceLayout, and returns the corresponding resourceLayout object, and an error if there is any. -func (c *resourceLayouts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceLayout, err error) { - result = &v1alpha1.ResourceLayout{} - err = c.client.Get(). - Resource("resourcelayouts"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcemanifests.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcemanifests.go index 5b46931245..5a9ce85af4 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcemanifests.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcemanifests.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // ResourceManifestsesGetter has a method to return a ResourceManifestsInterface. @@ -35,30 +36,24 @@ type ResourceManifestsesGetter interface { // ResourceManifestsInterface has methods to work with ResourceManifests resources. type ResourceManifestsInterface interface { - Create(ctx context.Context, resourceManifests *v1alpha1.ResourceManifests, opts v1.CreateOptions) (*v1alpha1.ResourceManifests, error) + Create(ctx context.Context, resourceManifests *metav1alpha1.ResourceManifests, opts v1.CreateOptions) (*metav1alpha1.ResourceManifests, error) ResourceManifestsExpansion } // resourceManifestses implements ResourceManifestsInterface type resourceManifestses struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceManifests] } // newResourceManifestses returns a ResourceManifestses func newResourceManifestses(c *MetaV1alpha1Client) *resourceManifestses { return &resourceManifestses{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceManifests]( + "resourcemanifestses", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceManifests { return &metav1alpha1.ResourceManifests{} }, + ), } } - -// Create takes the representation of a resourceManifests and creates it. Returns the server's representation of the resourceManifests, and an error, if there is any. -func (c *resourceManifestses) Create(ctx context.Context, resourceManifests *v1alpha1.ResourceManifests, opts v1.CreateOptions) (result *v1alpha1.ResourceManifests, err error) { - result = &v1alpha1.ResourceManifests{} - err = c.client.Post(). - Resource("resourcemanifestses"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceManifests). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourceoutline.go b/client/clientset/versioned/typed/meta/v1alpha1/resourceoutline.go index 60a92f6ed4..adbec6995c 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourceoutline.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourceoutline.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceOutlinesGetter has a method to return a ResourceOutlineInterface. @@ -35,30 +36,24 @@ type ResourceOutlinesGetter interface { // ResourceOutlineInterface has methods to work with ResourceOutline resources. type ResourceOutlineInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceOutline, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceOutline, error) ResourceOutlineExpansion } // resourceOutlines implements ResourceOutlineInterface type resourceOutlines struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceOutline] } // newResourceOutlines returns a ResourceOutlines func newResourceOutlines(c *MetaV1alpha1Client) *resourceOutlines { return &resourceOutlines{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceOutline]( + "resourceoutlines", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceOutline { return &metav1alpha1.ResourceOutline{} }, + ), } } - -// Get takes name of the resourceOutline, and returns the corresponding resourceOutline object, and an error if there is any. -func (c *resourceOutlines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutline, err error) { - result = &v1alpha1.ResourceOutline{} - err = c.client.Get(). - Resource("resourceoutlines"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourceoutlinefilter.go b/client/clientset/versioned/typed/meta/v1alpha1/resourceoutlinefilter.go index 45c4f9bc36..ec5bd3a704 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourceoutlinefilter.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourceoutlinefilter.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceOutlineFiltersGetter has a method to return a ResourceOutlineFilterInterface. @@ -35,30 +36,24 @@ type ResourceOutlineFiltersGetter interface { // ResourceOutlineFilterInterface has methods to work with ResourceOutlineFilter resources. type ResourceOutlineFilterInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceOutlineFilter, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceOutlineFilter, error) ResourceOutlineFilterExpansion } // resourceOutlineFilters implements ResourceOutlineFilterInterface type resourceOutlineFilters struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceOutlineFilter] } // newResourceOutlineFilters returns a ResourceOutlineFilters func newResourceOutlineFilters(c *MetaV1alpha1Client) *resourceOutlineFilters { return &resourceOutlineFilters{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceOutlineFilter]( + "resourceoutlinefilters", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceOutlineFilter { return &metav1alpha1.ResourceOutlineFilter{} }, + ), } } - -// Get takes name of the resourceOutlineFilter, and returns the corresponding resourceOutlineFilter object, and an error if there is any. -func (c *resourceOutlineFilters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutlineFilter, err error) { - result = &v1alpha1.ResourceOutlineFilter{} - err = c.client.Get(). - Resource("resourceoutlinefilters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcequery.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcequery.go index 68a8fe30da..78354a93e0 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcequery.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcequery.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "kmodules.xyz/client-go/gentype" ) // ResourceQueriesGetter has a method to return a ResourceQueryInterface. @@ -35,30 +36,24 @@ type ResourceQueriesGetter interface { // ResourceQueryInterface has methods to work with ResourceQuery resources. type ResourceQueryInterface interface { - Create(ctx context.Context, resourceQuery *v1alpha1.ResourceQuery, opts v1.CreateOptions) (*v1alpha1.ResourceQuery, error) + Create(ctx context.Context, resourceQuery *metav1alpha1.ResourceQuery, opts v1.CreateOptions) (*metav1alpha1.ResourceQuery, error) ResourceQueryExpansion } // resourceQueries implements ResourceQueryInterface type resourceQueries struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceQuery] } // newResourceQueries returns a ResourceQueries func newResourceQueries(c *MetaV1alpha1Client) *resourceQueries { return &resourceQueries{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceQuery]( + "resourcequeries", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceQuery { return &metav1alpha1.ResourceQuery{} }, + ), } } - -// Create takes the representation of a resourceQuery and creates it. Returns the server's representation of the resourceQuery, and an error, if there is any. -func (c *resourceQueries) Create(ctx context.Context, resourceQuery *v1alpha1.ResourceQuery, opts v1.CreateOptions) (result *v1alpha1.ResourceQuery, err error) { - result = &v1alpha1.ResourceQuery{} - err = c.client.Post(). - Resource("resourcequeries"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceQuery). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/meta/v1alpha1/resourcetabledefinition.go b/client/clientset/versioned/typed/meta/v1alpha1/resourcetabledefinition.go index b7ce560162..2dd66a2d1d 100644 --- a/client/clientset/versioned/typed/meta/v1alpha1/resourcetabledefinition.go +++ b/client/clientset/versioned/typed/meta/v1alpha1/resourcetabledefinition.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" + metav1alpha1 "kmodules.xyz/resource-metadata/apis/meta/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceTableDefinitionsGetter has a method to return a ResourceTableDefinitionInterface. @@ -35,30 +36,24 @@ type ResourceTableDefinitionsGetter interface { // ResourceTableDefinitionInterface has methods to work with ResourceTableDefinition resources. type ResourceTableDefinitionInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceTableDefinition, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*metav1alpha1.ResourceTableDefinition, error) ResourceTableDefinitionExpansion } // resourceTableDefinitions implements ResourceTableDefinitionInterface type resourceTableDefinitions struct { - client rest.Interface + *gentype.Client[*metav1alpha1.ResourceTableDefinition] } // newResourceTableDefinitions returns a ResourceTableDefinitions func newResourceTableDefinitions(c *MetaV1alpha1Client) *resourceTableDefinitions { return &resourceTableDefinitions{ - client: c.RESTClient(), + gentype.NewClient[*metav1alpha1.ResourceTableDefinition]( + "resourcetabledefinitions", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *metav1alpha1.ResourceTableDefinition { return &metav1alpha1.ResourceTableDefinition{} }, + ), } } - -// Get takes name of the resourceTableDefinition, and returns the corresponding resourceTableDefinition object, and an error if there is any. -func (c *resourceTableDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceTableDefinition, err error) { - result = &v1alpha1.ResourceTableDefinition{} - err = c.client.Get(). - Resource("resourcetabledefinitions"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/node/v1alpha1/fake/fake_node_client.go b/client/clientset/versioned/typed/node/v1alpha1/fake/fake_node_client.go index c7834db3cd..a7b5e5e692 100644 --- a/client/clientset/versioned/typed/node/v1alpha1/fake/fake_node_client.go +++ b/client/clientset/versioned/typed/node/v1alpha1/fake/fake_node_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/node/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/node/v1alpha1" ) type FakeNodeV1alpha1 struct { @@ -29,7 +30,7 @@ type FakeNodeV1alpha1 struct { } func (c *FakeNodeV1alpha1) NodeTopologies() v1alpha1.NodeTopologyInterface { - return &FakeNodeTopologies{c} + return newFakeNodeTopologies(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/node/v1alpha1/fake/fake_nodetopology.go b/client/clientset/versioned/typed/node/v1alpha1/fake/fake_nodetopology.go index 929ed21d95..cd21898977 100644 --- a/client/clientset/versioned/typed/node/v1alpha1/fake/fake_nodetopology.go +++ b/client/clientset/versioned/typed/node/v1alpha1/fake/fake_nodetopology.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" + nodev1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/node/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeNodeTopologies implements NodeTopologyInterface -type FakeNodeTopologies struct { +// fakeNodeTopologies implements NodeTopologyInterface +type fakeNodeTopologies struct { + *gentype.FakeClientWithList[*v1alpha1.NodeTopology, *v1alpha1.NodeTopologyList] Fake *FakeNodeV1alpha1 } -var nodetopologiesResource = v1alpha1.SchemeGroupVersion.WithResource("nodetopologies") - -var nodetopologiesKind = v1alpha1.SchemeGroupVersion.WithKind("NodeTopology") - -// Get takes name of the nodeTopology, and returns the corresponding nodeTopology object, and an error if there is any. -func (c *FakeNodeTopologies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeTopology, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(nodetopologiesResource, name), &v1alpha1.NodeTopology{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.NodeTopology), err -} - -// List takes label and field selectors, and returns the list of NodeTopologies that match those selectors. -func (c *FakeNodeTopologies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeTopologyList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(nodetopologiesResource, nodetopologiesKind, opts), &v1alpha1.NodeTopologyList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.NodeTopologyList{ListMeta: obj.(*v1alpha1.NodeTopologyList).ListMeta} - for _, item := range obj.(*v1alpha1.NodeTopologyList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested nodeTopologies. -func (c *FakeNodeTopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(nodetopologiesResource, opts)) -} - -// Create takes the representation of a nodeTopology and creates it. Returns the server's representation of the nodeTopology, and an error, if there is any. -func (c *FakeNodeTopologies) Create(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.CreateOptions) (result *v1alpha1.NodeTopology, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(nodetopologiesResource, nodeTopology), &v1alpha1.NodeTopology{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.NodeTopology), err -} - -// Update takes the representation of a nodeTopology and updates it. Returns the server's representation of the nodeTopology, and an error, if there is any. -func (c *FakeNodeTopologies) Update(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.UpdateOptions) (result *v1alpha1.NodeTopology, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(nodetopologiesResource, nodeTopology), &v1alpha1.NodeTopology{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.NodeTopology), err -} - -// Delete takes name of the nodeTopology and deletes it. Returns an error if one occurs. -func (c *FakeNodeTopologies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(nodetopologiesResource, name, opts), &v1alpha1.NodeTopology{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeTopologies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(nodetopologiesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.NodeTopologyList{}) - return err -} - -// Patch applies the patch and returns the patched nodeTopology. -func (c *FakeNodeTopologies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeTopology, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(nodetopologiesResource, name, pt, data, subresources...), &v1alpha1.NodeTopology{}) - if obj == nil { - return nil, err +func newFakeNodeTopologies(fake *FakeNodeV1alpha1) nodev1alpha1.NodeTopologyInterface { + return &fakeNodeTopologies{ + gentype.NewFakeClientWithList[*v1alpha1.NodeTopology, *v1alpha1.NodeTopologyList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("nodetopologies"), + v1alpha1.SchemeGroupVersion.WithKind("NodeTopology"), + func() *v1alpha1.NodeTopology { return &v1alpha1.NodeTopology{} }, + func() *v1alpha1.NodeTopologyList { return &v1alpha1.NodeTopologyList{} }, + func(dst, src *v1alpha1.NodeTopologyList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.NodeTopologyList) []*v1alpha1.NodeTopology { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.NodeTopologyList, items []*v1alpha1.NodeTopology) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.NodeTopology), err } diff --git a/client/clientset/versioned/typed/node/v1alpha1/node_client.go b/client/clientset/versioned/typed/node/v1alpha1/node_client.go index a31c72b6af..5732acd1a0 100644 --- a/client/clientset/versioned/typed/node/v1alpha1/node_client.go +++ b/client/clientset/versioned/typed/node/v1alpha1/node_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + nodev1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type NodeV1alpha1Interface interface { @@ -45,9 +46,7 @@ func (c *NodeV1alpha1Client) NodeTopologies() NodeTopologyInterface { // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*NodeV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -59,9 +58,7 @@ func NewForConfig(c *rest.Config) (*NodeV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -84,17 +81,15 @@ func New(c rest.Interface) *NodeV1alpha1Client { return &NodeV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := nodev1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/node/v1alpha1/nodetopology.go b/client/clientset/versioned/typed/node/v1alpha1/nodetopology.go index 475b1f3b94..42fe42363b 100644 --- a/client/clientset/versioned/typed/node/v1alpha1/nodetopology.go +++ b/client/clientset/versioned/typed/node/v1alpha1/nodetopology.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + nodev1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/node/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // NodeTopologiesGetter has a method to return a NodeTopologyInterface. @@ -38,131 +38,32 @@ type NodeTopologiesGetter interface { // NodeTopologyInterface has methods to work with NodeTopology resources. type NodeTopologyInterface interface { - Create(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.CreateOptions) (*v1alpha1.NodeTopology, error) - Update(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.UpdateOptions) (*v1alpha1.NodeTopology, error) + Create(ctx context.Context, nodeTopology *nodev1alpha1.NodeTopology, opts v1.CreateOptions) (*nodev1alpha1.NodeTopology, error) + Update(ctx context.Context, nodeTopology *nodev1alpha1.NodeTopology, opts v1.UpdateOptions) (*nodev1alpha1.NodeTopology, 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) (*v1alpha1.NodeTopology, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NodeTopologyList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*nodev1alpha1.NodeTopology, error) + List(ctx context.Context, opts v1.ListOptions) (*nodev1alpha1.NodeTopologyList, 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 *v1alpha1.NodeTopology, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nodev1alpha1.NodeTopology, err error) NodeTopologyExpansion } // nodeTopologies implements NodeTopologyInterface type nodeTopologies struct { - client rest.Interface + *gentype.ClientWithList[*nodev1alpha1.NodeTopology, *nodev1alpha1.NodeTopologyList] } // newNodeTopologies returns a NodeTopologies func newNodeTopologies(c *NodeV1alpha1Client) *nodeTopologies { return &nodeTopologies{ - client: c.RESTClient(), - } -} - -// Get takes name of the nodeTopology, and returns the corresponding nodeTopology object, and an error if there is any. -func (c *nodeTopologies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeTopology, err error) { - result = &v1alpha1.NodeTopology{} - err = c.client.Get(). - Resource("nodetopologies"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of NodeTopologies that match those selectors. -func (c *nodeTopologies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeTopologyList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.NodeTopologyList{} - err = c.client.Get(). - Resource("nodetopologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested nodeTopologies. -func (c *nodeTopologies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*nodev1alpha1.NodeTopology, *nodev1alpha1.NodeTopologyList]( + "nodetopologies", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *nodev1alpha1.NodeTopology { return &nodev1alpha1.NodeTopology{} }, + func() *nodev1alpha1.NodeTopologyList { return &nodev1alpha1.NodeTopologyList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("nodetopologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a nodeTopology and creates it. Returns the server's representation of the nodeTopology, and an error, if there is any. -func (c *nodeTopologies) Create(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.CreateOptions) (result *v1alpha1.NodeTopology, err error) { - result = &v1alpha1.NodeTopology{} - err = c.client.Post(). - Resource("nodetopologies"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nodeTopology). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a nodeTopology and updates it. Returns the server's representation of the nodeTopology, and an error, if there is any. -func (c *nodeTopologies) Update(ctx context.Context, nodeTopology *v1alpha1.NodeTopology, opts v1.UpdateOptions) (result *v1alpha1.NodeTopology, err error) { - result = &v1alpha1.NodeTopology{} - err = c.client.Put(). - Resource("nodetopologies"). - Name(nodeTopology.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(nodeTopology). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the nodeTopology and deletes it. Returns an error if one occurs. -func (c *nodeTopologies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("nodetopologies"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *nodeTopologies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("nodetopologies"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched nodeTopology. -func (c *nodeTopologies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeTopology, err error) { - result = &v1alpha1.NodeTopology{} - err = c.client.Patch(pt). - Resource("nodetopologies"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/clusterprofile.go b/client/clientset/versioned/typed/ui/v1alpha1/clusterprofile.go index 577880a253..474ce2f9b3 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/clusterprofile.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/clusterprofile.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ClusterProfilesGetter has a method to return a ClusterProfileInterface. @@ -38,131 +38,32 @@ type ClusterProfilesGetter interface { // ClusterProfileInterface has methods to work with ClusterProfile resources. type ClusterProfileInterface interface { - Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (*v1alpha1.ClusterProfile, error) - Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (*v1alpha1.ClusterProfile, error) + Create(ctx context.Context, clusterProfile *uiv1alpha1.ClusterProfile, opts v1.CreateOptions) (*uiv1alpha1.ClusterProfile, error) + Update(ctx context.Context, clusterProfile *uiv1alpha1.ClusterProfile, opts v1.UpdateOptions) (*uiv1alpha1.ClusterProfile, 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) (*v1alpha1.ClusterProfile, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterProfileList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.ClusterProfile, error) + List(ctx context.Context, opts v1.ListOptions) (*uiv1alpha1.ClusterProfileList, 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 *v1alpha1.ClusterProfile, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *uiv1alpha1.ClusterProfile, err error) ClusterProfileExpansion } // clusterProfiles implements ClusterProfileInterface type clusterProfiles struct { - client rest.Interface + *gentype.ClientWithList[*uiv1alpha1.ClusterProfile, *uiv1alpha1.ClusterProfileList] } // newClusterProfiles returns a ClusterProfiles func newClusterProfiles(c *UiV1alpha1Client) *clusterProfiles { return &clusterProfiles{ - client: c.RESTClient(), - } -} - -// Get takes name of the clusterProfile, and returns the corresponding clusterProfile object, and an error if there is any. -func (c *clusterProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Get(). - Resource("clusterprofiles"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ClusterProfiles that match those selectors. -func (c *clusterProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterProfileList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ClusterProfileList{} - err = c.client.Get(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested clusterProfiles. -func (c *clusterProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*uiv1alpha1.ClusterProfile, *uiv1alpha1.ClusterProfileList]( + "clusterprofiles", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.ClusterProfile { return &uiv1alpha1.ClusterProfile{} }, + func() *uiv1alpha1.ClusterProfileList { return &uiv1alpha1.ClusterProfileList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a clusterProfile and creates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *clusterProfiles) Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Post(). - Resource("clusterprofiles"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterProfile). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a clusterProfile and updates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *clusterProfiles) Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Put(). - Resource("clusterprofiles"). - Name(clusterProfile.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(clusterProfile). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the clusterProfile and deletes it. Returns an error if one occurs. -func (c *clusterProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("clusterprofiles"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *clusterProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("clusterprofiles"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched clusterProfile. -func (c *clusterProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterProfile, err error) { - result = &v1alpha1.ClusterProfile{} - err = c.client.Patch(pt). - Resource("clusterprofiles"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_clusterprofile.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_clusterprofile.go index e36e54fac0..b3a505aa70 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_clusterprofile.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_clusterprofile.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeClusterProfiles implements ClusterProfileInterface -type FakeClusterProfiles struct { +// fakeClusterProfiles implements ClusterProfileInterface +type fakeClusterProfiles struct { + *gentype.FakeClientWithList[*v1alpha1.ClusterProfile, *v1alpha1.ClusterProfileList] Fake *FakeUiV1alpha1 } -var clusterprofilesResource = v1alpha1.SchemeGroupVersion.WithResource("clusterprofiles") - -var clusterprofilesKind = v1alpha1.SchemeGroupVersion.WithKind("ClusterProfile") - -// Get takes name of the clusterProfile, and returns the corresponding clusterProfile object, and an error if there is any. -func (c *FakeClusterProfiles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(clusterprofilesResource, name), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// List takes label and field selectors, and returns the list of ClusterProfiles that match those selectors. -func (c *FakeClusterProfiles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterProfileList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(clusterprofilesResource, clusterprofilesKind, opts), &v1alpha1.ClusterProfileList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ClusterProfileList{ListMeta: obj.(*v1alpha1.ClusterProfileList).ListMeta} - for _, item := range obj.(*v1alpha1.ClusterProfileList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested clusterProfiles. -func (c *FakeClusterProfiles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(clusterprofilesResource, opts)) -} - -// Create takes the representation of a clusterProfile and creates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *FakeClusterProfiles) Create(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.CreateOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(clusterprofilesResource, clusterProfile), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// Update takes the representation of a clusterProfile and updates it. Returns the server's representation of the clusterProfile, and an error, if there is any. -func (c *FakeClusterProfiles) Update(ctx context.Context, clusterProfile *v1alpha1.ClusterProfile, opts v1.UpdateOptions) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(clusterprofilesResource, clusterProfile), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ClusterProfile), err -} - -// Delete takes name of the clusterProfile and deletes it. Returns an error if one occurs. -func (c *FakeClusterProfiles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterprofilesResource, name, opts), &v1alpha1.ClusterProfile{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterProfiles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterprofilesResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ClusterProfileList{}) - return err -} - -// Patch applies the patch and returns the patched clusterProfile. -func (c *FakeClusterProfiles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterProfile, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(clusterprofilesResource, name, pt, data, subresources...), &v1alpha1.ClusterProfile{}) - if obj == nil { - return nil, err +func newFakeClusterProfiles(fake *FakeUiV1alpha1) uiv1alpha1.ClusterProfileInterface { + return &fakeClusterProfiles{ + gentype.NewFakeClientWithList[*v1alpha1.ClusterProfile, *v1alpha1.ClusterProfileList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("clusterprofiles"), + v1alpha1.SchemeGroupVersion.WithKind("ClusterProfile"), + func() *v1alpha1.ClusterProfile { return &v1alpha1.ClusterProfile{} }, + func() *v1alpha1.ClusterProfileList { return &v1alpha1.ClusterProfileList{} }, + func(dst, src *v1alpha1.ClusterProfileList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ClusterProfileList) []*v1alpha1.ClusterProfile { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ClusterProfileList, items []*v1alpha1.ClusterProfile) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ClusterProfile), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_feature.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_feature.go index 589cd454ef..8abfa5d8a8 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_feature.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_feature.go @@ -19,114 +19,33 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeFeatures implements FeatureInterface -type FakeFeatures struct { +// fakeFeatures implements FeatureInterface +type fakeFeatures struct { + *gentype.FakeClientWithList[*v1alpha1.Feature, *v1alpha1.FeatureList] Fake *FakeUiV1alpha1 } -var featuresResource = v1alpha1.SchemeGroupVersion.WithResource("features") - -var featuresKind = v1alpha1.SchemeGroupVersion.WithKind("Feature") - -// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. -func (c *FakeFeatures) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Feature, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(featuresResource, name), &v1alpha1.Feature{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Feature), err -} - -// List takes label and field selectors, and returns the list of Features that match those selectors. -func (c *FakeFeatures) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FeatureList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(featuresResource, featuresKind, opts), &v1alpha1.FeatureList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.FeatureList{ListMeta: obj.(*v1alpha1.FeatureList).ListMeta} - for _, item := range obj.(*v1alpha1.FeatureList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested features. -func (c *FakeFeatures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(featuresResource, opts)) -} - -// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *FakeFeatures) Create(ctx context.Context, feature *v1alpha1.Feature, opts v1.CreateOptions) (result *v1alpha1.Feature, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(featuresResource, feature), &v1alpha1.Feature{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Feature), err -} - -// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *FakeFeatures) Update(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (result *v1alpha1.Feature, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(featuresResource, feature), &v1alpha1.Feature{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Feature), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFeatures) UpdateStatus(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (*v1alpha1.Feature, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(featuresResource, "status", feature), &v1alpha1.Feature{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.Feature), err -} - -// Delete takes name of the feature and deletes it. Returns an error if one occurs. -func (c *FakeFeatures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(featuresResource, name, opts), &v1alpha1.Feature{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFeatures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(featuresResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.FeatureList{}) - return err -} - -// Patch applies the patch and returns the patched feature. -func (c *FakeFeatures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Feature, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(featuresResource, name, pt, data, subresources...), &v1alpha1.Feature{}) - if obj == nil { - return nil, err +func newFakeFeatures(fake *FakeUiV1alpha1) uiv1alpha1.FeatureInterface { + return &fakeFeatures{ + gentype.NewFakeClientWithList[*v1alpha1.Feature, *v1alpha1.FeatureList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("features"), + v1alpha1.SchemeGroupVersion.WithKind("Feature"), + func() *v1alpha1.Feature { return &v1alpha1.Feature{} }, + func() *v1alpha1.FeatureList { return &v1alpha1.FeatureList{} }, + func(dst, src *v1alpha1.FeatureList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.FeatureList) []*v1alpha1.Feature { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.FeatureList, items []*v1alpha1.Feature) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.Feature), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_featureset.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_featureset.go index afefa43b14..1595bf56c0 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_featureset.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_featureset.go @@ -19,114 +19,33 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeFeatureSets implements FeatureSetInterface -type FakeFeatureSets struct { +// fakeFeatureSets implements FeatureSetInterface +type fakeFeatureSets struct { + *gentype.FakeClientWithList[*v1alpha1.FeatureSet, *v1alpha1.FeatureSetList] Fake *FakeUiV1alpha1 } -var featuresetsResource = v1alpha1.SchemeGroupVersion.WithResource("featuresets") - -var featuresetsKind = v1alpha1.SchemeGroupVersion.WithKind("FeatureSet") - -// Get takes name of the featureSet, and returns the corresponding featureSet object, and an error if there is any. -func (c *FakeFeatureSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FeatureSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(featuresetsResource, name), &v1alpha1.FeatureSet{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.FeatureSet), err -} - -// List takes label and field selectors, and returns the list of FeatureSets that match those selectors. -func (c *FakeFeatureSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FeatureSetList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(featuresetsResource, featuresetsKind, opts), &v1alpha1.FeatureSetList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.FeatureSetList{ListMeta: obj.(*v1alpha1.FeatureSetList).ListMeta} - for _, item := range obj.(*v1alpha1.FeatureSetList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested featureSets. -func (c *FakeFeatureSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(featuresetsResource, opts)) -} - -// Create takes the representation of a featureSet and creates it. Returns the server's representation of the featureSet, and an error, if there is any. -func (c *FakeFeatureSets) Create(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.CreateOptions) (result *v1alpha1.FeatureSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(featuresetsResource, featureSet), &v1alpha1.FeatureSet{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.FeatureSet), err -} - -// Update takes the representation of a featureSet and updates it. Returns the server's representation of the featureSet, and an error, if there is any. -func (c *FakeFeatureSets) Update(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (result *v1alpha1.FeatureSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(featuresetsResource, featureSet), &v1alpha1.FeatureSet{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.FeatureSet), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeFeatureSets) UpdateStatus(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (*v1alpha1.FeatureSet, error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceAction(featuresetsResource, "status", featureSet), &v1alpha1.FeatureSet{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.FeatureSet), err -} - -// Delete takes name of the featureSet and deletes it. Returns an error if one occurs. -func (c *FakeFeatureSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(featuresetsResource, name, opts), &v1alpha1.FeatureSet{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeFeatureSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(featuresetsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.FeatureSetList{}) - return err -} - -// Patch applies the patch and returns the patched featureSet. -func (c *FakeFeatureSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FeatureSet, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(featuresetsResource, name, pt, data, subresources...), &v1alpha1.FeatureSet{}) - if obj == nil { - return nil, err +func newFakeFeatureSets(fake *FakeUiV1alpha1) uiv1alpha1.FeatureSetInterface { + return &fakeFeatureSets{ + gentype.NewFakeClientWithList[*v1alpha1.FeatureSet, *v1alpha1.FeatureSetList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("featuresets"), + v1alpha1.SchemeGroupVersion.WithKind("FeatureSet"), + func() *v1alpha1.FeatureSet { return &v1alpha1.FeatureSet{} }, + func() *v1alpha1.FeatureSetList { return &v1alpha1.FeatureSetList{} }, + func(dst, src *v1alpha1.FeatureSetList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.FeatureSetList) []*v1alpha1.FeatureSet { return gentype.ToPointerSlice(list.Items) }, + func(list *v1alpha1.FeatureSetList, items []*v1alpha1.FeatureSet) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.FeatureSet), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourcedashboard.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourcedashboard.go index 9b07812677..bc700792f9 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourcedashboard.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourcedashboard.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceDashboards implements ResourceDashboardInterface -type FakeResourceDashboards struct { +// fakeResourceDashboards implements ResourceDashboardInterface +type fakeResourceDashboards struct { + *gentype.FakeClientWithList[*v1alpha1.ResourceDashboard, *v1alpha1.ResourceDashboardList] Fake *FakeUiV1alpha1 } -var resourcedashboardsResource = v1alpha1.SchemeGroupVersion.WithResource("resourcedashboards") - -var resourcedashboardsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceDashboard") - -// Get takes name of the resourceDashboard, and returns the corresponding resourceDashboard object, and an error if there is any. -func (c *FakeResourceDashboards) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceDashboard, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourcedashboardsResource, name), &v1alpha1.ResourceDashboard{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceDashboard), err -} - -// List takes label and field selectors, and returns the list of ResourceDashboards that match those selectors. -func (c *FakeResourceDashboards) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceDashboardList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourcedashboardsResource, resourcedashboardsKind, opts), &v1alpha1.ResourceDashboardList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ResourceDashboardList{ListMeta: obj.(*v1alpha1.ResourceDashboardList).ListMeta} - for _, item := range obj.(*v1alpha1.ResourceDashboardList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceDashboards. -func (c *FakeResourceDashboards) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resourcedashboardsResource, opts)) -} - -// Create takes the representation of a resourceDashboard and creates it. Returns the server's representation of the resourceDashboard, and an error, if there is any. -func (c *FakeResourceDashboards) Create(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.CreateOptions) (result *v1alpha1.ResourceDashboard, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourcedashboardsResource, resourceDashboard), &v1alpha1.ResourceDashboard{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceDashboard), err -} - -// Update takes the representation of a resourceDashboard and updates it. Returns the server's representation of the resourceDashboard, and an error, if there is any. -func (c *FakeResourceDashboards) Update(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.UpdateOptions) (result *v1alpha1.ResourceDashboard, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourcedashboardsResource, resourceDashboard), &v1alpha1.ResourceDashboard{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceDashboard), err -} - -// Delete takes name of the resourceDashboard and deletes it. Returns an error if one occurs. -func (c *FakeResourceDashboards) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourcedashboardsResource, name, opts), &v1alpha1.ResourceDashboard{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceDashboards) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resourcedashboardsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ResourceDashboardList{}) - return err -} - -// Patch applies the patch and returns the patched resourceDashboard. -func (c *FakeResourceDashboards) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceDashboard, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourcedashboardsResource, name, pt, data, subresources...), &v1alpha1.ResourceDashboard{}) - if obj == nil { - return nil, err +func newFakeResourceDashboards(fake *FakeUiV1alpha1) uiv1alpha1.ResourceDashboardInterface { + return &fakeResourceDashboards{ + gentype.NewFakeClientWithList[*v1alpha1.ResourceDashboard, *v1alpha1.ResourceDashboardList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourcedashboards"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceDashboard"), + func() *v1alpha1.ResourceDashboard { return &v1alpha1.ResourceDashboard{} }, + func() *v1alpha1.ResourceDashboardList { return &v1alpha1.ResourceDashboardList{} }, + func(dst, src *v1alpha1.ResourceDashboardList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ResourceDashboardList) []*v1alpha1.ResourceDashboard { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ResourceDashboardList, items []*v1alpha1.ResourceDashboard) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ResourceDashboard), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceeditor.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceeditor.go index da68161caa..2694a2a78f 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceeditor.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceeditor.go @@ -19,103 +19,35 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceEditors implements ResourceEditorInterface -type FakeResourceEditors struct { +// fakeResourceEditors implements ResourceEditorInterface +type fakeResourceEditors struct { + *gentype.FakeClientWithList[*v1alpha1.ResourceEditor, *v1alpha1.ResourceEditorList] Fake *FakeUiV1alpha1 } -var resourceeditorsResource = v1alpha1.SchemeGroupVersion.WithResource("resourceeditors") - -var resourceeditorsKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceEditor") - -// Get takes name of the resourceEditor, and returns the corresponding resourceEditor object, and an error if there is any. -func (c *FakeResourceEditors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceeditorsResource, name), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// List takes label and field selectors, and returns the list of ResourceEditors that match those selectors. -func (c *FakeResourceEditors) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceEditorList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(resourceeditorsResource, resourceeditorsKind, opts), &v1alpha1.ResourceEditorList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ResourceEditorList{ListMeta: obj.(*v1alpha1.ResourceEditorList).ListMeta} - for _, item := range obj.(*v1alpha1.ResourceEditorList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested resourceEditors. -func (c *FakeResourceEditors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(resourceeditorsResource, opts)) -} - -// Create takes the representation of a resourceEditor and creates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *FakeResourceEditors) Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(resourceeditorsResource, resourceEditor), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// Update takes the representation of a resourceEditor and updates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *FakeResourceEditors) Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(resourceeditorsResource, resourceEditor), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ResourceEditor), err -} - -// Delete takes name of the resourceEditor and deletes it. Returns an error if one occurs. -func (c *FakeResourceEditors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(resourceeditorsResource, name, opts), &v1alpha1.ResourceEditor{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeResourceEditors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(resourceeditorsResource, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.ResourceEditorList{}) - return err -} - -// Patch applies the patch and returns the patched resourceEditor. -func (c *FakeResourceEditors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceEditor, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(resourceeditorsResource, name, pt, data, subresources...), &v1alpha1.ResourceEditor{}) - if obj == nil { - return nil, err +func newFakeResourceEditors(fake *FakeUiV1alpha1) uiv1alpha1.ResourceEditorInterface { + return &fakeResourceEditors{ + gentype.NewFakeClientWithList[*v1alpha1.ResourceEditor, *v1alpha1.ResourceEditorList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceeditors"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceEditor"), + func() *v1alpha1.ResourceEditor { return &v1alpha1.ResourceEditor{} }, + func() *v1alpha1.ResourceEditorList { return &v1alpha1.ResourceEditorList{} }, + func(dst, src *v1alpha1.ResourceEditorList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.ResourceEditorList) []*v1alpha1.ResourceEditor { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.ResourceEditorList, items []*v1alpha1.ResourceEditor) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.ResourceEditor), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceoutlinefilter.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceoutlinefilter.go index efbd2350f9..6807d20e19 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceoutlinefilter.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_resourceoutlinefilter.go @@ -19,28 +19,27 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - testing "k8s.io/client-go/testing" v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + + gentype "k8s.io/client-go/gentype" ) -// FakeResourceOutlineFilters implements ResourceOutlineFilterInterface -type FakeResourceOutlineFilters struct { +// fakeResourceOutlineFilters implements ResourceOutlineFilterInterface +type fakeResourceOutlineFilters struct { + *gentype.FakeClient[*v1alpha1.ResourceOutlineFilter] Fake *FakeUiV1alpha1 } -var resourceoutlinefiltersResource = v1alpha1.SchemeGroupVersion.WithResource("resourceoutlinefilters") - -var resourceoutlinefiltersKind = v1alpha1.SchemeGroupVersion.WithKind("ResourceOutlineFilter") - -// Get takes name of the resourceOutlineFilter, and returns the corresponding resourceOutlineFilter object, and an error if there is any. -func (c *FakeResourceOutlineFilters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutlineFilter, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(resourceoutlinefiltersResource, name), &v1alpha1.ResourceOutlineFilter{}) - if obj == nil { - return nil, err +func newFakeResourceOutlineFilters(fake *FakeUiV1alpha1) uiv1alpha1.ResourceOutlineFilterInterface { + return &fakeResourceOutlineFilters{ + gentype.NewFakeClient[*v1alpha1.ResourceOutlineFilter]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("resourceoutlinefilters"), + v1alpha1.SchemeGroupVersion.WithKind("ResourceOutlineFilter"), + func() *v1alpha1.ResourceOutlineFilter { return &v1alpha1.ResourceOutlineFilter{} }, + ), + fake, } - return obj.(*v1alpha1.ResourceOutlineFilter), err } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_ui_client.go b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_ui_client.go index 44a621e514..12d9f6bb96 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_ui_client.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/fake/fake_ui_client.go @@ -19,9 +19,10 @@ limitations under the License. package fake import ( + v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" + rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1alpha1 "kmodules.xyz/resource-metadata/client/clientset/versioned/typed/ui/v1alpha1" ) type FakeUiV1alpha1 struct { @@ -29,27 +30,27 @@ type FakeUiV1alpha1 struct { } func (c *FakeUiV1alpha1) ClusterProfiles() v1alpha1.ClusterProfileInterface { - return &FakeClusterProfiles{c} + return newFakeClusterProfiles(c) } func (c *FakeUiV1alpha1) Features() v1alpha1.FeatureInterface { - return &FakeFeatures{c} + return newFakeFeatures(c) } func (c *FakeUiV1alpha1) FeatureSets() v1alpha1.FeatureSetInterface { - return &FakeFeatureSets{c} + return newFakeFeatureSets(c) } func (c *FakeUiV1alpha1) ResourceDashboards() v1alpha1.ResourceDashboardInterface { - return &FakeResourceDashboards{c} + return newFakeResourceDashboards(c) } func (c *FakeUiV1alpha1) ResourceEditors() v1alpha1.ResourceEditorInterface { - return &FakeResourceEditors{c} + return newFakeResourceEditors(c) } func (c *FakeUiV1alpha1) ResourceOutlineFilters() v1alpha1.ResourceOutlineFilterInterface { - return &FakeResourceOutlineFilters{c} + return newFakeResourceOutlineFilters(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/client/clientset/versioned/typed/ui/v1alpha1/feature.go b/client/clientset/versioned/typed/ui/v1alpha1/feature.go index 897714c992..a56961f678 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/feature.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/feature.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // FeaturesGetter has a method to return a FeatureInterface. @@ -38,147 +38,34 @@ type FeaturesGetter interface { // FeatureInterface has methods to work with Feature resources. type FeatureInterface interface { - Create(ctx context.Context, feature *v1alpha1.Feature, opts v1.CreateOptions) (*v1alpha1.Feature, error) - Update(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (*v1alpha1.Feature, error) - UpdateStatus(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (*v1alpha1.Feature, error) + Create(ctx context.Context, feature *uiv1alpha1.Feature, opts v1.CreateOptions) (*uiv1alpha1.Feature, error) + Update(ctx context.Context, feature *uiv1alpha1.Feature, opts v1.UpdateOptions) (*uiv1alpha1.Feature, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, feature *uiv1alpha1.Feature, opts v1.UpdateOptions) (*uiv1alpha1.Feature, 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) (*v1alpha1.Feature, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FeatureList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.Feature, error) + List(ctx context.Context, opts v1.ListOptions) (*uiv1alpha1.FeatureList, 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 *v1alpha1.Feature, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *uiv1alpha1.Feature, err error) FeatureExpansion } // features implements FeatureInterface type features struct { - client rest.Interface + *gentype.ClientWithList[*uiv1alpha1.Feature, *uiv1alpha1.FeatureList] } // newFeatures returns a Features func newFeatures(c *UiV1alpha1Client) *features { return &features{ - client: c.RESTClient(), - } -} - -// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. -func (c *features) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Feature, err error) { - result = &v1alpha1.Feature{} - err = c.client.Get(). - Resource("features"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of Features that match those selectors. -func (c *features) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FeatureList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.FeatureList{} - err = c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested features. -func (c *features) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Create(ctx context.Context, feature *v1alpha1.Feature, opts v1.CreateOptions) (result *v1alpha1.Feature, err error) { - result = &v1alpha1.Feature{} - err = c.client.Post(). - Resource("features"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. -func (c *features) Update(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (result *v1alpha1.Feature, err error) { - result = &v1alpha1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *features) UpdateStatus(ctx context.Context, feature *v1alpha1.Feature, opts v1.UpdateOptions) (result *v1alpha1.Feature, err error) { - result = &v1alpha1.Feature{} - err = c.client.Put(). - Resource("features"). - Name(feature.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(feature). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the feature and deletes it. Returns an error if one occurs. -func (c *features) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("features"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *features) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*uiv1alpha1.Feature, *uiv1alpha1.FeatureList]( + "features", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.Feature { return &uiv1alpha1.Feature{} }, + func() *uiv1alpha1.FeatureList { return &uiv1alpha1.FeatureList{} }, + ), } - return c.client.Delete(). - Resource("features"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched feature. -func (c *features) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Feature, err error) { - result = &v1alpha1.Feature{} - err = c.client.Patch(pt). - Resource("features"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/featureset.go b/client/clientset/versioned/typed/ui/v1alpha1/featureset.go index 7e29a039a9..9b54fb1fe4 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/featureset.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/featureset.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // FeatureSetsGetter has a method to return a FeatureSetInterface. @@ -38,147 +38,34 @@ type FeatureSetsGetter interface { // FeatureSetInterface has methods to work with FeatureSet resources. type FeatureSetInterface interface { - Create(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.CreateOptions) (*v1alpha1.FeatureSet, error) - Update(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (*v1alpha1.FeatureSet, error) - UpdateStatus(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (*v1alpha1.FeatureSet, error) + Create(ctx context.Context, featureSet *uiv1alpha1.FeatureSet, opts v1.CreateOptions) (*uiv1alpha1.FeatureSet, error) + Update(ctx context.Context, featureSet *uiv1alpha1.FeatureSet, opts v1.UpdateOptions) (*uiv1alpha1.FeatureSet, error) + // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). + UpdateStatus(ctx context.Context, featureSet *uiv1alpha1.FeatureSet, opts v1.UpdateOptions) (*uiv1alpha1.FeatureSet, 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) (*v1alpha1.FeatureSet, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FeatureSetList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.FeatureSet, error) + List(ctx context.Context, opts v1.ListOptions) (*uiv1alpha1.FeatureSetList, 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 *v1alpha1.FeatureSet, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *uiv1alpha1.FeatureSet, err error) FeatureSetExpansion } // featureSets implements FeatureSetInterface type featureSets struct { - client rest.Interface + *gentype.ClientWithList[*uiv1alpha1.FeatureSet, *uiv1alpha1.FeatureSetList] } // newFeatureSets returns a FeatureSets func newFeatureSets(c *UiV1alpha1Client) *featureSets { return &featureSets{ - client: c.RESTClient(), - } -} - -// Get takes name of the featureSet, and returns the corresponding featureSet object, and an error if there is any. -func (c *featureSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FeatureSet, err error) { - result = &v1alpha1.FeatureSet{} - err = c.client.Get(). - Resource("featuresets"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of FeatureSets that match those selectors. -func (c *featureSets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FeatureSetList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.FeatureSetList{} - err = c.client.Get(). - Resource("featuresets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested featureSets. -func (c *featureSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - opts.Watch = true - return c.client.Get(). - Resource("featuresets"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a featureSet and creates it. Returns the server's representation of the featureSet, and an error, if there is any. -func (c *featureSets) Create(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.CreateOptions) (result *v1alpha1.FeatureSet, err error) { - result = &v1alpha1.FeatureSet{} - err = c.client.Post(). - Resource("featuresets"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(featureSet). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a featureSet and updates it. Returns the server's representation of the featureSet, and an error, if there is any. -func (c *featureSets) Update(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (result *v1alpha1.FeatureSet, err error) { - result = &v1alpha1.FeatureSet{} - err = c.client.Put(). - Resource("featuresets"). - Name(featureSet.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(featureSet). - Do(ctx). - Into(result) - return -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *featureSets) UpdateStatus(ctx context.Context, featureSet *v1alpha1.FeatureSet, opts v1.UpdateOptions) (result *v1alpha1.FeatureSet, err error) { - result = &v1alpha1.FeatureSet{} - err = c.client.Put(). - Resource("featuresets"). - Name(featureSet.Name). - SubResource("status"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(featureSet). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the featureSet and deletes it. Returns an error if one occurs. -func (c *featureSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("featuresets"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *featureSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*uiv1alpha1.FeatureSet, *uiv1alpha1.FeatureSetList]( + "featuresets", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.FeatureSet { return &uiv1alpha1.FeatureSet{} }, + func() *uiv1alpha1.FeatureSetList { return &uiv1alpha1.FeatureSetList{} }, + ), } - return c.client.Delete(). - Resource("featuresets"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched featureSet. -func (c *featureSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FeatureSet, err error) { - result = &v1alpha1.FeatureSet{} - err = c.client.Patch(pt). - Resource("featuresets"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/resourcedashboard.go b/client/clientset/versioned/typed/ui/v1alpha1/resourcedashboard.go index a316f869f6..a2d5546721 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/resourcedashboard.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/resourcedashboard.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ResourceDashboardsGetter has a method to return a ResourceDashboardInterface. @@ -38,131 +38,32 @@ type ResourceDashboardsGetter interface { // ResourceDashboardInterface has methods to work with ResourceDashboard resources. type ResourceDashboardInterface interface { - Create(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.CreateOptions) (*v1alpha1.ResourceDashboard, error) - Update(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.UpdateOptions) (*v1alpha1.ResourceDashboard, error) + Create(ctx context.Context, resourceDashboard *uiv1alpha1.ResourceDashboard, opts v1.CreateOptions) (*uiv1alpha1.ResourceDashboard, error) + Update(ctx context.Context, resourceDashboard *uiv1alpha1.ResourceDashboard, opts v1.UpdateOptions) (*uiv1alpha1.ResourceDashboard, 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) (*v1alpha1.ResourceDashboard, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResourceDashboardList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.ResourceDashboard, error) + List(ctx context.Context, opts v1.ListOptions) (*uiv1alpha1.ResourceDashboardList, 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 *v1alpha1.ResourceDashboard, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *uiv1alpha1.ResourceDashboard, err error) ResourceDashboardExpansion } // resourceDashboards implements ResourceDashboardInterface type resourceDashboards struct { - client rest.Interface + *gentype.ClientWithList[*uiv1alpha1.ResourceDashboard, *uiv1alpha1.ResourceDashboardList] } // newResourceDashboards returns a ResourceDashboards func newResourceDashboards(c *UiV1alpha1Client) *resourceDashboards { return &resourceDashboards{ - client: c.RESTClient(), - } -} - -// Get takes name of the resourceDashboard, and returns the corresponding resourceDashboard object, and an error if there is any. -func (c *resourceDashboards) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceDashboard, err error) { - result = &v1alpha1.ResourceDashboard{} - err = c.client.Get(). - Resource("resourcedashboards"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceDashboards that match those selectors. -func (c *resourceDashboards) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceDashboardList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ResourceDashboardList{} - err = c.client.Get(). - Resource("resourcedashboards"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceDashboards. -func (c *resourceDashboards) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*uiv1alpha1.ResourceDashboard, *uiv1alpha1.ResourceDashboardList]( + "resourcedashboards", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.ResourceDashboard { return &uiv1alpha1.ResourceDashboard{} }, + func() *uiv1alpha1.ResourceDashboardList { return &uiv1alpha1.ResourceDashboardList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("resourcedashboards"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceDashboard and creates it. Returns the server's representation of the resourceDashboard, and an error, if there is any. -func (c *resourceDashboards) Create(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.CreateOptions) (result *v1alpha1.ResourceDashboard, err error) { - result = &v1alpha1.ResourceDashboard{} - err = c.client.Post(). - Resource("resourcedashboards"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceDashboard). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceDashboard and updates it. Returns the server's representation of the resourceDashboard, and an error, if there is any. -func (c *resourceDashboards) Update(ctx context.Context, resourceDashboard *v1alpha1.ResourceDashboard, opts v1.UpdateOptions) (result *v1alpha1.ResourceDashboard, err error) { - result = &v1alpha1.ResourceDashboard{} - err = c.client.Put(). - Resource("resourcedashboards"). - Name(resourceDashboard.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceDashboard). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceDashboard and deletes it. Returns an error if one occurs. -func (c *resourceDashboards) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("resourcedashboards"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceDashboards) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("resourcedashboards"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceDashboard. -func (c *resourceDashboards) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceDashboard, err error) { - result = &v1alpha1.ResourceDashboard{} - err = c.client.Patch(pt). - Resource("resourcedashboards"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/resourceeditor.go b/client/clientset/versioned/typed/ui/v1alpha1/resourceeditor.go index 965112457f..7766ff9cd3 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/resourceeditor.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/resourceeditor.go @@ -19,15 +19,15 @@ limitations under the License. package v1alpha1 import ( - "context" - "time" + context "context" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + gentype "k8s.io/client-go/gentype" ) // ResourceEditorsGetter has a method to return a ResourceEditorInterface. @@ -38,131 +38,32 @@ type ResourceEditorsGetter interface { // ResourceEditorInterface has methods to work with ResourceEditor resources. type ResourceEditorInterface interface { - Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (*v1alpha1.ResourceEditor, error) - Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (*v1alpha1.ResourceEditor, error) + Create(ctx context.Context, resourceEditor *uiv1alpha1.ResourceEditor, opts v1.CreateOptions) (*uiv1alpha1.ResourceEditor, error) + Update(ctx context.Context, resourceEditor *uiv1alpha1.ResourceEditor, opts v1.UpdateOptions) (*uiv1alpha1.ResourceEditor, 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) (*v1alpha1.ResourceEditor, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ResourceEditorList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.ResourceEditor, error) + List(ctx context.Context, opts v1.ListOptions) (*uiv1alpha1.ResourceEditorList, 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 *v1alpha1.ResourceEditor, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *uiv1alpha1.ResourceEditor, err error) ResourceEditorExpansion } // resourceEditors implements ResourceEditorInterface type resourceEditors struct { - client rest.Interface + *gentype.ClientWithList[*uiv1alpha1.ResourceEditor, *uiv1alpha1.ResourceEditorList] } // newResourceEditors returns a ResourceEditors func newResourceEditors(c *UiV1alpha1Client) *resourceEditors { return &resourceEditors{ - client: c.RESTClient(), - } -} - -// Get takes name of the resourceEditor, and returns the corresponding resourceEditor object, and an error if there is any. -func (c *resourceEditors) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Get(). - Resource("resourceeditors"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ResourceEditors that match those selectors. -func (c *resourceEditors) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ResourceEditorList, err error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second - } - result = &v1alpha1.ResourceEditorList{} - err = c.client.Get(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Do(ctx). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested resourceEditors. -func (c *resourceEditors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - var timeout time.Duration - if opts.TimeoutSeconds != nil { - timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + gentype.NewClientWithList[*uiv1alpha1.ResourceEditor, *uiv1alpha1.ResourceEditorList]( + "resourceeditors", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.ResourceEditor { return &uiv1alpha1.ResourceEditor{} }, + func() *uiv1alpha1.ResourceEditorList { return &uiv1alpha1.ResourceEditorList{} }, + ), } - opts.Watch = true - return c.client.Get(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Timeout(timeout). - Watch(ctx) -} - -// Create takes the representation of a resourceEditor and creates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *resourceEditors) Create(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.CreateOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Post(). - Resource("resourceeditors"). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceEditor). - Do(ctx). - Into(result) - return -} - -// Update takes the representation of a resourceEditor and updates it. Returns the server's representation of the resourceEditor, and an error, if there is any. -func (c *resourceEditors) Update(ctx context.Context, resourceEditor *v1alpha1.ResourceEditor, opts v1.UpdateOptions) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Put(). - Resource("resourceeditors"). - Name(resourceEditor.Name). - VersionedParams(&opts, scheme.ParameterCodec). - Body(resourceEditor). - Do(ctx). - Into(result) - return -} - -// Delete takes name of the resourceEditor and deletes it. Returns an error if one occurs. -func (c *resourceEditors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - return c.client.Delete(). - Resource("resourceeditors"). - Name(name). - Body(&opts). - Do(ctx). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *resourceEditors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - var timeout time.Duration - if listOpts.TimeoutSeconds != nil { - timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second - } - return c.client.Delete(). - Resource("resourceeditors"). - VersionedParams(&listOpts, scheme.ParameterCodec). - Timeout(timeout). - Body(&opts). - Do(ctx). - Error() -} - -// Patch applies the patch and returns the patched resourceEditor. -func (c *resourceEditors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ResourceEditor, err error) { - result = &v1alpha1.ResourceEditor{} - err = c.client.Patch(pt). - Resource("resourceeditors"). - Name(name). - SubResource(subresources...). - VersionedParams(&opts, scheme.ParameterCodec). - Body(data). - Do(ctx). - Into(result) - return } diff --git a/client/clientset/versioned/typed/ui/v1alpha1/resourceoutlinefilter.go b/client/clientset/versioned/typed/ui/v1alpha1/resourceoutlinefilter.go index e1185378a1..b01bfa53d8 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/resourceoutlinefilter.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/resourceoutlinefilter.go @@ -19,12 +19,13 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + gentype "k8s.io/client-go/gentype" ) // ResourceOutlineFiltersGetter has a method to return a ResourceOutlineFilterInterface. @@ -35,30 +36,24 @@ type ResourceOutlineFiltersGetter interface { // ResourceOutlineFilterInterface has methods to work with ResourceOutlineFilter resources. type ResourceOutlineFilterInterface interface { - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ResourceOutlineFilter, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*uiv1alpha1.ResourceOutlineFilter, error) ResourceOutlineFilterExpansion } // resourceOutlineFilters implements ResourceOutlineFilterInterface type resourceOutlineFilters struct { - client rest.Interface + *gentype.Client[*uiv1alpha1.ResourceOutlineFilter] } // newResourceOutlineFilters returns a ResourceOutlineFilters func newResourceOutlineFilters(c *UiV1alpha1Client) *resourceOutlineFilters { return &resourceOutlineFilters{ - client: c.RESTClient(), + gentype.NewClient[*uiv1alpha1.ResourceOutlineFilter]( + "resourceoutlinefilters", + c.RESTClient(), + scheme.ParameterCodec, + "", + func() *uiv1alpha1.ResourceOutlineFilter { return &uiv1alpha1.ResourceOutlineFilter{} }, + ), } } - -// Get takes name of the resourceOutlineFilter, and returns the corresponding resourceOutlineFilter object, and an error if there is any. -func (c *resourceOutlineFilters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ResourceOutlineFilter, err error) { - result = &v1alpha1.ResourceOutlineFilter{} - err = c.client.Get(). - Resource("resourceoutlinefilters"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(ctx). - Into(result) - return -} diff --git a/client/clientset/versioned/typed/ui/v1alpha1/ui_client.go b/client/clientset/versioned/typed/ui/v1alpha1/ui_client.go index 1f856d417b..42710ca184 100644 --- a/client/clientset/versioned/typed/ui/v1alpha1/ui_client.go +++ b/client/clientset/versioned/typed/ui/v1alpha1/ui_client.go @@ -19,11 +19,12 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" + + uiv1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" + scheme "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" - v1alpha1 "kmodules.xyz/resource-metadata/apis/ui/v1alpha1" - "kmodules.xyz/resource-metadata/client/clientset/versioned/scheme" ) type UiV1alpha1Interface interface { @@ -70,9 +71,7 @@ func (c *UiV1alpha1Client) ResourceOutlineFilters() ResourceOutlineFilterInterfa // where httpClient was generated with rest.HTTPClientFor(c). func NewForConfig(c *rest.Config) (*UiV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) httpClient, err := rest.HTTPClientFor(&config) if err != nil { return nil, err @@ -84,9 +83,7 @@ func NewForConfig(c *rest.Config) (*UiV1alpha1Client, error) { // Note the http client provided takes precedence over the configured transport values. func NewForConfigAndClient(c *rest.Config, h *http.Client) (*UiV1alpha1Client, error) { config := *c - if err := setConfigDefaults(&config); err != nil { - return nil, err - } + setConfigDefaults(&config) client, err := rest.RESTClientForConfigAndClient(&config, h) if err != nil { return nil, err @@ -109,17 +106,15 @@ func New(c rest.Interface) *UiV1alpha1Client { return &UiV1alpha1Client{c} } -func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion +func setConfigDefaults(config *rest.Config) { + gv := uiv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() } - - return nil } // RESTClient returns a RESTClient that is used to communicate diff --git a/crds/core.k8s.appscode.com_genericresources.yaml b/crds/core.k8s.appscode.com_genericresources.yaml index d0add687ef..d5e3be1330 100644 --- a/crds/core.k8s.appscode.com_genericresources.yaml +++ b/crds/core.k8s.appscode.com_genericresources.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: genericresources.core.k8s.appscode.com spec: group: core.k8s.appscode.com diff --git a/crds/core.k8s.appscode.com_genericresourceservices.yaml b/crds/core.k8s.appscode.com_genericresourceservices.yaml index df21f7503e..38adc59c39 100644 --- a/crds/core.k8s.appscode.com_genericresourceservices.yaml +++ b/crds/core.k8s.appscode.com_genericresourceservices.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: genericresourceservices.core.k8s.appscode.com spec: group: core.k8s.appscode.com diff --git a/crds/core.k8s.appscode.com_podviews.yaml b/crds/core.k8s.appscode.com_podviews.yaml index 294d4f84f2..26bdf2c2d4 100644 --- a/crds/core.k8s.appscode.com_podviews.yaml +++ b/crds/core.k8s.appscode.com_podviews.yaml @@ -1,7 +1,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: podviews.core.k8s.appscode.com spec: group: core.k8s.appscode.com diff --git a/crds/core.k8s.appscode.com_projects.yaml b/crds/core.k8s.appscode.com_projects.yaml index 2a4fd5cb7b..c3874197b8 100644 --- a/crds/core.k8s.appscode.com_projects.yaml +++ b/crds/core.k8s.appscode.com_projects.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: projects.core.k8s.appscode.com spec: group: core.k8s.appscode.com diff --git a/crds/core.k8s.appscode.com_resourcesummaries.yaml b/crds/core.k8s.appscode.com_resourcesummaries.yaml index 9246ea71f4..0fca07968d 100644 --- a/crds/core.k8s.appscode.com_resourcesummaries.yaml +++ b/crds/core.k8s.appscode.com_resourcesummaries.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcesummaries.core.k8s.appscode.com spec: group: core.k8s.appscode.com diff --git a/crds/identity.k8s.appscode.com_clusteridentitys.yaml b/crds/identity.k8s.appscode.com_clusteridentitys.yaml index 6d40bd273f..a8f6cf1542 100644 --- a/crds/identity.k8s.appscode.com_clusteridentitys.yaml +++ b/crds/identity.k8s.appscode.com_clusteridentitys.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: clusteridentitys.identity.k8s.appscode.com spec: group: identity.k8s.appscode.com diff --git a/crds/identity.k8s.appscode.com_selfsubjectnamespaceaccessreviews.yaml b/crds/identity.k8s.appscode.com_selfsubjectnamespaceaccessreviews.yaml index 49cc570d44..043f0d3d3d 100644 --- a/crds/identity.k8s.appscode.com_selfsubjectnamespaceaccessreviews.yaml +++ b/crds/identity.k8s.appscode.com_selfsubjectnamespaceaccessreviews.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: selfsubjectnamespaceaccessreviews.identity.k8s.appscode.com spec: group: identity.k8s.appscode.com diff --git a/crds/identity.k8s.appscode.com_siteinfos.yaml b/crds/identity.k8s.appscode.com_siteinfos.yaml index 54a920d3b4..541161f230 100644 --- a/crds/identity.k8s.appscode.com_siteinfos.yaml +++ b/crds/identity.k8s.appscode.com_siteinfos.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: siteinfos.identity.k8s.appscode.com spec: group: identity.k8s.appscode.com diff --git a/crds/management.k8s.appscode.com_projectquotas.yaml b/crds/management.k8s.appscode.com_projectquotas.yaml index 1e5b77f3e6..3d9e820d4a 100644 --- a/crds/management.k8s.appscode.com_projectquotas.yaml +++ b/crds/management.k8s.appscode.com_projectquotas.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: projectquotas.management.k8s.appscode.com spec: group: management.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_clusterprofiles.yaml b/crds/meta.k8s.appscode.com_clusterprofiles.yaml index 2ebc1acd26..08b61ef695 100644 --- a/crds/meta.k8s.appscode.com_clusterprofiles.yaml +++ b/crds/meta.k8s.appscode.com_clusterprofiles.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: clusterprofiles.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_gatewayinfoes.yaml b/crds/meta.k8s.appscode.com_gatewayinfoes.yaml index 53ce236f40..4e048f7c4b 100644 --- a/crds/meta.k8s.appscode.com_gatewayinfoes.yaml +++ b/crds/meta.k8s.appscode.com_gatewayinfoes.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: gatewayinfoes.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_menuoutlines.yaml b/crds/meta.k8s.appscode.com_menuoutlines.yaml index 14567955cd..10811c8772 100644 --- a/crds/meta.k8s.appscode.com_menuoutlines.yaml +++ b/crds/meta.k8s.appscode.com_menuoutlines.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: menuoutlines.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_menus.yaml b/crds/meta.k8s.appscode.com_menus.yaml index 81621da2b7..75c3af75ce 100644 --- a/crds/meta.k8s.appscode.com_menus.yaml +++ b/crds/meta.k8s.appscode.com_menus.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: menus.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourceblockdefinitions.yaml b/crds/meta.k8s.appscode.com_resourceblockdefinitions.yaml index 287d695ffb..c37bb66376 100644 --- a/crds/meta.k8s.appscode.com_resourceblockdefinitions.yaml +++ b/crds/meta.k8s.appscode.com_resourceblockdefinitions.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceblockdefinitions.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourcecalculators.yaml b/crds/meta.k8s.appscode.com_resourcecalculators.yaml index b33f5e720f..3f66b78b48 100644 --- a/crds/meta.k8s.appscode.com_resourcecalculators.yaml +++ b/crds/meta.k8s.appscode.com_resourcecalculators.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcecalculators.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourcedescriptors.yaml b/crds/meta.k8s.appscode.com_resourcedescriptors.yaml index bad892608f..e016d5c356 100644 --- a/crds/meta.k8s.appscode.com_resourcedescriptors.yaml +++ b/crds/meta.k8s.appscode.com_resourcedescriptors.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcedescriptors.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourceeditors.yaml b/crds/meta.k8s.appscode.com_resourceeditors.yaml index 89d78723c9..2de052c32b 100644 --- a/crds/meta.k8s.appscode.com_resourceeditors.yaml +++ b/crds/meta.k8s.appscode.com_resourceeditors.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceeditors.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourcelayouts.yaml b/crds/meta.k8s.appscode.com_resourcelayouts.yaml index 93e48e331a..4e52974c6e 100644 --- a/crds/meta.k8s.appscode.com_resourcelayouts.yaml +++ b/crds/meta.k8s.appscode.com_resourcelayouts.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcelayouts.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourceoutlinefilters.yaml b/crds/meta.k8s.appscode.com_resourceoutlinefilters.yaml index 8dfc625c56..1d778f4370 100644 --- a/crds/meta.k8s.appscode.com_resourceoutlinefilters.yaml +++ b/crds/meta.k8s.appscode.com_resourceoutlinefilters.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceoutlinefilters.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourceoutlines.yaml b/crds/meta.k8s.appscode.com_resourceoutlines.yaml index a64c233f8d..511003b6b2 100644 --- a/crds/meta.k8s.appscode.com_resourceoutlines.yaml +++ b/crds/meta.k8s.appscode.com_resourceoutlines.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceoutlines.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/meta.k8s.appscode.com_resourcetabledefinitions.yaml b/crds/meta.k8s.appscode.com_resourcetabledefinitions.yaml index 10c22e4755..0c0aff3267 100644 --- a/crds/meta.k8s.appscode.com_resourcetabledefinitions.yaml +++ b/crds/meta.k8s.appscode.com_resourcetabledefinitions.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcetabledefinitions.meta.k8s.appscode.com spec: group: meta.k8s.appscode.com diff --git a/crds/node.k8s.appscode.com_nodetopologies.yaml b/crds/node.k8s.appscode.com_nodetopologies.yaml index b29177ad7f..82a4aa01bd 100644 --- a/crds/node.k8s.appscode.com_nodetopologies.yaml +++ b/crds/node.k8s.appscode.com_nodetopologies.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: nodetopologies.node.k8s.appscode.com spec: group: node.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_clusterprofiles.yaml b/crds/ui.k8s.appscode.com_clusterprofiles.yaml index 4e25e4ca92..dbb6c855f5 100644 --- a/crds/ui.k8s.appscode.com_clusterprofiles.yaml +++ b/crds/ui.k8s.appscode.com_clusterprofiles.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: clusterprofiles.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_features.yaml b/crds/ui.k8s.appscode.com_features.yaml index 1b502ecea2..5a047e337e 100644 --- a/crds/ui.k8s.appscode.com_features.yaml +++ b/crds/ui.k8s.appscode.com_features.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: features.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_featuresets.yaml b/crds/ui.k8s.appscode.com_featuresets.yaml index 9b845c1278..315cd0914b 100644 --- a/crds/ui.k8s.appscode.com_featuresets.yaml +++ b/crds/ui.k8s.appscode.com_featuresets.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: featuresets.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_resourcedashboards.yaml b/crds/ui.k8s.appscode.com_resourcedashboards.yaml index 4bb43b21c9..5ec015982e 100644 --- a/crds/ui.k8s.appscode.com_resourcedashboards.yaml +++ b/crds/ui.k8s.appscode.com_resourcedashboards.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourcedashboards.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_resourceeditors.yaml b/crds/ui.k8s.appscode.com_resourceeditors.yaml index da3db749d0..10c102e7d9 100644 --- a/crds/ui.k8s.appscode.com_resourceeditors.yaml +++ b/crds/ui.k8s.appscode.com_resourceeditors.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceeditors.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/crds/ui.k8s.appscode.com_resourceoutlinefilters.yaml b/crds/ui.k8s.appscode.com_resourceoutlinefilters.yaml index 1c95d4bdfe..a10373b0e2 100644 --- a/crds/ui.k8s.appscode.com_resourceoutlinefilters.yaml +++ b/crds/ui.k8s.appscode.com_resourceoutlinefilters.yaml @@ -3,7 +3,6 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - creationTimestamp: null name: resourceoutlinefilters.ui.k8s.appscode.com spec: group: ui.k8s.appscode.com diff --git a/go.mod b/go.mod index 81b6970bbf..a82c4d0e8b 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/yudai/gojsondiff v1.0.0 go.bytebuilders.dev/license-verifier v0.15.0 - golang.org/x/net v0.55.0 + golang.org/x/net v0.57.0 gomodules.xyz/encoding v0.0.8 gomodules.xyz/jsonpath v0.0.2 gomodules.xyz/x v0.0.18 @@ -27,7 +27,7 @@ require ( k8s.io/klog/v2 v2.130.1 k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b kmodules.xyz/apiversion v0.2.0 - kmodules.xyz/client-go v0.34.3 + kmodules.xyz/client-go v0.34.6 kmodules.xyz/crd-schema-fuzz v0.34.1 kmodules.xyz/go-containerregistry v0.0.15 kmodules.xyz/offshoot-api v0.34.0 @@ -111,18 +111,18 @@ require ( github.com/zeebo/xxh3 v1.0.2 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.52.0 // indirect - golang.org/x/oauth2 v0.33.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/crypto v0.55.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/term v0.45.0 // indirect + golang.org/x/text v0.41.0 // indirect golang.org/x/time v0.11.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect gomodules.xyz/mergo v0.3.13 // indirect gomodules.xyz/pointer v0.1.0 // indirect gomodules.xyz/sets v0.2.1 // indirect - google.golang.org/protobuf v1.36.6 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index e75a1e2e27..02f7ec28c2 100644 --- a/go.sum +++ b/go.sum @@ -235,8 +235,8 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= -golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= +golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= +golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -244,27 +244,27 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= -golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo= -golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= +golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -272,8 +272,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= +golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -294,8 +294,8 @@ gomodules.xyz/testing v0.0.4 h1:XGKt4B64mBe7P9kPR0Rz1nCQpWoSpBEFdTGkfU1RLe4= gomodules.xyz/testing v0.0.4/go.mod h1:hD6aXtv9eVycPwS01zv+QTl5BrK2DXQgr6bHqnrW+44= gomodules.xyz/x v0.0.18 h1:Hm4YKg32VYJmFOKpV4mLIPXEpkDFVIso3AhJC/ME9oc= gomodules.xyz/x v0.0.18/go.mod h1:lhsalLjQeL2ce489fu7xEVcR5nowKgltuvnXLGgUAdc= -google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= -google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -335,8 +335,8 @@ k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzk k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk= kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80= -kmodules.xyz/client-go v0.34.3 h1:2K2Tjwwy62QOpgIpuRB0STDAt2e7omkKt06oC8YV+/U= -kmodules.xyz/client-go v0.34.3/go.mod h1:myCt7AfRao4PBdUtKXu01xxbqqmLZ5U8fW0LQDaifhQ= +kmodules.xyz/client-go v0.34.6 h1:elrJcayyvg3LV/XdApjKKPIUu/cjyJbC0kjnJWr50bc= +kmodules.xyz/client-go v0.34.6/go.mod h1:B955bkfn4K+yxJ9hDQxybGDIiVRzalTZGYsLdtxVQ5w= kmodules.xyz/crd-schema-fuzz v0.34.1 h1:YfrFv9LcrVW54BhFSekFAyEuWxp09wic1j8xm3c41T0= kmodules.xyz/crd-schema-fuzz v0.34.1/go.mod h1:uer6PA1mrDk4SI6C+kZ2vNZFPZhHvgahuf+YRVKQiHo= kmodules.xyz/go-containerregistry v0.0.15 h1:PRY5FDOzb6u23KOulQ4SWNdeUkBKmezLyJXP88q4EPw= diff --git a/vendor/golang.org/x/net/http2/server_wrap.go b/vendor/golang.org/x/net/http2/server_wrap.go index a7a09551c4..737f1f0573 100644 --- a/vendor/golang.org/x/net/http2/server_wrap.go +++ b/vendor/golang.org/x/net/http2/server_wrap.go @@ -10,9 +10,11 @@ package http2 import ( "context" + "crypto/tls" "errors" "net" "net/http" + "slices" "sync" "time" ) @@ -44,6 +46,20 @@ func configureServer(s *http.Server, conf *Server) error { h2.IdleTimeout = h1.ReadTimeout } } + + // Register h2 and http/1.1 ALPN protocols on s.TLSConfig, matching + // the pre-wrapping implementation in server.go, so that TLS listeners + // built from s.TLSConfig still negotiate HTTP/2. + if s.TLSConfig == nil { + s.TLSConfig = new(tls.Config) + } + if !slices.Contains(s.TLSConfig.NextProtos, NextProtoTLS) { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, NextProtoTLS) + } + if !slices.Contains(s.TLSConfig.NextProtos, "http/1.1") { + s.TLSConfig.NextProtos = append(s.TLSConfig.NextProtos, "http/1.1") + } + conf.state = &serverInternalState{ s1: s, } diff --git a/vendor/golang.org/x/net/http2/transport_wrap.go b/vendor/golang.org/x/net/http2/transport_wrap.go index d25d99bdbb..534e77ab96 100644 --- a/vendor/golang.org/x/net/http2/transport_wrap.go +++ b/vendor/golang.org/x/net/http2/transport_wrap.go @@ -22,8 +22,8 @@ import ( ) func configureTransport(t1 *http.Transport) error { - // ConfigureTransport is a no-op: The http.Transport already supports HTTP/2. - return nil + _, err := configureTransports(t1) + return err } func configureTransports(t1 *http.Transport) (*Transport, error) { @@ -31,6 +31,17 @@ func configureTransports(t1 *http.Transport) (*Transport, error) { // linked to the http.Transport's. tr2 := &Transport{} tr2.configure(t1) + // Enable HTTP/2 on the transport, as the pre-wrapping implementation did: + // net/http does not auto-enable it for a transport with a custom + // TLSClientConfig or dialer. + if t1.TLSClientConfig == nil { + t1.TLSClientConfig = &tls.Config{} + } + if t1.Protocols == nil { + t1.Protocols = new(http.Protocols) + t1.Protocols.SetHTTP1(true) + } + t1.Protocols.SetHTTP2(true) return tr2, nil } @@ -44,7 +55,7 @@ type transportConfig struct { // Registered is called by net/http.Transport.RegisterProtocol, // to let us know that it understands the registration mechanism we're using. func (t transportConfig) Registered(t1 *http.Transport) { - t.t.t1 = t1 + t.t.lazyt1 = t1 } func (t transportConfig) DisableCompression() bool { @@ -134,29 +145,30 @@ func (t transportConfig) DialFromContext(ctx context.Context, network, address s type transportInternal struct { initOnce sync.Once - t1 *http.Transport + lazyt1 *http.Transport } -func (t *Transport) init() { +func (t *Transport) init() *http.Transport { t.initOnce.Do(func() { - if t.t1 != nil { + if t.lazyt1 != nil { return } t1 := &http.Transport{} t.configure(t1) }) + return t.lazyt1 } func (t *Transport) configure(t1 *http.Transport) { t1.RegisterProtocol("http/2", transportConfig{t}) - // tr2.t1 is set by transportConfig.Registered. - if t.t1 != t1 { + // tr2.lazyt1 is set by transportConfig.Registered. + if t.lazyt1 != t1 { panic("http2: net/http does not support this version of x/net/http2") } } func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Response, error) { - t.init() + t1 := t.init() if req.URL.Scheme == "http" && !t.AllowHTTP { return nil, errors.New("http2: unencrypted HTTP/2 not enabled") @@ -177,22 +189,23 @@ func (t *Transport) roundTripOpt(req *http.Request, opt RoundTripOpt) (*http.Res ctx := context.WithValue(req.Context(), http2TransportContextKey{}, t) req = req.WithContext(ctx) - return t.t1.RoundTrip(req) + return t1.RoundTrip(req) } func (t *Transport) closeIdleConnections() { - t.init() - t.t1.CloseIdleConnections() + t1 := t.init() + t1.CloseIdleConnections() } func (t *Transport) newUserClientConn(c net.Conn) (*ClientConn, error) { + t1 := t.init() // http.Transport's NewClientConn doesn't provide a supported way to create // a connection from a net.Conn. (This might be useful to add in the future?) // We're going to craftily sneak one in via the context key, with the // scheme of "http/2" telling NewClientConn to look for it. ctx := context.WithValue(context.Background(), netConnContextKey{}, c) - nhcc, err := t.t1.NewClientConn(ctx, "http/2", "") + nhcc, err := t1.NewClientConn(ctx, "http/2", "") if err != nil { return nil, err } diff --git a/vendor/golang.org/x/net/idna/idna.go b/vendor/golang.org/x/net/idna/idna.go index 22767125bf..e2f28fed48 100644 --- a/vendor/golang.org/x/net/idna/idna.go +++ b/vendor/golang.org/x/net/idna/idna.go @@ -400,7 +400,11 @@ func (p *Profile) process(s string, toASCII bool) (string, error) { // Spec says keep the old label. continue } - if unicode16 && err == nil && len(u) > 0 && isASCII(u) { + if err == nil && len(u) > 0 && isASCII(u) { + // UTS 43 pre-revision 33 doesn't classify a xn-- label + // which contains only ASCII characters as an error, + // but that's a specification bug and a security issue. + // Always return an error in this case. err = punyError(enc) } isBidi = isBidi || bidirule.DirectionString(u) != bidi.LeftToRight diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index f69fd75468..c261a8ebbd 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -109,7 +109,7 @@ func (g *Group) TryGo(f func() error) bool { if g.sem != nil { select { case g.sem <- token{}: - // Note: this allows barging iff channels in general allow barging. + // Note: this allows barging if and only if channels in general allow barging. default: return false } diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index ce4d7ab1ed..21e2bfa398 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1874,6 +1874,7 @@ func Dup2(oldfd, newfd int) error { //sys Dup3(oldfd int, newfd int, flags int) (err error) //sysnb EpollCreate1(flag int) (fd int, err error) //sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) +//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2 //sys Exit(code int) = SYS_EXIT_GROUP //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index 506dafa7b4..210d545c93 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -20,7 +20,6 @@ func setTimeval(sec, usec int64) Timeval { // 64-bit file system and 32-bit uid calls // (386 default is 32-bit file system and 16-bit uid). -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64 //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index d557cf8de3..a9a52f2319 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index ecf92bfa2a..54474c20fe 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -44,7 +44,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { // 64-bit file system and 32-bit uid calls // (16-bit uid calls are not always supported in newer kernels) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 173738077b..e9f30db97d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -8,7 +8,6 @@ package unix import "unsafe" -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index a3fd1d0b80..6f09ca200a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -8,7 +8,6 @@ package unix import "unsafe" -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index 70963a95ab..ca3b56597d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstatfs(fd int, buf *Statfs_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index c218ebd280..54ba667b1b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -13,7 +13,6 @@ import ( func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go index e6c48500ca..ce46285902 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go @@ -11,7 +11,6 @@ import ( "unsafe" ) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index 7286a9aa88..33f7af3804 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index fc5543c5ff..c658871e30 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -8,7 +8,6 @@ package unix import "unsafe" -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 66f31210d0..2c8587691b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -10,7 +10,6 @@ import ( "unsafe" ) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index 11d1f16986..4964119af8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 9d72a6b73a..5bb51d7ae1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1359,6 +1359,7 @@ const ( FAN_UNLIMITED_MARKS = 0x20 FAN_UNLIMITED_QUEUE = 0x10 FD_CLOEXEC = 0x1 + FD_PIDFS_ROOT = -0x2712 FD_SETSIZE = 0x400 FF0 = 0x0 FIB_RULE_DEV_DETACHED = 0x8 @@ -1970,6 +1971,8 @@ const ( MADV_DONTNEED = 0x4 MADV_DONTNEED_LOCKED = 0x18 MADV_FREE = 0x8 + MADV_GUARD_INSTALL = 0x66 + MADV_GUARD_REMOVE = 0x67 MADV_HUGEPAGE = 0xe MADV_HWPOISON = 0x64 MADV_KEEPONFORK = 0x13 @@ -2114,7 +2117,7 @@ const ( MS_NOSEC = 0x10000000 MS_NOSUID = 0x2 MS_NOSYMFOLLOW = 0x100 - MS_NOUSER = -0x80000000 + MS_NOUSER = 0x80000000 MS_POSIXACL = 0x10000 MS_PRIVATE = 0x40000 MS_RDONLY = 0x1 @@ -3786,6 +3789,9 @@ const ( TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 + TCP_AO_KEYF_EXCLUDE_OPT = 0x2 + TCP_AO_KEYF_IFINDEX = 0x1 + TCP_AO_MAXKEYLEN = 0x50 TCP_CC_INFO = 0x1a TCP_CM_INQ = 0x24 TCP_CONGESTION = 0xd diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 80f40e4013..5788c2a58d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -700,6 +700,23 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 4def3e9fcb..254f33988f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index fef2bc8ba9..27c05db1ac 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index a9fd76a884..840d85bfc3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -213,23 +213,6 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 4600650280..fe414498b4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go index c8987d2646..eb358ce05a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 921f430611..c437622f14 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 44f067829c..bc4ca25582 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index e7fa0abf0d..5051435ce7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 8c5125675e..33aa5418a4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go index 7392fd45e4..3bef8ef1d2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 41180434e6..fc1bd4e2c4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 40c6ce7ae5..d78fe7dabe 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index 2cfe34adb1..76dcf87d01 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 61e6f07097..2cf020f2ba 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 834b842042..527637623d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index d11d5b96a4..526a0d5f43 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -6397,3 +6397,79 @@ const ( MPOL_PREFERRED_MANY = 0x5 MPOL_WEIGHTED_INTERLEAVE = 0x6 ) + +const ( + GPIO_V2_GET_LINEINFO_IOCTL = 0xc100b405 + GPIO_V2_GET_LINE_IOCTL = 0xc250b407 + GPIO_V2_LINE_GET_VALUES_IOCTL = 0xc010b40e + GPIO_V2_LINE_SET_VALUES_IOCTL = 0xc010b40f + GPIO_V2_GET_LINEINFO_WATCH_IOCTL = 0xc100b406 + GPIO_GET_LINEINFO_UNWATCH_IOCTL = 0xc004b40c +) +const ( + GPIO_V2_LINE_ATTR_ID_FLAGS = 0x1 + GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES = 0x2 + GPIO_V2_LINE_ATTR_ID_DEBOUNCE = 0x3 + GPIO_V2_LINE_CHANGED_REQUESTED = 0x1 + GPIO_V2_LINE_CHANGED_RELEASED = 0x2 + GPIO_V2_LINE_CHANGED_CONFIG = 0x3 + GPIO_V2_LINE_EVENT_RISING_EDGE = 0x1 + GPIO_V2_LINE_EVENT_FALLING_EDGE = 0x2 +) + +type GPIOChipInfo struct { + Name [32]byte + Label [32]byte + Lines uint32 +} +type GPIOV2LineValues struct { + Bits uint64 + Mask uint64 +} +type GPIOV2LineAttribute struct { + Id uint32 + _ uint32 + Flags uint64 +} +type GPIOV2LineConfigAttribute struct { + Attr GPIOV2LineAttribute + Mask uint64 +} +type GPIOV2LineConfig struct { + Flags uint64 + Num_attrs uint32 + _ [5]uint32 + Attrs [10]GPIOV2LineConfigAttribute +} +type GPIOV2LineRequest struct { + Offsets [64]uint32 + Consumer [32]byte + Config GPIOV2LineConfig + Num_lines uint32 + Event_buffer_size uint32 + _ [5]uint32 + Fd int32 +} +type GPIOV2LineInfo struct { + Name [32]byte + Consumer [32]byte + Offset uint32 + Num_attrs uint32 + Flags uint64 + Attrs [10]GPIOV2LineAttribute + _ [4]uint32 +} +type GPIOV2LineInfoChanged struct { + Info GPIOV2LineInfo + Timestamp_ns uint64 + Event_type uint32 + _ [5]uint32 +} +type GPIOV2LineEvent struct { + Timestamp_ns uint64 + Id uint32 + Offset uint32 + Seqno uint32 + Line_seqno uint32 + _ [6]uint32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 97ef790deb..aede1de7f2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -711,3 +711,7 @@ type SysvShmDesc struct { _ uint32 _ uint32 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 90b50da680..bb3bc4dc2c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -725,3 +725,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index acda136851..1fdf4c5175 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -705,3 +705,7 @@ type SysvShmDesc struct { _ uint32 _ uint32 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index ef7a99e1f9..063e6f0b41 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -704,3 +704,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 966063dfc1..9cf836c708 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -705,3 +705,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index dc53b20b74..1d222fcb31 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -710,3 +710,7 @@ type SysvShmDesc struct { Ctime_high uint16 _ uint16 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 9ad0aa8c31..912cc4ab63 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -707,3 +707,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 29d55493d5..1e358ef34f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -707,3 +707,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index a4d9e15848..df59f32f5e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -710,3 +710,7 @@ type SysvShmDesc struct { Ctime_high uint16 _ uint16 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index f8a2977716..29355aa0bf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -718,3 +718,7 @@ type SysvShmDesc struct { _ uint32 _ [4]byte } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 4158d6c4ee..c6083a15d7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -713,3 +713,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 1035af49f7..6321cc7626 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -713,3 +713,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 2297125d3c..b44f402feb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -792,3 +792,7 @@ const ( RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6 RISCV_HWPROBE_WHICH_CPUS = 0x1 ) + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 8481e9bd98..b22c795a64 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -727,3 +727,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index a6828a0310..0b18075b53 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -708,3 +708,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 6c955cea15..783621561e 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1109,17 +1109,53 @@ const ( ) // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. +// +// Go pointers stored in a TrusteeValue must be pinned using [runtime.Pinner] +// for the lifetime of the TrusteeValue. type TrusteeValue uintptr +// TrusteeValueFromString is unsafe and should not be used. +// +// It returns a uintptr containing a reference to newly-allocated memory +// which will be freed by the garbage collector. +// There is no way for the caller to safely reference this memory. +// +// To create a [TrusteeValue] from a string, use: +// +// p, err := windows.UTF16PtrFromString(s) +// if err != nil { +// // handle error +// } +// +// // Pin the string for as long as it is used. +// var pinner runtime.Pinner +// pinner.Pin(p) +// defer pinner.Unpin() +// +// tv := TrusteeValue(unsafe.Pointer(p)) +// +// Deprecated: TrusteeValueFromString is unsafe and should not be used. func TrusteeValueFromString(str string) TrusteeValue { return TrusteeValue(unsafe.Pointer(StringToUTF16Ptr(str))) } + +// TrusteeValueFromSID returns a [TrusteeValue] referencing sid. +// +// The caller must pin sid using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromSID(sid *SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(sid)) } + +// TrusteeValueFromObjectsAndSid returns a [TrusteeValue] referencing objectsAndSid. +// +// The caller must pin objectsAndSid using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromObjectsAndSid(objectsAndSid *OBJECTS_AND_SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndSid)) } + +// TrusteeValueFromObjectsAndName returns a [TrusteeValue] referencing objectsAndName. +// +// The caller must pin objectsAndName using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromObjectsAndName(objectsAndName *OBJECTS_AND_NAME) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndName)) } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 9755bca9fd..e6966b4c32 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -1728,11 +1728,15 @@ func (s *NTUnicodeString) String() string { // the more common *uint16 string type. func NewNTString(s string) (*NTString, error) { var nts NTString - s8, err := BytePtrFromString(s) + s8, err := ByteSliceFromString(s) if err != nil { return nil, err } - RtlInitString(&nts, s8) + // The source string plus its terminating NUL must fit within MAX_USHORT. + if len(s8) > MAX_USHORT { + return nil, syscall.EINVAL + } + RtlInitString(&nts, &s8[0]) return &nts, nil } diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index d2574a73ee..75a50b3165 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -169,6 +169,7 @@ const ( FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 + MAX_USHORT = 0xffff MAX_PATH = 260 MAX_LONG_PATH = 32768 diff --git a/vendor/golang.org/x/text/cases/context.go b/vendor/golang.org/x/text/cases/context.go index e9aa9e1936..a28f45d7bf 100644 --- a/vendor/golang.org/x/text/cases/context.go +++ b/vendor/golang.org/x/text/cases/context.go @@ -249,7 +249,7 @@ func upper(c *context) bool { return c.copy() } -// isUpper writes the isUppercase version of the current rune to dst. +// isUpper reports whether the current rune is in upper case. func isUpper(c *context) bool { ct := c.caseType() if c.info&hasMappingMask == 0 || ct == cUpper { diff --git a/vendor/golang.org/x/text/cases/map.go b/vendor/golang.org/x/text/cases/map.go index 0f7c6a14bb..51a683092f 100644 --- a/vendor/golang.org/x/text/cases/map.go +++ b/vendor/golang.org/x/text/cases/map.go @@ -774,7 +774,7 @@ func nlTitle(c *context) bool { // From CLDR: // # Special titlecasing for Dutch initial "ij". // ::Any-Title(); - // # Fix up Ij at the beginning of a "word" (per Any-Title, notUAX #29) + // # Fix up Ij at the beginning of a "word" (per Any-Title, not UAX #29) // [:^WB=ALetter:] [:WB=Extend:]* [[:WB=MidLetter:][:WB=MidNumLet:]]? { Ij } → IJ ; if c.src[c.pSrc] != 'I' && c.src[c.pSrc] != 'i' { return title(c) @@ -794,7 +794,7 @@ func nlTitleSpan(c *context) bool { // From CLDR: // # Special titlecasing for Dutch initial "ij". // ::Any-Title(); - // # Fix up Ij at the beginning of a "word" (per Any-Title, notUAX #29) + // # Fix up Ij at the beginning of a "word" (per Any-Title, not UAX #29) // [:^WB=ALetter:] [:WB=Extend:]* [[:WB=MidLetter:][:WB=MidNumLet:]]? { Ij } → IJ ; if c.src[c.pSrc] != 'I' { return isTitle(c) diff --git a/vendor/golang.org/x/text/unicode/norm/forminfo.go b/vendor/golang.org/x/text/unicode/norm/forminfo.go index f3a234e5f5..b3cf5d9bde 100644 --- a/vendor/golang.org/x/text/unicode/norm/forminfo.go +++ b/vendor/golang.org/x/text/unicode/norm/forminfo.go @@ -121,8 +121,12 @@ func (p Properties) BoundaryAfter() bool { // // When all 6 bits are zero, the character is inert, meaning it is never // influenced by normalization. +// +// We set flags to 0x80 (high bit 7 unused in quick check data) to indicate an invalid rune. type qcInfo uint8 +func (p Properties) isInvalid() bool { return p.flags == 0x80 } + func (p Properties) isYesC() bool { return p.flags&0x10 == 0 } func (p Properties) isYesD() bool { return p.flags&0x4 == 0 } @@ -247,6 +251,9 @@ func (f Form) PropertiesString(s string) Properties { // to a Properties. See the comment at the top of the file // for more information on the format. func compInfo(v uint16, sz int) Properties { + if sz == 0 { + return Properties{flags: 0x80, size: 1} + } if v == 0 { return Properties{size: uint8(sz)} } else if v >= 0x8000 { @@ -254,7 +261,7 @@ func compInfo(v uint16, sz int) Properties { size: uint8(sz), ccc: uint8(v), tccc: uint8(v), - flags: qcInfo(v >> 8), + flags: qcInfo(v>>8) & 0x3f, } if p.ccc > 0 || p.combinesBackward() { p.nLead = uint8(p.flags & 0x3) diff --git a/vendor/golang.org/x/text/unicode/norm/iter.go b/vendor/golang.org/x/text/unicode/norm/iter.go index 417c6b2689..3cc059224d 100644 --- a/vendor/golang.org/x/text/unicode/norm/iter.go +++ b/vendor/golang.org/x/text/unicode/norm/iter.go @@ -376,16 +376,12 @@ func nextComposed(i *Iter) []byte { goto doNorm } prevCC = i.info.tccc - sz := int(i.info.size) - if sz == 0 { - sz = 1 // illegal rune: copy byte-by-byte - } - p := outp + sz + p := outp + int(i.info.size) if p > len(i.buf) { break } outp = p - i.p += sz + i.p += int(i.info.size) if i.p >= i.rb.nsrc { i.setDone() break diff --git a/vendor/golang.org/x/text/unicode/norm/normalize.go b/vendor/golang.org/x/text/unicode/norm/normalize.go index 4747ad07a8..60b1511caa 100644 --- a/vendor/golang.org/x/text/unicode/norm/normalize.go +++ b/vendor/golang.org/x/text/unicode/norm/normalize.go @@ -148,7 +148,7 @@ func (f Form) IsNormalString(s string) bool { // patched buffer and whether the decomposition is still in progress. func patchTail(rb *reorderBuffer) bool { info, p := lastRuneStart(&rb.f, rb.out) - if p == -1 || info.size == 0 { + if p == -1 || info.isInvalid() { return true } end := p + int(info.size) @@ -225,7 +225,7 @@ func doAppend(rb *reorderBuffer, out []byte, p int) []byte { } fd := &rb.f if doMerge { - var info Properties + info := Properties{flags: 0x80, size: 1} // invalid rune if p < n { info = fd.info(src, p) if !info.BoundaryBefore() || info.nLeadingNonStarters() > 0 { @@ -235,7 +235,7 @@ func doAppend(rb *reorderBuffer, out []byte, p int) []byte { p = decomposeSegment(rb, p, true) } } - if info.size == 0 { + if info.isInvalid() { rb.doFlush() // Append incomplete UTF-8 encoding. return src.appendSlice(rb.out, p, n) @@ -314,7 +314,7 @@ func (f *formInfo) quickSpan(src input, i, end int, atEOF bool) (n int, ok bool) continue } info := f.info(src, i) - if info.size == 0 { + if info.isInvalid() { if atEOF { // include incomplete runes return n, true @@ -379,7 +379,7 @@ func (f Form) firstBoundary(src input, nsrc int) int { // CGJ insertion points correctly. Luckily it doesn't have to. for { info := fd.info(src, i) - if info.size == 0 { + if info.isInvalid() { return -1 } if s := ss.next(info); s != ssSuccess { @@ -424,7 +424,7 @@ func (f Form) nextBoundary(src input, nsrc int, atEOF bool) int { } fd := formTable[f] info := fd.info(src, 0) - if info.size == 0 { + if info.isInvalid() { if atEOF { return 1 } @@ -435,7 +435,7 @@ func (f Form) nextBoundary(src input, nsrc int, atEOF bool) int { for i := int(info.size); i < nsrc; i += int(info.size) { info = fd.info(src, i) - if info.size == 0 { + if info.isInvalid() { if atEOF { return i } @@ -465,7 +465,7 @@ func lastBoundary(fd *formInfo, b []byte) int { if p == -1 { return -1 } - if info.size == 0 { // ends with incomplete rune + if info.isInvalid() { // ends with incomplete rune if p == 0 { // starts with incomplete rune return -1 } @@ -504,7 +504,7 @@ func lastBoundary(fd *formInfo, b []byte) int { func decomposeSegment(rb *reorderBuffer, sp int, atEOF bool) int { // Force one character to be consumed. info := rb.f.info(rb.src, sp) - if info.size == 0 { + if info.isInvalid() { return 0 } if s := rb.ss.next(info); s == ssStarter { @@ -528,7 +528,7 @@ func decomposeSegment(rb *reorderBuffer, sp int, atEOF bool) int { break } info = rb.f.info(rb.src, sp) - if info.size == 0 { + if info.isInvalid() { if !atEOF { return int(iShortSrc) } diff --git a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go index e942bc983e..743bfb81d6 100644 --- a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +++ b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go @@ -371,7 +371,31 @@ func ConsumeVarint(b []byte) (v uint64, n int) { func SizeVarint(v uint64) int { // This computes 1 + (bits.Len64(v)-1)/7. // 9/64 is a good enough approximation of 1/7 - return int(9*uint32(bits.Len64(v))+64) / 64 + // + // The Go compiler can translate the bits.LeadingZeros64 call into the LZCNT + // instruction, which is very fast on CPUs from the last few years. The + // specific way of expressing the calculation matches C++ Protobuf, see + // https://godbolt.org/z/4P3h53oM4 for the C++ code and how gcc/clang + // optimize that function for GOAMD64=v1 and GOAMD64=v3 (-march=haswell). + + // By OR'ing v with 1, we guarantee that v is never 0, without changing the + // result of SizeVarint. LZCNT is not defined for 0, meaning the compiler + // needs to add extra instructions to handle that case. + // + // The Go compiler currently (go1.24.4) does not make use of this knowledge. + // This opportunity (removing the XOR instruction, which handles the 0 case) + // results in a small (1%) performance win across CPU architectures. + // + // Independently of avoiding the 0 case, we need the v |= 1 line because + // it allows the Go compiler to eliminate an extra XCHGL barrier. + v |= 1 + + // It would be clearer to write log2value := 63 - uint32(...), but + // writing uint32(...) ^ 63 is much more efficient (-14% ARM, -20% Intel). + // Proof of identity for our value range [0..63]: + // https://go.dev/play/p/Pdn9hEWYakX + log2value := uint32(bits.LeadingZeros64(v)) ^ 63 + return int((log2value*9 + (64 + 9)) / 64) } // AppendFixed32 appends v to b as a little-endian uint32. diff --git a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb index 323829da14..04696351ee 100644 Binary files a/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb and b/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb differ diff --git a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go index 669133d04d..c96e448346 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go @@ -32,7 +32,7 @@ var byteType = reflect.TypeOf(byte(0)) func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescriptors) protoreflect.FieldDescriptor { f := new(filedesc.Field) f.L0.ParentFile = filedesc.SurrogateProto2 - f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + packed := false for len(tag) > 0 { i := strings.IndexByte(tag, ',') if i < 0 { @@ -108,7 +108,7 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri f.L1.StringName.InitJSON(jsonName) } case s == "packed": - f.L1.EditionFeatures.IsPacked = true + packed = true case strings.HasPrefix(s, "def="): // The default tag is special in that everything afterwards is the // default regardless of the presence of commas. @@ -121,6 +121,13 @@ func Unmarshal(tag string, goType reflect.Type, evs protoreflect.EnumValueDescri tag = strings.TrimPrefix(tag[i:], ",") } + // Update EditionFeatures after the loop and after we know whether this is + // a proto2 or proto3 field. + f.L1.EditionFeatures = f.L0.ParentFile.L1.EditionFeatures + if packed { + f.L1.EditionFeatures.IsPacked = true + } + // The generator uses the group message name instead of the field name. // We obtain the real field name by lowercasing the group name. if f.L1.Kind == protoreflect.GroupKind { diff --git a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go index 099b2bf451..9aa7a9bb77 100644 --- a/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +++ b/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go @@ -424,27 +424,34 @@ func (d *Decoder) parseFieldName() (tok Token, err error) { return Token{}, d.newSyntaxError("invalid field name: %s", errId(d.in)) } -// parseTypeName parses Any type URL or extension field name. The name is -// enclosed in [ and ] characters. The C++ parser does not handle many legal URL -// strings. This implementation is more liberal and allows for the pattern -// ^[-_a-zA-Z0-9]+([./][-_a-zA-Z0-9]+)*`). Whitespaces and comments are allowed -// in between [ ], '.', '/' and the sub names. +// parseTypeName parses an Any type URL or an extension field name. The name is +// enclosed in [ and ] characters. We allow almost arbitrary type URL prefixes, +// closely following the text-format spec [1,2]. We implement "ExtensionName | +// AnyName" as follows (with some exceptions for backwards compatibility): +// +// char = [-_a-zA-Z0-9] +// url_char = char | [.~!$&'()*+,;=] | "%", hex, hex +// +// Ident = char, { char } +// TypeName = Ident, { ".", Ident } ; +// UrlPrefix = url_char, { url_char | "/" } ; +// ExtensionName = "[", TypeName, "]" ; +// AnyName = "[", UrlPrefix, "/", TypeName, "]" ; +// +// Additionally, we allow arbitrary whitespace and comments between [ and ]. +// +// [1] https://protobuf.dev/reference/protobuf/textformat-spec/#characters +// [2] https://protobuf.dev/reference/protobuf/textformat-spec/#field-names func (d *Decoder) parseTypeName() (Token, error) { - startPos := len(d.orig) - len(d.in) // Use alias s to advance first in order to use d.in for error handling. - // Caller already checks for [ as first character. + // Caller already checks for [ as first character (d.in[0] == '['). s := consume(d.in[1:], 0) if len(s) == 0 { return Token{}, ErrUnexpectedEOF } + // Collect everything between [ and ] in name. var name []byte - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] - } - s = consume(s, 0) - var closed bool for len(s) > 0 && !closed { switch { @@ -452,23 +459,20 @@ func (d *Decoder) parseTypeName() (Token, error) { s = s[1:] closed = true - case s[0] == '/', s[0] == '.': - if len(name) > 0 && (name[len(name)-1] == '/' || name[len(name)-1] == '.') { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)+1]) - } + case s[0] == '/' || isTypeNameChar(s[0]) || isUrlExtraChar(s[0]): name = append(name, s[0]) - s = s[1:] - s = consume(s, 0) - for len(s) > 0 && isTypeNameChar(s[0]) { - name = append(name, s[0]) - s = s[1:] + s = consume(s[1:], 0) + + // URL percent-encoded chars + case s[0] == '%': + if len(s) < 3 || !isHexChar(s[1]) || !isHexChar(s[2]) { + return Token{}, d.parseTypeNameError(s, 3) } - s = consume(s, 0) + name = append(name, s[0], s[1], s[2]) + s = consume(s[3:], 0) default: - return Token{}, d.newSyntaxError( - "invalid type URL/extension field name: %s", d.orig[startPos:len(d.orig)-len(s)+1]) + return Token{}, d.parseTypeNameError(s, 1) } } @@ -476,15 +480,38 @@ func (d *Decoder) parseTypeName() (Token, error) { return Token{}, ErrUnexpectedEOF } - // First character cannot be '.'. Last character cannot be '.' or '/'. - size := len(name) - if size == 0 || name[0] == '.' || name[size-1] == '.' || name[size-1] == '/' { - return Token{}, d.newSyntaxError("invalid type URL/extension field name: %s", - d.orig[startPos:len(d.orig)-len(s)]) + // Split collected name on last '/' into urlPrefix and typeName (if '/' is + // present). + typeName := name + if i := bytes.LastIndexByte(name, '/'); i != -1 { + urlPrefix := name[:i] + typeName = name[i+1:] + + // urlPrefix may be empty (for backwards compatibility). + // If non-empty, it must not start with '/'. + if len(urlPrefix) > 0 && urlPrefix[0] == '/' { + return Token{}, d.parseTypeNameError(s, 0) + } } + // typeName must not be empty (note: "" splits to [""]) and all identifier + // parts must not be empty. + for _, ident := range bytes.Split(typeName, []byte{'.'}) { + if len(ident) == 0 { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + // typeName must not contain any percent-encoded or special URL chars. + for _, b := range typeName { + if b == '%' || (b != '.' && isUrlExtraChar(b)) { + return Token{}, d.parseTypeNameError(s, 0) + } + } + + startPos := len(d.orig) - len(d.in) + endPos := len(d.orig) - len(s) d.in = s - endPos := len(d.orig) - len(d.in) d.consume(0) return Token{ @@ -496,16 +523,32 @@ func (d *Decoder) parseTypeName() (Token, error) { }, nil } +func (d *Decoder) parseTypeNameError(s []byte, numUnconsumedChars int) error { + return d.newSyntaxError( + "invalid type URL/extension field name: %s", + d.in[:len(d.in)-len(s)+min(numUnconsumedChars, len(s))], + ) +} + +func isHexChar(b byte) bool { + return ('0' <= b && b <= '9') || + ('a' <= b && b <= 'f') || + ('A' <= b && b <= 'F') +} + func isTypeNameChar(b byte) bool { - return (b == '-' || b == '_' || + return b == '-' || b == '_' || ('0' <= b && b <= '9') || ('a' <= b && b <= 'z') || - ('A' <= b && b <= 'Z')) + ('A' <= b && b <= 'Z') } -func isWhiteSpace(b byte) bool { +// isUrlExtraChar complements isTypeNameChar with extra characters that we allow +// in URLs but not in type names. Note that '/' is not included so that it can +// be treated specially. +func isUrlExtraChar(b byte) bool { switch b { - case ' ', '\n', '\r', '\t': + case '.', '~', '!', '$', '&', '(', ')', '*', '+', ',', ';', '=': return true default: return false diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index 688aabe434..c775e5832f 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -32,6 +32,7 @@ const ( EditionProto3 Edition = 999 Edition2023 Edition = 1000 Edition2024 Edition = 1001 + EditionUnstable Edition = 9999 EditionUnsupported Edition = 100000 ) @@ -72,9 +73,10 @@ type ( EditionFeatures EditionFeatures } FileL2 struct { - Options func() protoreflect.ProtoMessage - Imports FileImports - Locations SourceLocations + Options func() protoreflect.ProtoMessage + Imports FileImports + OptionImports func() protoreflect.FileImports + Locations SourceLocations } // EditionFeatures is a frequently-instantiated struct, so please take care @@ -126,12 +128,9 @@ func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd } func (fd *File) Parent() protoreflect.Descriptor { return nil } func (fd *File) Index() int { return 0 } func (fd *File) Syntax() protoreflect.Syntax { return fd.L1.Syntax } - -// Not exported and just used to reconstruct the original FileDescriptor proto -func (fd *File) Edition() int32 { return int32(fd.L1.Edition) } -func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } -func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } -func (fd *File) IsPlaceholder() bool { return false } +func (fd *File) Name() protoreflect.Name { return fd.L1.Package.Name() } +func (fd *File) FullName() protoreflect.FullName { return fd.L1.Package } +func (fd *File) IsPlaceholder() bool { return false } func (fd *File) Options() protoreflect.ProtoMessage { if f := fd.lazyInit().Options; f != nil { return f() @@ -150,6 +149,16 @@ func (fd *File) Format(s fmt.State, r rune) { descfmt.FormatD func (fd *File) ProtoType(protoreflect.FileDescriptor) {} func (fd *File) ProtoInternal(pragma.DoNotImplement) {} +// The next two are not part of the FileDescriptor interface. They are just used to reconstruct +// the original FileDescriptor proto. +func (fd *File) Edition() int32 { return int32(fd.L1.Edition) } +func (fd *File) OptionImports() protoreflect.FileImports { + if f := fd.lazyInit().OptionImports; f != nil { + return f() + } + return emptyFiles +} + func (fd *File) lazyInit() *FileL2 { if atomic.LoadUint32(&fd.once) == 0 { fd.lazyInitOnce() @@ -182,9 +191,9 @@ type ( L2 *EnumL2 // protected by fileDesc.once } EnumL1 struct { - eagerValues bool // controls whether EnumL2.Values is already populated - EditionFeatures EditionFeatures + Visibility int32 + eagerValues bool // controls whether EnumL2.Values is already populated } EnumL2 struct { Options func() protoreflect.ProtoMessage @@ -219,6 +228,11 @@ func (ed *Enum) ReservedNames() protoreflect.Names { return &ed.lazyInit() func (ed *Enum) ReservedRanges() protoreflect.EnumRanges { return &ed.lazyInit().ReservedRanges } func (ed *Enum) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, ed) } func (ed *Enum) ProtoType(protoreflect.EnumDescriptor) {} + +// This is not part of the EnumDescriptor interface. It is just used to reconstruct +// the original FileDescriptor proto. +func (ed *Enum) Visibility() int32 { return ed.L1.Visibility } + func (ed *Enum) lazyInit() *EnumL2 { ed.L0.ParentFile.lazyInit() // implicitly initializes L2 return ed.L2 @@ -244,13 +258,13 @@ type ( L2 *MessageL2 // protected by fileDesc.once } MessageL1 struct { - Enums Enums - Messages Messages - Extensions Extensions - IsMapEntry bool // promoted from google.protobuf.MessageOptions - IsMessageSet bool // promoted from google.protobuf.MessageOptions - + Enums Enums + Messages Messages + Extensions Extensions EditionFeatures EditionFeatures + Visibility int32 + IsMapEntry bool // promoted from google.protobuf.MessageOptions + IsMessageSet bool // promoted from google.protobuf.MessageOptions } MessageL2 struct { Options func() protoreflect.ProtoMessage @@ -319,6 +333,11 @@ func (md *Message) Messages() protoreflect.MessageDescriptors { return &md.L func (md *Message) Extensions() protoreflect.ExtensionDescriptors { return &md.L1.Extensions } func (md *Message) ProtoType(protoreflect.MessageDescriptor) {} func (md *Message) Format(s fmt.State, r rune) { descfmt.FormatDesc(s, r, md) } + +// This is not part of the MessageDescriptor interface. It is just used to reconstruct +// the original FileDescriptor proto. +func (md *Message) Visibility() int32 { return md.L1.Visibility } + func (md *Message) lazyInit() *MessageL2 { md.L0.ParentFile.lazyInit() // implicitly initializes L2 return md.L2 diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go index d2f549497e..e91860f5a2 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go @@ -284,6 +284,13 @@ func (ed *Enum) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protorefl case genid.EnumDescriptorProto_Value_field_number: numValues++ } + case protowire.VarintType: + v, m := protowire.ConsumeVarint(b) + b = b[m:] + switch num { + case genid.EnumDescriptorProto_Visibility_field_number: + ed.L1.Visibility = int32(v) + } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] @@ -365,6 +372,13 @@ func (md *Message) unmarshalSeed(b []byte, sb *strs.Builder, pf *File, pd protor md.unmarshalSeedOptions(v) } prevField = num + case protowire.VarintType: + v, m := protowire.ConsumeVarint(b) + b = b[m:] + switch num { + case genid.DescriptorProto_Visibility_field_number: + md.L1.Visibility = int32(v) + } default: m := protowire.ConsumeFieldValue(num, typ, b) b = b[m:] diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go index d4c94458bd..78f02b1b49 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go @@ -134,6 +134,7 @@ func (fd *File) unmarshalFull(b []byte) { var enumIdx, messageIdx, extensionIdx, serviceIdx int var rawOptions []byte + var optionImports []string fd.L2 = new(FileL2) for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) @@ -157,6 +158,8 @@ func (fd *File) unmarshalFull(b []byte) { imp = PlaceholderFile(path) } fd.L2.Imports = append(fd.L2.Imports, protoreflect.FileImport{FileDescriptor: imp}) + case genid.FileDescriptorProto_OptionDependency_field_number: + optionImports = append(optionImports, sb.MakeString(v)) case genid.FileDescriptorProto_EnumType_field_number: fd.L1.Enums.List[enumIdx].unmarshalFull(v, sb) enumIdx++ @@ -178,6 +181,23 @@ func (fd *File) unmarshalFull(b []byte) { } } fd.L2.Options = fd.builder.optionsUnmarshaler(&descopts.File, rawOptions) + if len(optionImports) > 0 { + var imps FileImports + var once sync.Once + fd.L2.OptionImports = func() protoreflect.FileImports { + once.Do(func() { + imps = make(FileImports, len(optionImports)) + for i, path := range optionImports { + imp, _ := fd.builder.FileRegistry.FindFileByPath(path) + if imp == nil { + imp = PlaceholderFile(path) + } + imps[i] = protoreflect.FileImport{FileDescriptor: imp} + } + }) + return &imps + } + } } func (ed *Enum) unmarshalFull(b []byte, sb *strs.Builder) { @@ -310,7 +330,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L1.Extensions.List[extensionIdx].unmarshalFull(v, sb) extensionIdx++ case genid.DescriptorProto_Options_field_number: - md.unmarshalOptions(v) rawOptions = appendOptions(rawOptions, v) } default: @@ -336,27 +355,6 @@ func (md *Message) unmarshalFull(b []byte, sb *strs.Builder) { md.L2.Options = md.L0.ParentFile.builder.optionsUnmarshaler(&descopts.Message, rawOptions) } -func (md *Message) unmarshalOptions(b []byte) { - for len(b) > 0 { - num, typ, n := protowire.ConsumeTag(b) - b = b[n:] - switch typ { - case protowire.VarintType: - v, m := protowire.ConsumeVarint(b) - b = b[m:] - switch num { - case genid.MessageOptions_MapEntry_field_number: - md.L1.IsMapEntry = protowire.DecodeBool(v) - case genid.MessageOptions_MessageSetWireFormat_field_number: - md.L1.IsMessageSet = protowire.DecodeBool(v) - } - default: - m := protowire.ConsumeFieldValue(num, typ, b) - b = b[m:] - } - } -} - func unmarshalMessageReservedRange(b []byte) (r [2]protoreflect.FieldNumber) { for len(b) > 0 { num, typ, n := protowire.ConsumeTag(b) diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/editions.go b/vendor/google.golang.org/protobuf/internal/filedesc/editions.go index b08b71830c..66ba906806 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/editions.go @@ -13,8 +13,10 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" ) -var defaultsCache = make(map[Edition]EditionFeatures) -var defaultsKeys = []Edition{} +var ( + defaultsCache = make(map[Edition]EditionFeatures) + defaultsKeys = []Edition{} +) func init() { unmarshalEditionDefaults(editiondefaults.Defaults) @@ -41,7 +43,7 @@ func unmarshalGoFeature(b []byte, parent EditionFeatures) EditionFeatures { b = b[m:] parent.StripEnumPrefix = int(v) default: - panic(fmt.Sprintf("unkown field number %d while unmarshalling GoFeatures", num)) + panic(fmt.Sprintf("unknown field number %d while unmarshalling GoFeatures", num)) } } return parent @@ -72,8 +74,11 @@ func unmarshalFeatureSet(b []byte, parent EditionFeatures) EditionFeatures { case genid.FeatureSet_EnforceNamingStyle_field_number: // EnforceNamingStyle is enforced in protoc, languages other than C++ // are not supposed to do anything with this feature. + case genid.FeatureSet_DefaultSymbolVisibility_field_number: + // DefaultSymbolVisibility is enforced in protoc, runtimes should not + // inspect this value. default: - panic(fmt.Sprintf("unkown field number %d while unmarshalling FeatureSet", num)) + panic(fmt.Sprintf("unknown field number %d while unmarshalling FeatureSet", num)) } case protowire.BytesType: v, m := protowire.ConsumeBytes(b) @@ -147,7 +152,7 @@ func unmarshalEditionDefaults(b []byte) { _, m := protowire.ConsumeVarint(b) b = b[m:] default: - panic(fmt.Sprintf("unkown field number %d while unmarshalling EditionDefault", num)) + panic(fmt.Sprintf("unknown field number %d while unmarshalling EditionDefault", num)) } } } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/presence.go b/vendor/google.golang.org/protobuf/internal/filedesc/presence.go new file mode 100644 index 0000000000..a12ec9791c --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/filedesc/presence.go @@ -0,0 +1,33 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package filedesc + +import "google.golang.org/protobuf/reflect/protoreflect" + +// UsePresenceForField reports whether the presence bitmap should be used for +// the specified field. +func UsePresenceForField(fd protoreflect.FieldDescriptor) (usePresence, canBeLazy bool) { + switch { + case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): + // Oneof fields never use the presence bitmap. + // + // Synthetic oneofs are an exception: Those are used to implement proto3 + // optional fields and hence should follow non-oneof field semantics. + return false, false + + case fd.IsMap(): + // Map-typed fields never use the presence bitmap. + return false, false + + case fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind: + // Lazy fields always use the presence bitmap (only messages can be lazy). + isLazy := fd.(interface{ IsLazy() bool }).IsLazy() + return isLazy, isLazy + + default: + // If the field has presence, use the presence bitmap. + return fd.HasPresence(), false + } +} diff --git a/vendor/google.golang.org/protobuf/internal/genid/api_gen.go b/vendor/google.golang.org/protobuf/internal/genid/api_gen.go index df8f918501..3ceb6fa7f5 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/api_gen.go @@ -27,6 +27,7 @@ const ( Api_SourceContext_field_name protoreflect.Name = "source_context" Api_Mixins_field_name protoreflect.Name = "mixins" Api_Syntax_field_name protoreflect.Name = "syntax" + Api_Edition_field_name protoreflect.Name = "edition" Api_Name_field_fullname protoreflect.FullName = "google.protobuf.Api.name" Api_Methods_field_fullname protoreflect.FullName = "google.protobuf.Api.methods" @@ -35,6 +36,7 @@ const ( Api_SourceContext_field_fullname protoreflect.FullName = "google.protobuf.Api.source_context" Api_Mixins_field_fullname protoreflect.FullName = "google.protobuf.Api.mixins" Api_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Api.syntax" + Api_Edition_field_fullname protoreflect.FullName = "google.protobuf.Api.edition" ) // Field numbers for google.protobuf.Api. @@ -46,6 +48,7 @@ const ( Api_SourceContext_field_number protoreflect.FieldNumber = 5 Api_Mixins_field_number protoreflect.FieldNumber = 6 Api_Syntax_field_number protoreflect.FieldNumber = 7 + Api_Edition_field_number protoreflect.FieldNumber = 8 ) // Names for google.protobuf.Method. @@ -63,6 +66,7 @@ const ( Method_ResponseStreaming_field_name protoreflect.Name = "response_streaming" Method_Options_field_name protoreflect.Name = "options" Method_Syntax_field_name protoreflect.Name = "syntax" + Method_Edition_field_name protoreflect.Name = "edition" Method_Name_field_fullname protoreflect.FullName = "google.protobuf.Method.name" Method_RequestTypeUrl_field_fullname protoreflect.FullName = "google.protobuf.Method.request_type_url" @@ -71,6 +75,7 @@ const ( Method_ResponseStreaming_field_fullname protoreflect.FullName = "google.protobuf.Method.response_streaming" Method_Options_field_fullname protoreflect.FullName = "google.protobuf.Method.options" Method_Syntax_field_fullname protoreflect.FullName = "google.protobuf.Method.syntax" + Method_Edition_field_fullname protoreflect.FullName = "google.protobuf.Method.edition" ) // Field numbers for google.protobuf.Method. @@ -82,6 +87,7 @@ const ( Method_ResponseStreaming_field_number protoreflect.FieldNumber = 5 Method_Options_field_number protoreflect.FieldNumber = 6 Method_Syntax_field_number protoreflect.FieldNumber = 7 + Method_Edition_field_number protoreflect.FieldNumber = 8 ) // Names for google.protobuf.Mixin. diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 39524782ad..65aaf4d210 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -26,6 +26,7 @@ const ( Edition_EDITION_PROTO3_enum_value = 999 Edition_EDITION_2023_enum_value = 1000 Edition_EDITION_2024_enum_value = 1001 + Edition_EDITION_UNSTABLE_enum_value = 9999 Edition_EDITION_1_TEST_ONLY_enum_value = 1 Edition_EDITION_2_TEST_ONLY_enum_value = 2 Edition_EDITION_99997_TEST_ONLY_enum_value = 99997 @@ -34,6 +35,19 @@ const ( Edition_EDITION_MAX_enum_value = 2147483647 ) +// Full and short names for google.protobuf.SymbolVisibility. +const ( + SymbolVisibility_enum_fullname = "google.protobuf.SymbolVisibility" + SymbolVisibility_enum_name = "SymbolVisibility" +) + +// Enum values for google.protobuf.SymbolVisibility. +const ( + SymbolVisibility_VISIBILITY_UNSET_enum_value = 0 + SymbolVisibility_VISIBILITY_LOCAL_enum_value = 1 + SymbolVisibility_VISIBILITY_EXPORT_enum_value = 2 +) + // Names for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet" @@ -65,6 +79,7 @@ const ( FileDescriptorProto_Dependency_field_name protoreflect.Name = "dependency" FileDescriptorProto_PublicDependency_field_name protoreflect.Name = "public_dependency" FileDescriptorProto_WeakDependency_field_name protoreflect.Name = "weak_dependency" + FileDescriptorProto_OptionDependency_field_name protoreflect.Name = "option_dependency" FileDescriptorProto_MessageType_field_name protoreflect.Name = "message_type" FileDescriptorProto_EnumType_field_name protoreflect.Name = "enum_type" FileDescriptorProto_Service_field_name protoreflect.Name = "service" @@ -79,6 +94,7 @@ const ( FileDescriptorProto_Dependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.dependency" FileDescriptorProto_PublicDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.public_dependency" FileDescriptorProto_WeakDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.weak_dependency" + FileDescriptorProto_OptionDependency_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.option_dependency" FileDescriptorProto_MessageType_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.message_type" FileDescriptorProto_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.enum_type" FileDescriptorProto_Service_field_fullname protoreflect.FullName = "google.protobuf.FileDescriptorProto.service" @@ -96,6 +112,7 @@ const ( FileDescriptorProto_Dependency_field_number protoreflect.FieldNumber = 3 FileDescriptorProto_PublicDependency_field_number protoreflect.FieldNumber = 10 FileDescriptorProto_WeakDependency_field_number protoreflect.FieldNumber = 11 + FileDescriptorProto_OptionDependency_field_number protoreflect.FieldNumber = 15 FileDescriptorProto_MessageType_field_number protoreflect.FieldNumber = 4 FileDescriptorProto_EnumType_field_number protoreflect.FieldNumber = 5 FileDescriptorProto_Service_field_number protoreflect.FieldNumber = 6 @@ -124,6 +141,7 @@ const ( DescriptorProto_Options_field_name protoreflect.Name = "options" DescriptorProto_ReservedRange_field_name protoreflect.Name = "reserved_range" DescriptorProto_ReservedName_field_name protoreflect.Name = "reserved_name" + DescriptorProto_Visibility_field_name protoreflect.Name = "visibility" DescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.name" DescriptorProto_Field_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.field" @@ -135,6 +153,7 @@ const ( DescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.options" DescriptorProto_ReservedRange_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.reserved_range" DescriptorProto_ReservedName_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.reserved_name" + DescriptorProto_Visibility_field_fullname protoreflect.FullName = "google.protobuf.DescriptorProto.visibility" ) // Field numbers for google.protobuf.DescriptorProto. @@ -149,6 +168,7 @@ const ( DescriptorProto_Options_field_number protoreflect.FieldNumber = 7 DescriptorProto_ReservedRange_field_number protoreflect.FieldNumber = 9 DescriptorProto_ReservedName_field_number protoreflect.FieldNumber = 10 + DescriptorProto_Visibility_field_number protoreflect.FieldNumber = 11 ) // Names for google.protobuf.DescriptorProto.ExtensionRange. @@ -388,12 +408,14 @@ const ( EnumDescriptorProto_Options_field_name protoreflect.Name = "options" EnumDescriptorProto_ReservedRange_field_name protoreflect.Name = "reserved_range" EnumDescriptorProto_ReservedName_field_name protoreflect.Name = "reserved_name" + EnumDescriptorProto_Visibility_field_name protoreflect.Name = "visibility" EnumDescriptorProto_Name_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.name" EnumDescriptorProto_Value_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.value" EnumDescriptorProto_Options_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.options" EnumDescriptorProto_ReservedRange_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.reserved_range" EnumDescriptorProto_ReservedName_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.reserved_name" + EnumDescriptorProto_Visibility_field_fullname protoreflect.FullName = "google.protobuf.EnumDescriptorProto.visibility" ) // Field numbers for google.protobuf.EnumDescriptorProto. @@ -403,6 +425,7 @@ const ( EnumDescriptorProto_Options_field_number protoreflect.FieldNumber = 3 EnumDescriptorProto_ReservedRange_field_number protoreflect.FieldNumber = 4 EnumDescriptorProto_ReservedName_field_number protoreflect.FieldNumber = 5 + EnumDescriptorProto_Visibility_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.EnumDescriptorProto.EnumReservedRange. @@ -1008,32 +1031,35 @@ const ( // Field names for google.protobuf.FeatureSet. const ( - FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence" - FeatureSet_EnumType_field_name protoreflect.Name = "enum_type" - FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding" - FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation" - FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding" - FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format" - FeatureSet_EnforceNamingStyle_field_name protoreflect.Name = "enforce_naming_style" - - FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence" - FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type" - FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding" - FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation" - FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding" - FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format" - FeatureSet_EnforceNamingStyle_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enforce_naming_style" + FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence" + FeatureSet_EnumType_field_name protoreflect.Name = "enum_type" + FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding" + FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation" + FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding" + FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format" + FeatureSet_EnforceNamingStyle_field_name protoreflect.Name = "enforce_naming_style" + FeatureSet_DefaultSymbolVisibility_field_name protoreflect.Name = "default_symbol_visibility" + + FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence" + FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type" + FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding" + FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation" + FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding" + FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format" + FeatureSet_EnforceNamingStyle_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enforce_naming_style" + FeatureSet_DefaultSymbolVisibility_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.default_symbol_visibility" ) // Field numbers for google.protobuf.FeatureSet. const ( - FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1 - FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2 - FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3 - FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4 - FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5 - FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6 - FeatureSet_EnforceNamingStyle_field_number protoreflect.FieldNumber = 7 + FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1 + FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2 + FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3 + FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4 + FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5 + FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6 + FeatureSet_EnforceNamingStyle_field_number protoreflect.FieldNumber = 7 + FeatureSet_DefaultSymbolVisibility_field_number protoreflect.FieldNumber = 8 ) // Full and short names for google.protobuf.FeatureSet.FieldPresence. @@ -1128,6 +1154,27 @@ const ( FeatureSet_STYLE_LEGACY_enum_value = 2 ) +// Names for google.protobuf.FeatureSet.VisibilityFeature. +const ( + FeatureSet_VisibilityFeature_message_name protoreflect.Name = "VisibilityFeature" + FeatureSet_VisibilityFeature_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet.VisibilityFeature" +) + +// Full and short names for google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. +const ( + FeatureSet_VisibilityFeature_DefaultSymbolVisibility_enum_fullname = "google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility" + FeatureSet_VisibilityFeature_DefaultSymbolVisibility_enum_name = "DefaultSymbolVisibility" +) + +// Enum values for google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility. +const ( + FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN_enum_value = 0 + FeatureSet_VisibilityFeature_EXPORT_ALL_enum_value = 1 + FeatureSet_VisibilityFeature_EXPORT_TOP_LEVEL_enum_value = 2 + FeatureSet_VisibilityFeature_LOCAL_ALL_enum_value = 3 + FeatureSet_VisibilityFeature_STRICT_enum_value = 4 +) + // Names for google.protobuf.FeatureSetDefaults. const ( FeatureSetDefaults_message_name protoreflect.Name = "FeatureSetDefaults" diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go index 229c698013..4a3bf393ef 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_map.go @@ -113,6 +113,9 @@ func sizeMap(mapv reflect.Value, mapi *mapInfo, f *coderFieldInfo, opts marshalO } func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } @@ -170,6 +173,9 @@ func consumeMap(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo } func consumeMapOfMessage(b []byte, mapv reflect.Value, wtyp protowire.Type, mapi *mapInfo, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { + if opts.depth--; opts.depth < 0 { + return out, errRecursionDepth + } if wtyp != protowire.BytesType { return out, errUnknown } diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go b/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go index 41c1f74ef8..bdad12a9bb 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go @@ -11,6 +11,7 @@ import ( "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/messageset" + "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/internal/order" "google.golang.org/protobuf/reflect/protoreflect" piface "google.golang.org/protobuf/runtime/protoiface" @@ -80,7 +81,7 @@ func (mi *MessageInfo) makeOpaqueCoderMethods(t reflect.Type, si opaqueStructInf // permit us to skip over definitely-unset fields at marshal time. var hasPresence bool - hasPresence, cf.isLazy = usePresenceForField(si, fd) + hasPresence, cf.isLazy = filedesc.UsePresenceForField(fd) if hasPresence { cf.presenceIndex, mi.presenceSize = presenceIndex(mi.Desc, fd) diff --git a/vendor/google.golang.org/protobuf/internal/impl/decode.go b/vendor/google.golang.org/protobuf/internal/impl/decode.go index e0dd21fa5f..1228b5c8c2 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/decode.go +++ b/vendor/google.golang.org/protobuf/internal/impl/decode.go @@ -102,8 +102,7 @@ var errUnknown = errors.New("unknown") func (mi *MessageInfo) unmarshalPointer(b []byte, p pointer, groupTag protowire.Number, opts unmarshalOptions) (out unmarshalOutput, err error) { mi.init() - opts.depth-- - if opts.depth < 0 { + if opts.depth--; opts.depth < 0 { return out, errRecursionDepth } if flags.ProtoLegacy && mi.isMessageSet { diff --git a/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go b/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go index dd55e8e009..5a439daacb 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go @@ -11,6 +11,7 @@ import ( "strings" "sync/atomic" + "google.golang.org/protobuf/internal/filedesc" "google.golang.org/protobuf/reflect/protoreflect" ) @@ -53,7 +54,7 @@ func opaqueInitHook(mi *MessageInfo) bool { fd := fds.Get(i) fs := si.fieldsByNumber[fd.Number()] var fi fieldInfo - usePresence, _ := usePresenceForField(si, fd) + usePresence, _ := filedesc.UsePresenceForField(fd) switch { case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): @@ -343,17 +344,15 @@ func (mi *MessageInfo) fieldInfoForMessageListOpaqueNoPresence(si opaqueStructIn if p.IsNil() { return false } - sp := p.Apply(fieldOffset).AtomicGetPointer() - if sp.IsNil() { + rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() + if rv.IsNil() { return false } - rv := sp.AsValueOf(fs.Type.Elem()) return rv.Elem().Len() > 0 }, clear: func(p pointer) { - sp := p.Apply(fieldOffset).AtomicGetPointer() - if !sp.IsNil() { - rv := sp.AsValueOf(fs.Type.Elem()) + rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() + if !rv.IsNil() { rv.Elem().Set(reflect.Zero(rv.Type().Elem())) } }, @@ -361,11 +360,10 @@ func (mi *MessageInfo) fieldInfoForMessageListOpaqueNoPresence(si opaqueStructIn if p.IsNil() { return conv.Zero() } - sp := p.Apply(fieldOffset).AtomicGetPointer() - if sp.IsNil() { + rv := p.Apply(fieldOffset).AsValueOf(fs.Type).Elem() + if rv.IsNil() { return conv.Zero() } - rv := sp.AsValueOf(fs.Type.Elem()) if rv.Elem().Len() == 0 { return conv.Zero() } @@ -598,30 +596,3 @@ func (mi *MessageInfo) clearPresent(p pointer, index uint32) { func (mi *MessageInfo) present(p pointer, index uint32) bool { return p.Apply(mi.presenceOffset).PresenceInfo().Present(index) } - -// usePresenceForField implements the somewhat intricate logic of when -// the presence bitmap is used for a field. The main logic is that a -// field that is optional or that can be lazy will use the presence -// bit, but for proto2, also maps have a presence bit. It also records -// if the field can ever be lazy, which is true if we have a -// lazyOffset and the field is a message or a slice of messages. A -// field that is lazy will always need a presence bit. Oneofs are not -// lazy and do not use presence, unless they are a synthetic oneof, -// which is a proto3 optional field. For proto3 optionals, we use the -// presence and they can also be lazy when applicable (a message). -func usePresenceForField(si opaqueStructInfo, fd protoreflect.FieldDescriptor) (usePresence, canBeLazy bool) { - hasLazyField := fd.(interface{ IsLazy() bool }).IsLazy() - - // Non-oneof scalar fields with explicit field presence use the presence array. - usesPresenceArray := fd.HasPresence() && fd.Message() == nil && (fd.ContainingOneof() == nil || fd.ContainingOneof().IsSynthetic()) - switch { - case fd.ContainingOneof() != nil && !fd.ContainingOneof().IsSynthetic(): - return false, false - case fd.IsMap(): - return false, false - case fd.Kind() == protoreflect.MessageKind || fd.Kind() == protoreflect.GroupKind: - return hasLazyField, hasLazyField - default: - return usesPresenceArray || (hasLazyField && fd.HasPresence()), false - } -} diff --git a/vendor/google.golang.org/protobuf/internal/impl/presence.go b/vendor/google.golang.org/protobuf/internal/impl/presence.go index 914cb1deda..443afe81cd 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/presence.go +++ b/vendor/google.golang.org/protobuf/internal/impl/presence.go @@ -32,9 +32,6 @@ func (p presence) toElem(num uint32) (ret *uint32) { // Present checks for the presence of a specific field number in a presence set. func (p presence) Present(num uint32) bool { - if p.P == nil { - return false - } return Export{}.Present(p.toElem(num), num) } diff --git a/vendor/google.golang.org/protobuf/internal/impl/validate.go b/vendor/google.golang.org/protobuf/internal/impl/validate.go index 7b2995dde5..99a1eb95f7 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/validate.go +++ b/vendor/google.golang.org/protobuf/internal/impl/validate.go @@ -68,9 +68,13 @@ func Validate(mt protoreflect.MessageType, in protoiface.UnmarshalInput) (out pr if in.Resolver == nil { in.Resolver = protoregistry.GlobalTypes } + if in.Depth == 0 { + in.Depth = protowire.DefaultRecursionLimit + } o, st := mi.validate(in.Buf, 0, unmarshalOptions{ flags: in.Flags, resolver: in.Resolver, + depth: in.Depth, }) if o.initialized { out.Flags |= protoiface.UnmarshalInitialized @@ -257,6 +261,9 @@ func (mi *MessageInfo) validate(b []byte, groupTag protowire.Number, opts unmars states[0].typ = validationTypeGroup states[0].endGroup = groupTag } + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } initialized := true start := len(b) State: @@ -451,6 +458,13 @@ State: mi: vi.mi, tail: b, }) + if vi.typ == validationTypeMessage || + vi.typ == validationTypeGroup || + vi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State case validationTypeRepeatedVarint: @@ -499,6 +513,9 @@ State: mi: vi.mi, endGroup: num, }) + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } continue State case flags.ProtoLegacy && vi.typ == validationTypeMessageSetItem: typeid, v, n, err := messageset.ConsumeFieldValue(b, false) @@ -521,6 +538,13 @@ State: mi: xvi.mi, tail: b[n:], }) + if xvi.typ == validationTypeMessage || + xvi.typ == validationTypeGroup || + xvi.typ == validationTypeMap { + if opts.depth--; opts.depth < 0 { + return out, ValidationInvalid + } + } b = v continue State } @@ -547,12 +571,14 @@ State: switch st.typ { case validationTypeMessage, validationTypeGroup: numRequiredFields = int(st.mi.numRequiredFields) + opts.depth++ case validationTypeMap: // If this is a map field with a message value that contains // required fields, require that the value be present. if st.mi != nil && st.mi.numRequiredFields > 0 { numRequiredFields = 1 } + opts.depth++ } // If there are more than 64 required fields, this check will // always fail and we will report that the message is potentially diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index aac1cb18a7..763fd82841 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -52,7 +52,7 @@ import ( const ( Major = 1 Minor = 36 - Patch = 6 + Patch = 11 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 4cbf1aeaf7..889d8511d2 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -121,9 +121,8 @@ func (o UnmarshalOptions) unmarshal(b []byte, m protoreflect.Message) (out proto out, err = methods.Unmarshal(in) } else { - o.RecursionLimit-- - if o.RecursionLimit < 0 { - return out, errors.New("exceeded max recursion depth") + if o.RecursionLimit--; o.RecursionLimit < 0 { + return out, errRecursionDepth } err = o.unmarshalMessageSlow(b, m) } @@ -220,6 +219,9 @@ func (o UnmarshalOptions) unmarshalSingular(b []byte, wtyp protowire.Type, m pro } func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv protoreflect.Map, fd protoreflect.FieldDescriptor) (n int, err error) { + if o.RecursionLimit--; o.RecursionLimit < 0 { + return 0, errRecursionDepth + } if wtyp != protowire.BytesType { return 0, errUnknown } @@ -305,3 +307,5 @@ func (o UnmarshalOptions) unmarshalMap(b []byte, wtyp protowire.Type, mapv proto var errUnknown = errors.New("BUG: internal error (unknown)") var errDecode = errors.New("cannot parse invalid wire-format data") + +var errRecursionDepth = errors.New("exceeded maximum recursion depth") diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index a4a0a2971d..730331e666 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -21,6 +21,8 @@ func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte { b = p.appendRepeatedField(b, "public_dependency", nil) case 11: b = p.appendRepeatedField(b, "weak_dependency", nil) + case 15: + b = p.appendRepeatedField(b, "option_dependency", nil) case 4: b = p.appendRepeatedField(b, "message_type", (*SourcePath).appendDescriptorProto) case 5: @@ -66,6 +68,8 @@ func (p *SourcePath) appendDescriptorProto(b []byte) []byte { b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendDescriptorProto_ReservedRange) case 10: b = p.appendRepeatedField(b, "reserved_name", nil) + case 11: + b = p.appendSingularField(b, "visibility", nil) } return b } @@ -85,6 +89,8 @@ func (p *SourcePath) appendEnumDescriptorProto(b []byte) []byte { b = p.appendRepeatedField(b, "reserved_range", (*SourcePath).appendEnumDescriptorProto_EnumReservedRange) case 5: b = p.appendRepeatedField(b, "reserved_name", nil) + case 6: + b = p.appendSingularField(b, "visibility", nil) } return b } @@ -400,6 +406,8 @@ func (p *SourcePath) appendFeatureSet(b []byte) []byte { b = p.appendSingularField(b, "json_format", nil) case 7: b = p.appendSingularField(b, "enforce_naming_style", nil) + case 8: + b = p.appendSingularField(b, "default_symbol_visibility", nil) } return b } diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 7fe280f194..0b23faa957 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -69,6 +69,8 @@ const ( // comparison. Edition_EDITION_2023 Edition = 1000 Edition_EDITION_2024 Edition = 1001 + // A placeholder edition for developing and testing unscheduled features. + Edition_EDITION_UNSTABLE Edition = 9999 // Placeholder editions for testing feature resolution. These should not be // used or relied on outside of tests. Edition_EDITION_1_TEST_ONLY Edition = 1 @@ -91,6 +93,7 @@ var ( 999: "EDITION_PROTO3", 1000: "EDITION_2023", 1001: "EDITION_2024", + 9999: "EDITION_UNSTABLE", 1: "EDITION_1_TEST_ONLY", 2: "EDITION_2_TEST_ONLY", 99997: "EDITION_99997_TEST_ONLY", @@ -105,6 +108,7 @@ var ( "EDITION_PROTO3": 999, "EDITION_2023": 1000, "EDITION_2024": 1001, + "EDITION_UNSTABLE": 9999, "EDITION_1_TEST_ONLY": 1, "EDITION_2_TEST_ONLY": 2, "EDITION_99997_TEST_ONLY": 99997, @@ -151,6 +155,70 @@ func (Edition) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{0} } +// Describes the 'visibility' of a symbol with respect to the proto import +// system. Symbols can only be imported when the visibility rules do not prevent +// it (ex: local symbols cannot be imported). Visibility modifiers can only set +// on `message` and `enum` as they are the only types available to be referenced +// from other files. +type SymbolVisibility int32 + +const ( + SymbolVisibility_VISIBILITY_UNSET SymbolVisibility = 0 + SymbolVisibility_VISIBILITY_LOCAL SymbolVisibility = 1 + SymbolVisibility_VISIBILITY_EXPORT SymbolVisibility = 2 +) + +// Enum value maps for SymbolVisibility. +var ( + SymbolVisibility_name = map[int32]string{ + 0: "VISIBILITY_UNSET", + 1: "VISIBILITY_LOCAL", + 2: "VISIBILITY_EXPORT", + } + SymbolVisibility_value = map[string]int32{ + "VISIBILITY_UNSET": 0, + "VISIBILITY_LOCAL": 1, + "VISIBILITY_EXPORT": 2, + } +) + +func (x SymbolVisibility) Enum() *SymbolVisibility { + p := new(SymbolVisibility) + *p = x + return p +} + +func (x SymbolVisibility) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SymbolVisibility) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() +} + +func (SymbolVisibility) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[1] +} + +func (x SymbolVisibility) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *SymbolVisibility) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = SymbolVisibility(num) + return nil +} + +// Deprecated: Use SymbolVisibility.Descriptor instead. +func (SymbolVisibility) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{1} +} + // The verification state of the extension range. type ExtensionRangeOptions_VerificationState int32 @@ -183,11 +251,11 @@ func (x ExtensionRangeOptions_VerificationState) String() string { } func (ExtensionRangeOptions_VerificationState) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() } func (ExtensionRangeOptions_VerificationState) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[1] + return &file_google_protobuf_descriptor_proto_enumTypes[2] } func (x ExtensionRangeOptions_VerificationState) Number() protoreflect.EnumNumber { @@ -299,11 +367,11 @@ func (x FieldDescriptorProto_Type) String() string { } func (FieldDescriptorProto_Type) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() } func (FieldDescriptorProto_Type) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[2] + return &file_google_protobuf_descriptor_proto_enumTypes[3] } func (x FieldDescriptorProto_Type) Number() protoreflect.EnumNumber { @@ -362,11 +430,11 @@ func (x FieldDescriptorProto_Label) String() string { } func (FieldDescriptorProto_Label) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() } func (FieldDescriptorProto_Label) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[3] + return &file_google_protobuf_descriptor_proto_enumTypes[4] } func (x FieldDescriptorProto_Label) Number() protoreflect.EnumNumber { @@ -423,11 +491,11 @@ func (x FileOptions_OptimizeMode) String() string { } func (FileOptions_OptimizeMode) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() } func (FileOptions_OptimizeMode) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[4] + return &file_google_protobuf_descriptor_proto_enumTypes[5] } func (x FileOptions_OptimizeMode) Number() protoreflect.EnumNumber { @@ -489,11 +557,11 @@ func (x FieldOptions_CType) String() string { } func (FieldOptions_CType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() } func (FieldOptions_CType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[5] + return &file_google_protobuf_descriptor_proto_enumTypes[6] } func (x FieldOptions_CType) Number() protoreflect.EnumNumber { @@ -551,11 +619,11 @@ func (x FieldOptions_JSType) String() string { } func (FieldOptions_JSType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() } func (FieldOptions_JSType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[6] + return &file_google_protobuf_descriptor_proto_enumTypes[7] } func (x FieldOptions_JSType) Number() protoreflect.EnumNumber { @@ -611,11 +679,11 @@ func (x FieldOptions_OptionRetention) String() string { } func (FieldOptions_OptionRetention) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() } func (FieldOptions_OptionRetention) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[7] + return &file_google_protobuf_descriptor_proto_enumTypes[8] } func (x FieldOptions_OptionRetention) Number() protoreflect.EnumNumber { @@ -694,11 +762,11 @@ func (x FieldOptions_OptionTargetType) String() string { } func (FieldOptions_OptionTargetType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() } func (FieldOptions_OptionTargetType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[8] + return &file_google_protobuf_descriptor_proto_enumTypes[9] } func (x FieldOptions_OptionTargetType) Number() protoreflect.EnumNumber { @@ -756,11 +824,11 @@ func (x MethodOptions_IdempotencyLevel) String() string { } func (MethodOptions_IdempotencyLevel) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[10].Descriptor() } func (MethodOptions_IdempotencyLevel) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[9] + return &file_google_protobuf_descriptor_proto_enumTypes[10] } func (x MethodOptions_IdempotencyLevel) Number() protoreflect.EnumNumber { @@ -818,11 +886,11 @@ func (x FeatureSet_FieldPresence) String() string { } func (FeatureSet_FieldPresence) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[10].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[11].Descriptor() } func (FeatureSet_FieldPresence) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[10] + return &file_google_protobuf_descriptor_proto_enumTypes[11] } func (x FeatureSet_FieldPresence) Number() protoreflect.EnumNumber { @@ -877,11 +945,11 @@ func (x FeatureSet_EnumType) String() string { } func (FeatureSet_EnumType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[11].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[12].Descriptor() } func (FeatureSet_EnumType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[11] + return &file_google_protobuf_descriptor_proto_enumTypes[12] } func (x FeatureSet_EnumType) Number() protoreflect.EnumNumber { @@ -936,11 +1004,11 @@ func (x FeatureSet_RepeatedFieldEncoding) String() string { } func (FeatureSet_RepeatedFieldEncoding) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[12].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[13].Descriptor() } func (FeatureSet_RepeatedFieldEncoding) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[12] + return &file_google_protobuf_descriptor_proto_enumTypes[13] } func (x FeatureSet_RepeatedFieldEncoding) Number() protoreflect.EnumNumber { @@ -995,11 +1063,11 @@ func (x FeatureSet_Utf8Validation) String() string { } func (FeatureSet_Utf8Validation) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[13].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[14].Descriptor() } func (FeatureSet_Utf8Validation) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[13] + return &file_google_protobuf_descriptor_proto_enumTypes[14] } func (x FeatureSet_Utf8Validation) Number() protoreflect.EnumNumber { @@ -1054,11 +1122,11 @@ func (x FeatureSet_MessageEncoding) String() string { } func (FeatureSet_MessageEncoding) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[14].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[15].Descriptor() } func (FeatureSet_MessageEncoding) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[14] + return &file_google_protobuf_descriptor_proto_enumTypes[15] } func (x FeatureSet_MessageEncoding) Number() protoreflect.EnumNumber { @@ -1113,11 +1181,11 @@ func (x FeatureSet_JsonFormat) String() string { } func (FeatureSet_JsonFormat) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[15].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[16].Descriptor() } func (FeatureSet_JsonFormat) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[15] + return &file_google_protobuf_descriptor_proto_enumTypes[16] } func (x FeatureSet_JsonFormat) Number() protoreflect.EnumNumber { @@ -1172,11 +1240,11 @@ func (x FeatureSet_EnforceNamingStyle) String() string { } func (FeatureSet_EnforceNamingStyle) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[16].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[17].Descriptor() } func (FeatureSet_EnforceNamingStyle) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[16] + return &file_google_protobuf_descriptor_proto_enumTypes[17] } func (x FeatureSet_EnforceNamingStyle) Number() protoreflect.EnumNumber { @@ -1198,6 +1266,77 @@ func (FeatureSet_EnforceNamingStyle) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 6} } +type FeatureSet_VisibilityFeature_DefaultSymbolVisibility int32 + +const ( + FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 0 + // Default pre-EDITION_2024, all UNSET visibility are export. + FeatureSet_VisibilityFeature_EXPORT_ALL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 1 + // All top-level symbols default to export, nested default to local. + FeatureSet_VisibilityFeature_EXPORT_TOP_LEVEL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 2 + // All symbols default to local. + FeatureSet_VisibilityFeature_LOCAL_ALL FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 3 + // All symbols local by default. Nested types cannot be exported. + // With special case caveat for message { enum {} reserved 1 to max; } + // This is the recommended setting for new protos. + FeatureSet_VisibilityFeature_STRICT FeatureSet_VisibilityFeature_DefaultSymbolVisibility = 4 +) + +// Enum value maps for FeatureSet_VisibilityFeature_DefaultSymbolVisibility. +var ( + FeatureSet_VisibilityFeature_DefaultSymbolVisibility_name = map[int32]string{ + 0: "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN", + 1: "EXPORT_ALL", + 2: "EXPORT_TOP_LEVEL", + 3: "LOCAL_ALL", + 4: "STRICT", + } + FeatureSet_VisibilityFeature_DefaultSymbolVisibility_value = map[string]int32{ + "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, + "EXPORT_ALL": 1, + "EXPORT_TOP_LEVEL": 2, + "LOCAL_ALL": 3, + "STRICT": 4, + } +) + +func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Enum() *FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + p := new(FeatureSet_VisibilityFeature_DefaultSymbolVisibility) + *p = x + return p +} + +func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[18].Descriptor() +} + +func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[18] +} + +func (x FeatureSet_VisibilityFeature_DefaultSymbolVisibility) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_VisibilityFeature_DefaultSymbolVisibility) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_VisibilityFeature_DefaultSymbolVisibility(num) + return nil +} + +// Deprecated: Use FeatureSet_VisibilityFeature_DefaultSymbolVisibility.Descriptor instead. +func (FeatureSet_VisibilityFeature_DefaultSymbolVisibility) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0, 0} +} + // Represents the identified object's effect on the element in the original // .proto file. type GeneratedCodeInfo_Annotation_Semantic int32 @@ -1236,11 +1375,11 @@ func (x GeneratedCodeInfo_Annotation_Semantic) String() string { } func (GeneratedCodeInfo_Annotation_Semantic) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[17].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[19].Descriptor() } func (GeneratedCodeInfo_Annotation_Semantic) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[17] + return &file_google_protobuf_descriptor_proto_enumTypes[19] } func (x GeneratedCodeInfo_Annotation_Semantic) Number() protoreflect.EnumNumber { @@ -1321,6 +1460,9 @@ type FileDescriptorProto struct { // Indexes of the weak imported files in the dependency list. // For Google-internal migration only. Do not use. WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` + // Names of files imported by this file purely for the purpose of providing + // option extensions. These are excluded from the dependency list above. + OptionDependency []string `protobuf:"bytes,15,rep,name=option_dependency,json=optionDependency" json:"option_dependency,omitempty"` // All top-level definitions in this file. MessageType []*DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` EnumType []*EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` @@ -1414,6 +1556,13 @@ func (x *FileDescriptorProto) GetWeakDependency() []int32 { return nil } +func (x *FileDescriptorProto) GetOptionDependency() []string { + if x != nil { + return x.OptionDependency + } + return nil +} + func (x *FileDescriptorProto) GetMessageType() []*DescriptorProto { if x != nil { return x.MessageType @@ -1484,7 +1633,9 @@ type DescriptorProto struct { ReservedRange []*DescriptorProto_ReservedRange `protobuf:"bytes,9,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved field names, which may not be used by fields in the same message. // A given name may only be reserved once. - ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` + ReservedName []string `protobuf:"bytes,10,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` + // Support for `export` and `local` keywords on enums. + Visibility *SymbolVisibility `protobuf:"varint,11,opt,name=visibility,enum=google.protobuf.SymbolVisibility" json:"visibility,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1589,6 +1740,13 @@ func (x *DescriptorProto) GetReservedName() []string { return nil } +func (x *DescriptorProto) GetVisibility() SymbolVisibility { + if x != nil && x.Visibility != nil { + return *x.Visibility + } + return SymbolVisibility_VISIBILITY_UNSET +} + type ExtensionRangeOptions struct { state protoimpl.MessageState `protogen:"open.v1"` // The parser stores options it doesn't recognize here. See above. @@ -1901,7 +2059,9 @@ type EnumDescriptorProto struct { ReservedRange []*EnumDescriptorProto_EnumReservedRange `protobuf:"bytes,4,rep,name=reserved_range,json=reservedRange" json:"reserved_range,omitempty"` // Reserved enum value names, which may not be reused. A given name may only // be reserved once. - ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` + ReservedName []string `protobuf:"bytes,5,rep,name=reserved_name,json=reservedName" json:"reserved_name,omitempty"` + // Support for `export` and `local` keywords on enums. + Visibility *SymbolVisibility `protobuf:"varint,6,opt,name=visibility,enum=google.protobuf.SymbolVisibility" json:"visibility,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -1971,6 +2131,13 @@ func (x *EnumDescriptorProto) GetReservedName() []string { return nil } +func (x *EnumDescriptorProto) GetVisibility() SymbolVisibility { + if x != nil && x.Visibility != nil { + return *x.Visibility + } + return SymbolVisibility_VISIBILITY_UNSET +} + // Describes a value within an enum. type EnumValueDescriptorProto struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2710,7 +2877,10 @@ type FieldOptions struct { // for accessors, or it will be completely ignored; in the very least, this // is a formalization for deprecating fields. Deprecated *bool `protobuf:"varint,3,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // DEPRECATED. DO NOT USE! // For Google-internal migration only. Do not use. + // + // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` // Indicate that the field value should not be printed out when using debug // formats, e.g. when the field contains sensitive credentials. @@ -2814,6 +2984,7 @@ func (x *FieldOptions) GetDeprecated() bool { return Default_FieldOptions_Deprecated } +// Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. func (x *FieldOptions) GetWeak() bool { if x != nil && x.Weak != nil { return *x.Weak @@ -3392,17 +3563,18 @@ func (x *UninterpretedOption) GetAggregateValue() string { // be designed and implemented to handle this, hopefully before we ever hit a // conflict here. type FeatureSet struct { - state protoimpl.MessageState `protogen:"open.v1"` - FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet_FieldPresence" json:"field_presence,omitempty"` - EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet_EnumType" json:"enum_type,omitempty"` - RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet_RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"` - Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet_Utf8Validation" json:"utf8_validation,omitempty"` - MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet_MessageEncoding" json:"message_encoding,omitempty"` - JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet_JsonFormat" json:"json_format,omitempty"` - EnforceNamingStyle *FeatureSet_EnforceNamingStyle `protobuf:"varint,7,opt,name=enforce_naming_style,json=enforceNamingStyle,enum=google.protobuf.FeatureSet_EnforceNamingStyle" json:"enforce_naming_style,omitempty"` - extensionFields protoimpl.ExtensionFields - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet_FieldPresence" json:"field_presence,omitempty"` + EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet_EnumType" json:"enum_type,omitempty"` + RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet_RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"` + Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet_Utf8Validation" json:"utf8_validation,omitempty"` + MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet_MessageEncoding" json:"message_encoding,omitempty"` + JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet_JsonFormat" json:"json_format,omitempty"` + EnforceNamingStyle *FeatureSet_EnforceNamingStyle `protobuf:"varint,7,opt,name=enforce_naming_style,json=enforceNamingStyle,enum=google.protobuf.FeatureSet_EnforceNamingStyle" json:"enforce_naming_style,omitempty"` + DefaultSymbolVisibility *FeatureSet_VisibilityFeature_DefaultSymbolVisibility `protobuf:"varint,8,opt,name=default_symbol_visibility,json=defaultSymbolVisibility,enum=google.protobuf.FeatureSet_VisibilityFeature_DefaultSymbolVisibility" json:"default_symbol_visibility,omitempty"` + extensionFields protoimpl.ExtensionFields + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FeatureSet) Reset() { @@ -3484,6 +3656,13 @@ func (x *FeatureSet) GetEnforceNamingStyle() FeatureSet_EnforceNamingStyle { return FeatureSet_ENFORCE_NAMING_STYLE_UNKNOWN } +func (x *FeatureSet) GetDefaultSymbolVisibility() FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + if x != nil && x.DefaultSymbolVisibility != nil { + return *x.DefaultSymbolVisibility + } + return FeatureSet_VisibilityFeature_DEFAULT_SYMBOL_VISIBILITY_UNKNOWN +} + // A compiled specification for the defaults of a set of features. These // messages are generated from FeatureSet extensions and can be used to seed // feature resolution. The resolution with this object becomes a simple search @@ -4144,6 +4323,42 @@ func (x *UninterpretedOption_NamePart) GetIsExtension() bool { return false } +type FeatureSet_VisibilityFeature struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FeatureSet_VisibilityFeature) Reset() { + *x = FeatureSet_VisibilityFeature{} + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FeatureSet_VisibilityFeature) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet_VisibilityFeature) ProtoMessage() {} + +func (x *FeatureSet_VisibilityFeature) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSet_VisibilityFeature.ProtoReflect.Descriptor instead. +func (*FeatureSet_VisibilityFeature) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} +} + // A map from every known edition with a unique set of defaults to its // defaults. Not all editions may be contained here. For a given edition, // the defaults at the closest matching edition ordered at or before it should @@ -4161,7 +4376,7 @@ type FeatureSetDefaults_FeatureSetEditionDefault struct { func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { *x = FeatureSetDefaults_FeatureSetEditionDefault{} - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4173,7 +4388,7 @@ func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[30] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4309,7 +4524,7 @@ type SourceCodeInfo_Location struct { func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4321,7 +4536,7 @@ func (x *SourceCodeInfo_Location) String() string { func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[31] + mi := &file_google_protobuf_descriptor_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4393,7 +4608,7 @@ type GeneratedCodeInfo_Annotation struct { func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} - mi := &file_google_protobuf_descriptor_proto_msgTypes[32] + mi := &file_google_protobuf_descriptor_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4405,7 +4620,7 @@ func (x *GeneratedCodeInfo_Annotation) String() string { func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[32] + mi := &file_google_protobuf_descriptor_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4462,7 +4677,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\n" + " google/protobuf/descriptor.proto\x12\x0fgoogle.protobuf\"[\n" + "\x11FileDescriptorSet\x128\n" + - "\x04file\x18\x01 \x03(\v2$.google.protobuf.FileDescriptorProtoR\x04file*\f\b\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\x98\x05\n" + + "\x04file\x18\x01 \x03(\v2$.google.protobuf.FileDescriptorProtoR\x04file*\f\b\x80\xec\xca\xff\x01\x10\x81\xec\xca\xff\x01\"\xc5\x05\n" + "\x13FileDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" + "\apackage\x18\x02 \x01(\tR\apackage\x12\x1e\n" + @@ -4471,7 +4686,8 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "dependency\x12+\n" + "\x11public_dependency\x18\n" + " \x03(\x05R\x10publicDependency\x12'\n" + - "\x0fweak_dependency\x18\v \x03(\x05R\x0eweakDependency\x12C\n" + + "\x0fweak_dependency\x18\v \x03(\x05R\x0eweakDependency\x12+\n" + + "\x11option_dependency\x18\x0f \x03(\tR\x10optionDependency\x12C\n" + "\fmessage_type\x18\x04 \x03(\v2 .google.protobuf.DescriptorProtoR\vmessageType\x12A\n" + "\tenum_type\x18\x05 \x03(\v2$.google.protobuf.EnumDescriptorProtoR\benumType\x12A\n" + "\aservice\x18\x06 \x03(\v2'.google.protobuf.ServiceDescriptorProtoR\aservice\x12C\n" + @@ -4479,7 +4695,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\aoptions\x18\b \x01(\v2\x1c.google.protobuf.FileOptionsR\aoptions\x12I\n" + "\x10source_code_info\x18\t \x01(\v2\x1f.google.protobuf.SourceCodeInfoR\x0esourceCodeInfo\x12\x16\n" + "\x06syntax\x18\f \x01(\tR\x06syntax\x122\n" + - "\aedition\x18\x0e \x01(\x0e2\x18.google.protobuf.EditionR\aedition\"\xb9\x06\n" + + "\aedition\x18\x0e \x01(\x0e2\x18.google.protobuf.EditionR\aedition\"\xfc\x06\n" + "\x0fDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12;\n" + "\x05field\x18\x02 \x03(\v2%.google.protobuf.FieldDescriptorProtoR\x05field\x12C\n" + @@ -4493,7 +4709,10 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\aoptions\x18\a \x01(\v2\x1f.google.protobuf.MessageOptionsR\aoptions\x12U\n" + "\x0ereserved_range\x18\t \x03(\v2..google.protobuf.DescriptorProto.ReservedRangeR\rreservedRange\x12#\n" + "\rreserved_name\x18\n" + - " \x03(\tR\freservedName\x1az\n" + + " \x03(\tR\freservedName\x12A\n" + + "\n" + + "visibility\x18\v \x01(\x0e2!.google.protobuf.SymbolVisibilityR\n" + + "visibility\x1az\n" + "\x0eExtensionRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + "\x03end\x18\x02 \x01(\x05R\x03end\x12@\n" + @@ -4562,24 +4781,27 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0eLABEL_REQUIRED\x10\x02\"c\n" + "\x14OneofDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x127\n" + - "\aoptions\x18\x02 \x01(\v2\x1d.google.protobuf.OneofOptionsR\aoptions\"\xe3\x02\n" + + "\aoptions\x18\x02 \x01(\v2\x1d.google.protobuf.OneofOptionsR\aoptions\"\xa6\x03\n" + "\x13EnumDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12?\n" + "\x05value\x18\x02 \x03(\v2).google.protobuf.EnumValueDescriptorProtoR\x05value\x126\n" + "\aoptions\x18\x03 \x01(\v2\x1c.google.protobuf.EnumOptionsR\aoptions\x12]\n" + "\x0ereserved_range\x18\x04 \x03(\v26.google.protobuf.EnumDescriptorProto.EnumReservedRangeR\rreservedRange\x12#\n" + - "\rreserved_name\x18\x05 \x03(\tR\freservedName\x1a;\n" + + "\rreserved_name\x18\x05 \x03(\tR\freservedName\x12A\n" + + "\n" + + "visibility\x18\x06 \x01(\x0e2!.google.protobuf.SymbolVisibilityR\n" + + "visibility\x1a;\n" + "\x11EnumReservedRange\x12\x14\n" + "\x05start\x18\x01 \x01(\x05R\x05start\x12\x10\n" + "\x03end\x18\x02 \x01(\x05R\x03end\"\x83\x01\n" + "\x18EnumValueDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x16\n" + "\x06number\x18\x02 \x01(\x05R\x06number\x12;\n" + - "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xa7\x01\n" + + "\aoptions\x18\x03 \x01(\v2!.google.protobuf.EnumValueOptionsR\aoptions\"\xb5\x01\n" + "\x16ServiceDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12>\n" + "\x06method\x18\x02 \x03(\v2&.google.protobuf.MethodDescriptorProtoR\x06method\x129\n" + - "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptions\"\x89\x02\n" + + "\aoptions\x18\x03 \x01(\v2\x1f.google.protobuf.ServiceOptionsR\aoptionsJ\x04\b\x04\x10\x05R\x06stream\"\x89\x02\n" + "\x15MethodDescriptorProto\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x1d\n" + "\n" + @@ -4629,7 +4851,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "&deprecated_legacy_json_field_conflicts\x18\v \x01(\bB\x02\x18\x01R\"deprecatedLegacyJsonFieldConflicts\x127\n" + "\bfeatures\x18\f \x01(\v2\x1b.google.protobuf.FeatureSetR\bfeatures\x12X\n" + "\x14uninterpreted_option\x18\xe7\a \x03(\v2$.google.protobuf.UninterpretedOptionR\x13uninterpretedOption*\t\b\xe8\a\x10\x80\x80\x80\x80\x02J\x04\b\x04\x10\x05J\x04\b\x05\x10\x06J\x04\b\x06\x10\aJ\x04\b\b\x10\tJ\x04\b\t\x10\n" + - "\"\x9d\r\n" + + "\"\xa1\r\n" + "\fFieldOptions\x12A\n" + "\x05ctype\x18\x01 \x01(\x0e2#.google.protobuf.FieldOptions.CType:\x06STRINGR\x05ctype\x12\x16\n" + "\x06packed\x18\x02 \x01(\bR\x06packed\x12G\n" + @@ -4638,9 +4860,9 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0funverified_lazy\x18\x0f \x01(\b:\x05falseR\x0eunverifiedLazy\x12%\n" + "\n" + "deprecated\x18\x03 \x01(\b:\x05falseR\n" + - "deprecated\x12\x19\n" + + "deprecated\x12\x1d\n" + "\x04weak\x18\n" + - " \x01(\b:\x05falseR\x04weak\x12(\n" + + " \x01(\b:\x05falseB\x02\x18\x01R\x04weak\x12(\n" + "\fdebug_redact\x18\x10 \x01(\b:\x05falseR\vdebugRedact\x12K\n" + "\tretention\x18\x11 \x01(\x0e2-.google.protobuf.FieldOptions.OptionRetentionR\tretention\x12H\n" + "\atargets\x18\x13 \x03(\x0e2..google.protobuf.FieldOptions.OptionTargetTypeR\atargets\x12W\n" + @@ -4728,7 +4950,7 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\x0faggregate_value\x18\b \x01(\tR\x0eaggregateValue\x1aJ\n" + "\bNamePart\x12\x1b\n" + "\tname_part\x18\x01 \x02(\tR\bnamePart\x12!\n" + - "\fis_extension\x18\x02 \x02(\bR\visExtension\"\xae\f\n" + + "\fis_extension\x18\x02 \x02(\bR\visExtension\"\x8e\x0f\n" + "\n" + "FeatureSet\x12\x91\x01\n" + "\x0efield_presence\x18\x01 \x01(\x0e2).google.protobuf.FeatureSet.FieldPresenceB?\x88\x01\x01\x98\x01\x04\x98\x01\x01\xa2\x01\r\x12\bEXPLICIT\x18\x84\a\xa2\x01\r\x12\bIMPLICIT\x18\xe7\a\xa2\x01\r\x12\bEXPLICIT\x18\xe8\a\xb2\x01\x03\b\xe8\aR\rfieldPresence\x12l\n" + @@ -4739,7 +4961,18 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\vjson_format\x18\x06 \x01(\x0e2&.google.protobuf.FeatureSet.JsonFormatB9\x88\x01\x01\x98\x01\x03\x98\x01\x06\x98\x01\x01\xa2\x01\x17\x12\x12LEGACY_BEST_EFFORT\x18\x84\a\xa2\x01\n" + "\x12\x05ALLOW\x18\xe7\a\xb2\x01\x03\b\xe8\aR\n" + "jsonFormat\x12\xab\x01\n" + - "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\"\\\n" + + "\x14enforce_naming_style\x18\a \x01(\x0e2..google.protobuf.FeatureSet.EnforceNamingStyleBI\x88\x01\x02\x98\x01\x01\x98\x01\x02\x98\x01\x03\x98\x01\x04\x98\x01\x05\x98\x01\x06\x98\x01\a\x98\x01\b\x98\x01\t\xa2\x01\x11\x12\fSTYLE_LEGACY\x18\x84\a\xa2\x01\x0e\x12\tSTYLE2024\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x12enforceNamingStyle\x12\xb9\x01\n" + + "\x19default_symbol_visibility\x18\b \x01(\x0e2E.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibilityB6\x88\x01\x02\x98\x01\x01\xa2\x01\x0f\x12\n" + + "EXPORT_ALL\x18\x84\a\xa2\x01\x15\x12\x10EXPORT_TOP_LEVEL\x18\xe9\a\xb2\x01\x03\b\xe9\aR\x17defaultSymbolVisibility\x1a\xa1\x01\n" + + "\x11VisibilityFeature\"\x81\x01\n" + + "\x17DefaultSymbolVisibility\x12%\n" + + "!DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\x10\x00\x12\x0e\n" + + "\n" + + "EXPORT_ALL\x10\x01\x12\x14\n" + + "\x10EXPORT_TOP_LEVEL\x10\x02\x12\r\n" + + "\tLOCAL_ALL\x10\x03\x12\n" + + "\n" + + "\x06STRICT\x10\x04J\b\b\x01\x10\x80\x80\x80\x80\x02\"\\\n" + "\rFieldPresence\x12\x1a\n" + "\x16FIELD_PRESENCE_UNKNOWN\x10\x00\x12\f\n" + "\bEXPLICIT\x10\x01\x12\f\n" + @@ -4804,20 +5037,25 @@ const file_google_protobuf_descriptor_proto_rawDesc = "" + "\bSemantic\x12\b\n" + "\x04NONE\x10\x00\x12\a\n" + "\x03SET\x10\x01\x12\t\n" + - "\x05ALIAS\x10\x02*\xa7\x02\n" + + "\x05ALIAS\x10\x02*\xbe\x02\n" + "\aEdition\x12\x13\n" + "\x0fEDITION_UNKNOWN\x10\x00\x12\x13\n" + "\x0eEDITION_LEGACY\x10\x84\a\x12\x13\n" + "\x0eEDITION_PROTO2\x10\xe6\a\x12\x13\n" + "\x0eEDITION_PROTO3\x10\xe7\a\x12\x11\n" + "\fEDITION_2023\x10\xe8\a\x12\x11\n" + - "\fEDITION_2024\x10\xe9\a\x12\x17\n" + + "\fEDITION_2024\x10\xe9\a\x12\x15\n" + + "\x10EDITION_UNSTABLE\x10\x8fN\x12\x17\n" + "\x13EDITION_1_TEST_ONLY\x10\x01\x12\x17\n" + "\x13EDITION_2_TEST_ONLY\x10\x02\x12\x1d\n" + "\x17EDITION_99997_TEST_ONLY\x10\x9d\x8d\x06\x12\x1d\n" + "\x17EDITION_99998_TEST_ONLY\x10\x9e\x8d\x06\x12\x1d\n" + "\x17EDITION_99999_TEST_ONLY\x10\x9f\x8d\x06\x12\x13\n" + - "\vEDITION_MAX\x10\xff\xff\xff\xff\aB~\n" + + "\vEDITION_MAX\x10\xff\xff\xff\xff\a*U\n" + + "\x10SymbolVisibility\x12\x14\n" + + "\x10VISIBILITY_UNSET\x10\x00\x12\x14\n" + + "\x10VISIBILITY_LOCAL\x10\x01\x12\x15\n" + + "\x11VISIBILITY_EXPORT\x10\x02B~\n" + "\x13com.google.protobufB\x10DescriptorProtosH\x01Z-google.golang.org/protobuf/types/descriptorpb\xf8\x01\x01\xa2\x02\x03GPB\xaa\x02\x1aGoogle.Protobuf.Reflection" var ( @@ -4832,145 +5070,151 @@ func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { return file_google_protobuf_descriptor_proto_rawDescData } -var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 18) -var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 33) +var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 20) +var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 34) var file_google_protobuf_descriptor_proto_goTypes = []any{ - (Edition)(0), // 0: google.protobuf.Edition - (ExtensionRangeOptions_VerificationState)(0), // 1: google.protobuf.ExtensionRangeOptions.VerificationState - (FieldDescriptorProto_Type)(0), // 2: google.protobuf.FieldDescriptorProto.Type - (FieldDescriptorProto_Label)(0), // 3: google.protobuf.FieldDescriptorProto.Label - (FileOptions_OptimizeMode)(0), // 4: google.protobuf.FileOptions.OptimizeMode - (FieldOptions_CType)(0), // 5: google.protobuf.FieldOptions.CType - (FieldOptions_JSType)(0), // 6: google.protobuf.FieldOptions.JSType - (FieldOptions_OptionRetention)(0), // 7: google.protobuf.FieldOptions.OptionRetention - (FieldOptions_OptionTargetType)(0), // 8: google.protobuf.FieldOptions.OptionTargetType - (MethodOptions_IdempotencyLevel)(0), // 9: google.protobuf.MethodOptions.IdempotencyLevel - (FeatureSet_FieldPresence)(0), // 10: google.protobuf.FeatureSet.FieldPresence - (FeatureSet_EnumType)(0), // 11: google.protobuf.FeatureSet.EnumType - (FeatureSet_RepeatedFieldEncoding)(0), // 12: google.protobuf.FeatureSet.RepeatedFieldEncoding - (FeatureSet_Utf8Validation)(0), // 13: google.protobuf.FeatureSet.Utf8Validation - (FeatureSet_MessageEncoding)(0), // 14: google.protobuf.FeatureSet.MessageEncoding - (FeatureSet_JsonFormat)(0), // 15: google.protobuf.FeatureSet.JsonFormat - (FeatureSet_EnforceNamingStyle)(0), // 16: google.protobuf.FeatureSet.EnforceNamingStyle - (GeneratedCodeInfo_Annotation_Semantic)(0), // 17: google.protobuf.GeneratedCodeInfo.Annotation.Semantic - (*FileDescriptorSet)(nil), // 18: google.protobuf.FileDescriptorSet - (*FileDescriptorProto)(nil), // 19: google.protobuf.FileDescriptorProto - (*DescriptorProto)(nil), // 20: google.protobuf.DescriptorProto - (*ExtensionRangeOptions)(nil), // 21: google.protobuf.ExtensionRangeOptions - (*FieldDescriptorProto)(nil), // 22: google.protobuf.FieldDescriptorProto - (*OneofDescriptorProto)(nil), // 23: google.protobuf.OneofDescriptorProto - (*EnumDescriptorProto)(nil), // 24: google.protobuf.EnumDescriptorProto - (*EnumValueDescriptorProto)(nil), // 25: google.protobuf.EnumValueDescriptorProto - (*ServiceDescriptorProto)(nil), // 26: google.protobuf.ServiceDescriptorProto - (*MethodDescriptorProto)(nil), // 27: google.protobuf.MethodDescriptorProto - (*FileOptions)(nil), // 28: google.protobuf.FileOptions - (*MessageOptions)(nil), // 29: google.protobuf.MessageOptions - (*FieldOptions)(nil), // 30: google.protobuf.FieldOptions - (*OneofOptions)(nil), // 31: google.protobuf.OneofOptions - (*EnumOptions)(nil), // 32: google.protobuf.EnumOptions - (*EnumValueOptions)(nil), // 33: google.protobuf.EnumValueOptions - (*ServiceOptions)(nil), // 34: google.protobuf.ServiceOptions - (*MethodOptions)(nil), // 35: google.protobuf.MethodOptions - (*UninterpretedOption)(nil), // 36: google.protobuf.UninterpretedOption - (*FeatureSet)(nil), // 37: google.protobuf.FeatureSet - (*FeatureSetDefaults)(nil), // 38: google.protobuf.FeatureSetDefaults - (*SourceCodeInfo)(nil), // 39: google.protobuf.SourceCodeInfo - (*GeneratedCodeInfo)(nil), // 40: google.protobuf.GeneratedCodeInfo - (*DescriptorProto_ExtensionRange)(nil), // 41: google.protobuf.DescriptorProto.ExtensionRange - (*DescriptorProto_ReservedRange)(nil), // 42: google.protobuf.DescriptorProto.ReservedRange - (*ExtensionRangeOptions_Declaration)(nil), // 43: google.protobuf.ExtensionRangeOptions.Declaration - (*EnumDescriptorProto_EnumReservedRange)(nil), // 44: google.protobuf.EnumDescriptorProto.EnumReservedRange - (*FieldOptions_EditionDefault)(nil), // 45: google.protobuf.FieldOptions.EditionDefault - (*FieldOptions_FeatureSupport)(nil), // 46: google.protobuf.FieldOptions.FeatureSupport - (*UninterpretedOption_NamePart)(nil), // 47: google.protobuf.UninterpretedOption.NamePart - (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 48: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - (*SourceCodeInfo_Location)(nil), // 49: google.protobuf.SourceCodeInfo.Location - (*GeneratedCodeInfo_Annotation)(nil), // 50: google.protobuf.GeneratedCodeInfo.Annotation + (Edition)(0), // 0: google.protobuf.Edition + (SymbolVisibility)(0), // 1: google.protobuf.SymbolVisibility + (ExtensionRangeOptions_VerificationState)(0), // 2: google.protobuf.ExtensionRangeOptions.VerificationState + (FieldDescriptorProto_Type)(0), // 3: google.protobuf.FieldDescriptorProto.Type + (FieldDescriptorProto_Label)(0), // 4: google.protobuf.FieldDescriptorProto.Label + (FileOptions_OptimizeMode)(0), // 5: google.protobuf.FileOptions.OptimizeMode + (FieldOptions_CType)(0), // 6: google.protobuf.FieldOptions.CType + (FieldOptions_JSType)(0), // 7: google.protobuf.FieldOptions.JSType + (FieldOptions_OptionRetention)(0), // 8: google.protobuf.FieldOptions.OptionRetention + (FieldOptions_OptionTargetType)(0), // 9: google.protobuf.FieldOptions.OptionTargetType + (MethodOptions_IdempotencyLevel)(0), // 10: google.protobuf.MethodOptions.IdempotencyLevel + (FeatureSet_FieldPresence)(0), // 11: google.protobuf.FeatureSet.FieldPresence + (FeatureSet_EnumType)(0), // 12: google.protobuf.FeatureSet.EnumType + (FeatureSet_RepeatedFieldEncoding)(0), // 13: google.protobuf.FeatureSet.RepeatedFieldEncoding + (FeatureSet_Utf8Validation)(0), // 14: google.protobuf.FeatureSet.Utf8Validation + (FeatureSet_MessageEncoding)(0), // 15: google.protobuf.FeatureSet.MessageEncoding + (FeatureSet_JsonFormat)(0), // 16: google.protobuf.FeatureSet.JsonFormat + (FeatureSet_EnforceNamingStyle)(0), // 17: google.protobuf.FeatureSet.EnforceNamingStyle + (FeatureSet_VisibilityFeature_DefaultSymbolVisibility)(0), // 18: google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + (GeneratedCodeInfo_Annotation_Semantic)(0), // 19: google.protobuf.GeneratedCodeInfo.Annotation.Semantic + (*FileDescriptorSet)(nil), // 20: google.protobuf.FileDescriptorSet + (*FileDescriptorProto)(nil), // 21: google.protobuf.FileDescriptorProto + (*DescriptorProto)(nil), // 22: google.protobuf.DescriptorProto + (*ExtensionRangeOptions)(nil), // 23: google.protobuf.ExtensionRangeOptions + (*FieldDescriptorProto)(nil), // 24: google.protobuf.FieldDescriptorProto + (*OneofDescriptorProto)(nil), // 25: google.protobuf.OneofDescriptorProto + (*EnumDescriptorProto)(nil), // 26: google.protobuf.EnumDescriptorProto + (*EnumValueDescriptorProto)(nil), // 27: google.protobuf.EnumValueDescriptorProto + (*ServiceDescriptorProto)(nil), // 28: google.protobuf.ServiceDescriptorProto + (*MethodDescriptorProto)(nil), // 29: google.protobuf.MethodDescriptorProto + (*FileOptions)(nil), // 30: google.protobuf.FileOptions + (*MessageOptions)(nil), // 31: google.protobuf.MessageOptions + (*FieldOptions)(nil), // 32: google.protobuf.FieldOptions + (*OneofOptions)(nil), // 33: google.protobuf.OneofOptions + (*EnumOptions)(nil), // 34: google.protobuf.EnumOptions + (*EnumValueOptions)(nil), // 35: google.protobuf.EnumValueOptions + (*ServiceOptions)(nil), // 36: google.protobuf.ServiceOptions + (*MethodOptions)(nil), // 37: google.protobuf.MethodOptions + (*UninterpretedOption)(nil), // 38: google.protobuf.UninterpretedOption + (*FeatureSet)(nil), // 39: google.protobuf.FeatureSet + (*FeatureSetDefaults)(nil), // 40: google.protobuf.FeatureSetDefaults + (*SourceCodeInfo)(nil), // 41: google.protobuf.SourceCodeInfo + (*GeneratedCodeInfo)(nil), // 42: google.protobuf.GeneratedCodeInfo + (*DescriptorProto_ExtensionRange)(nil), // 43: google.protobuf.DescriptorProto.ExtensionRange + (*DescriptorProto_ReservedRange)(nil), // 44: google.protobuf.DescriptorProto.ReservedRange + (*ExtensionRangeOptions_Declaration)(nil), // 45: google.protobuf.ExtensionRangeOptions.Declaration + (*EnumDescriptorProto_EnumReservedRange)(nil), // 46: google.protobuf.EnumDescriptorProto.EnumReservedRange + (*FieldOptions_EditionDefault)(nil), // 47: google.protobuf.FieldOptions.EditionDefault + (*FieldOptions_FeatureSupport)(nil), // 48: google.protobuf.FieldOptions.FeatureSupport + (*UninterpretedOption_NamePart)(nil), // 49: google.protobuf.UninterpretedOption.NamePart + (*FeatureSet_VisibilityFeature)(nil), // 50: google.protobuf.FeatureSet.VisibilityFeature + (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 51: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + (*SourceCodeInfo_Location)(nil), // 52: google.protobuf.SourceCodeInfo.Location + (*GeneratedCodeInfo_Annotation)(nil), // 53: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ - 19, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto - 20, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto - 24, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 26, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto - 22, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 28, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions - 39, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo + 21, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto + 22, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto + 26, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 28, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto + 24, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 30, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions + 41, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo 0, // 7: google.protobuf.FileDescriptorProto.edition:type_name -> google.protobuf.Edition - 22, // 8: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto - 22, // 9: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 20, // 10: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto - 24, // 11: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 41, // 12: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange - 23, // 13: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto - 29, // 14: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions - 42, // 15: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange - 36, // 16: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 43, // 17: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration - 37, // 18: google.protobuf.ExtensionRangeOptions.features:type_name -> google.protobuf.FeatureSet - 1, // 19: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState - 3, // 20: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label - 2, // 21: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type - 30, // 22: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions - 31, // 23: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions - 25, // 24: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto - 32, // 25: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions - 44, // 26: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange - 33, // 27: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions - 27, // 28: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto - 34, // 29: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions - 35, // 30: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions - 4, // 31: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode - 37, // 32: google.protobuf.FileOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 33: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 37, // 34: google.protobuf.MessageOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 35: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 5, // 36: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType - 6, // 37: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType - 7, // 38: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention - 8, // 39: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType - 45, // 40: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault - 37, // 41: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet - 46, // 42: google.protobuf.FieldOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport - 36, // 43: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 37, // 44: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 45: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 37, // 46: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 47: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 37, // 48: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet - 46, // 49: google.protobuf.EnumValueOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport - 36, // 50: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 37, // 51: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 52: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 9, // 53: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel - 37, // 54: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet - 36, // 55: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 47, // 56: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart - 10, // 57: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence - 11, // 58: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType - 12, // 59: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding - 13, // 60: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation - 14, // 61: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding - 15, // 62: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat - 16, // 63: google.protobuf.FeatureSet.enforce_naming_style:type_name -> google.protobuf.FeatureSet.EnforceNamingStyle - 48, // 64: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - 0, // 65: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition - 0, // 66: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition - 49, // 67: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location - 50, // 68: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation - 21, // 69: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions - 0, // 70: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition - 0, // 71: google.protobuf.FieldOptions.FeatureSupport.edition_introduced:type_name -> google.protobuf.Edition - 0, // 72: google.protobuf.FieldOptions.FeatureSupport.edition_deprecated:type_name -> google.protobuf.Edition - 0, // 73: google.protobuf.FieldOptions.FeatureSupport.edition_removed:type_name -> google.protobuf.Edition - 0, // 74: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition - 37, // 75: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features:type_name -> google.protobuf.FeatureSet - 37, // 76: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features:type_name -> google.protobuf.FeatureSet - 17, // 77: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic - 78, // [78:78] is the sub-list for method output_type - 78, // [78:78] is the sub-list for method input_type - 78, // [78:78] is the sub-list for extension type_name - 78, // [78:78] is the sub-list for extension extendee - 0, // [0:78] is the sub-list for field type_name + 24, // 8: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto + 24, // 9: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 22, // 10: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto + 26, // 11: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 43, // 12: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange + 25, // 13: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto + 31, // 14: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions + 44, // 15: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange + 1, // 16: google.protobuf.DescriptorProto.visibility:type_name -> google.protobuf.SymbolVisibility + 38, // 17: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 45, // 18: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration + 39, // 19: google.protobuf.ExtensionRangeOptions.features:type_name -> google.protobuf.FeatureSet + 2, // 20: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState + 4, // 21: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label + 3, // 22: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type + 32, // 23: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions + 33, // 24: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions + 27, // 25: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto + 34, // 26: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions + 46, // 27: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange + 1, // 28: google.protobuf.EnumDescriptorProto.visibility:type_name -> google.protobuf.SymbolVisibility + 35, // 29: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions + 29, // 30: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto + 36, // 31: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions + 37, // 32: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions + 5, // 33: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode + 39, // 34: google.protobuf.FileOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 35: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 39, // 36: google.protobuf.MessageOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 37: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 6, // 38: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType + 7, // 39: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType + 8, // 40: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention + 9, // 41: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType + 47, // 42: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault + 39, // 43: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet + 48, // 44: google.protobuf.FieldOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport + 38, // 45: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 39, // 46: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 47: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 39, // 48: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 49: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 39, // 50: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet + 48, // 51: google.protobuf.EnumValueOptions.feature_support:type_name -> google.protobuf.FieldOptions.FeatureSupport + 38, // 52: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 39, // 53: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 54: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 10, // 55: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel + 39, // 56: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet + 38, // 57: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 49, // 58: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart + 11, // 59: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence + 12, // 60: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType + 13, // 61: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding + 14, // 62: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation + 15, // 63: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding + 16, // 64: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat + 17, // 65: google.protobuf.FeatureSet.enforce_naming_style:type_name -> google.protobuf.FeatureSet.EnforceNamingStyle + 18, // 66: google.protobuf.FeatureSet.default_symbol_visibility:type_name -> google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + 51, // 67: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + 0, // 68: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition + 0, // 69: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition + 52, // 70: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location + 53, // 71: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation + 23, // 72: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions + 0, // 73: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition + 0, // 74: google.protobuf.FieldOptions.FeatureSupport.edition_introduced:type_name -> google.protobuf.Edition + 0, // 75: google.protobuf.FieldOptions.FeatureSupport.edition_deprecated:type_name -> google.protobuf.Edition + 0, // 76: google.protobuf.FieldOptions.FeatureSupport.edition_removed:type_name -> google.protobuf.Edition + 0, // 77: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition + 39, // 78: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridable_features:type_name -> google.protobuf.FeatureSet + 39, // 79: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixed_features:type_name -> google.protobuf.FeatureSet + 19, // 80: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic + 81, // [81:81] is the sub-list for method output_type + 81, // [81:81] is the sub-list for method input_type + 81, // [81:81] is the sub-list for extension type_name + 81, // [81:81] is the sub-list for extension extendee + 0, // [0:81] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } @@ -4983,8 +5227,8 @@ func file_google_protobuf_descriptor_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_google_protobuf_descriptor_proto_rawDesc), len(file_google_protobuf_descriptor_proto_rawDesc)), - NumEnums: 18, - NumMessages: 33, + NumEnums: 20, + NumMessages: 34, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go index 06d584c14b..484c21fd53 100644 --- a/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/timestamppb/timestamp.pb.go @@ -172,13 +172,14 @@ import ( // ) to obtain a formatter capable of generating timestamps in this format. type Timestamp struct { state protoimpl.MessageState `protogen:"open.v1"` - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. + // Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must + // be between -315576000000 and 315576000000 inclusive (which corresponds to + // 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z). Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 + // Non-negative fractions of a second at nanosecond resolution. This field is + // the nanosecond portion of the duration, not an alternative to seconds. + // Negative second values with fractions must still have non-negative nanos + // values that count forward in time. Must be between 0 and 999,999,999 // inclusive. Nanos int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"` unknownFields protoimpl.UnknownFields diff --git a/vendor/kmodules.xyz/client-go/Makefile b/vendor/kmodules.xyz/client-go/Makefile index 0d1f72430c..e1ae452026 100644 --- a/vendor/kmodules.xyz/client-go/Makefile +++ b/vendor/kmodules.xyz/client-go/Makefile @@ -19,11 +19,11 @@ REPO := $(notdir $(shell pwd)) BIN := client-go # https://github.com/appscodelabs/gengo-builder -CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.32 +CODE_GENERATOR_IMAGE ?= ghcr.io/appscode/gengo:release-1.34 # This version-strategy uses git tags to set the version string git_branch := $(shell git rev-parse --abbrev-ref HEAD) -git_tag := $(shell git describe --exact-match --abbrev=0 2>/dev/null || echo "") +git_tag := $(shell git describe --tags --exact-match --abbrev=0 2>/dev/null || echo "") commit_hash := $(shell git rev-parse --verify HEAD) commit_timestamp := $(shell date --date="@$$(git show -s --format=%ct)" --utc +%FT%T) @@ -114,8 +114,8 @@ clientset: $(CODE_GENERATOR_IMAGE) \ deepcopy-gen \ --go-header-file "./hack/license/go.txt" \ - --input-dirs "$(GO_PKG)/$(REPO)/api/v1" \ - --output-file-base zz_generated.deepcopy + --output-file zz_generated.deepcopy.go \ + $(GO_PKG)/$(REPO)/api/v1 # Generate openapi schema .PHONY: openapi @@ -132,9 +132,11 @@ openapi: openapi-gen \ --v 1 --logtostderr \ --go-header-file "./hack/license/go.txt" \ - --input-dirs "$(GO_PKG)/$(REPO)/api/v1" \ - --output-package "$(GO_PKG)/$(REPO)/api/v1" \ - --report-filename /tmp/violation_exceptions.list + --output-dir "$(DOCKER_REPO_ROOT)/api/v1" \ + --output-pkg "$(GO_PKG)/$(REPO)/api/v1" \ + --output-file "openapi_generated.go" \ + --report-filename /tmp/violation_exceptions.list \ + $(GO_PKG)/$(REPO)/api/v1 .PHONY: gen-crd-protos gen-crd-protos: diff --git a/vendor/kmodules.xyz/client-go/api/v1/openapi_generated.go b/vendor/kmodules.xyz/client-go/api/v1/openapi_generated.go index e33f37561e..26e0f99637 100644 --- a/vendor/kmodules.xyz/client-go/api/v1/openapi_generated.go +++ b/vendor/kmodules.xyz/client-go/api/v1/openapi_generated.go @@ -19,8 +19,6 @@ limitations under the License. // Code generated by openapi-gen. DO NOT EDIT. -// This file was autogenerated by openapi-gen. Do not edit it manually! - package v1 import ( @@ -30,8 +28,12 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ + "kmodules.xyz/client-go/api/v1.CAPIClusterInfo": schema_kmodulesxyz_client_go_api_v1_CAPIClusterInfo(ref), "kmodules.xyz/client-go/api/v1.CertificatePrivateKey": schema_kmodulesxyz_client_go_api_v1_CertificatePrivateKey(ref), "kmodules.xyz/client-go/api/v1.CertificateSpec": schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref), + "kmodules.xyz/client-go/api/v1.ClusterClaimFeatures": schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref), + "kmodules.xyz/client-go/api/v1.ClusterClaimInfo": schema_kmodulesxyz_client_go_api_v1_ClusterClaimInfo(ref), + "kmodules.xyz/client-go/api/v1.ClusterInfo": schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref), "kmodules.xyz/client-go/api/v1.ClusterMetadata": schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref), "kmodules.xyz/client-go/api/v1.Condition": schema_kmodulesxyz_client_go_api_v1_Condition(ref), "kmodules.xyz/client-go/api/v1.HealthCheckSpec": schema_kmodulesxyz_client_go_api_v1_HealthCheckSpec(ref), @@ -45,12 +47,47 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kmodules.xyz/client-go/api/v1.ResourceID": schema_kmodulesxyz_client_go_api_v1_ResourceID(ref), "kmodules.xyz/client-go/api/v1.TLSConfig": schema_kmodulesxyz_client_go_api_v1_TLSConfig(ref), "kmodules.xyz/client-go/api/v1.TimeOfDay": schema_kmodulesxyz_client_go_api_v1_TimeOfDay(ref), + "kmodules.xyz/client-go/api/v1.TypeReference": schema_kmodulesxyz_client_go_api_v1_TypeReference(ref), "kmodules.xyz/client-go/api/v1.TypedObjectReference": schema_kmodulesxyz_client_go_api_v1_TypedObjectReference(ref), "kmodules.xyz/client-go/api/v1.X509Subject": schema_kmodulesxyz_client_go_api_v1_X509Subject(ref), "kmodules.xyz/client-go/api/v1.stringSetMerger": schema_kmodulesxyz_client_go_api_v1_stringSetMerger(ref), } } +func schema_kmodulesxyz_client_go_api_v1_CAPIClusterInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "provider": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "clusterName": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"provider", "namespace", "clusterName"}, + }, + }, + } +} + func schema_kmodulesxyz_client_go_api_v1_CertificatePrivateKey(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -112,7 +149,7 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal }, "renewBefore": { SchemaProps: spec.SchemaProps{ - Description: "Certificate renew before expiration duration", + Description: "Certificate renew before expiration duration\n\nDeprecated use `ReconfigureTLS` type OpsRequest instead.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -191,6 +228,131 @@ func schema_kmodulesxyz_client_go_api_v1_CertificateSpec(ref common.ReferenceCal } } +func schema_kmodulesxyz_client_go_api_v1_ClusterClaimFeatures(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabledFeatures": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "externallyManagedFeatures": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "disabledFeatures": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_kmodulesxyz_client_go_api_v1_ClusterClaimInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterMetadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.ClusterInfo"), + }, + }, + }, + Required: []string{"clusterMetadata"}, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.ClusterInfo"}, + } +} + +func schema_kmodulesxyz_client_go_api_v1_ClusterInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterInfo used in ace-installer", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "clusterManagers": { + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "capi": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kmodules.xyz/client-go/api/v1.CAPIClusterInfo"), + }, + }, + }, + Required: []string{"uid", "name", "clusterManagers"}, + }, + }, + Dependencies: []string{ + "kmodules.xyz/client-go/api/v1.CAPIClusterInfo"}, + } +} + func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -222,6 +384,54 @@ func schema_kmodulesxyz_client_go_api_v1_ClusterMetadata(ref common.ReferenceCal Format: "", }, }, + "ownerID": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "ownerType": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "apiEndpoint": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "caBundle": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "managerID": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "hubClusterID": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "cloudServiceAuthMode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "mode": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"uid"}, }, @@ -269,7 +479,6 @@ func schema_kmodulesxyz_client_go_api_v1_Condition(ref common.ReferenceCallback) "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "Last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", - Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -678,11 +887,36 @@ func schema_kmodulesxyz_client_go_api_v1_TimeOfDay(ref common.ReferenceCallback) } } +func schema_kmodulesxyz_client_go_api_v1_TypeReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "TypeReference represents an object type.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiGroup": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_kmodulesxyz_client_go_api_v1_TypedObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "TypedObjectReference represents an typed namespaced object.", + Description: "TypedObjectReference represents a typed namespaced object.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "apiGroup": { diff --git a/vendor/kmodules.xyz/client-go/client/delegated.go b/vendor/kmodules.xyz/client-go/client/delegated.go index 6a4c4eca76..b1a1364e96 100644 --- a/vendor/kmodules.xyz/client-go/client/delegated.go +++ b/vendor/kmodules.xyz/client-go/client/delegated.go @@ -100,13 +100,38 @@ func (d *DelegatingClient) RestConfig() *restclient.Config { return d.config } +// aceExtraPrefix is the only extra-key namespace impersonated identities carry +// through. See impersonableExtra. +const aceExtraPrefix = "ace.appscode.com/" + +// impersonableExtra keeps only the ACE extras. Every other extra key is provider +// bookkeeping injected by the apiserver or the platform -- Rancher's principalid, +// EKS' arn, the reserved authentication.kubernetes.io/* keys -- and impersonating +// any of them needs an `impersonate` grant on userextras/ that callers do not +// hold, which fails the whole request during impersonation authorization. RBAC +// ignores extras, so dropping them changes no authorization decision. +func impersonableExtra(in map[string][]string) map[string][]string { + out := make(map[string][]string, len(in)) + for k, v := range in { + if strings.HasPrefix(k, aceExtraPrefix) { + out[k] = v + } + } + if len(out) == 0 { + return nil + } + return out +} + func (d *DelegatingClient) Impersonate(u user.Info) (*restclient.Config, client.Client, error) { + extra := impersonableExtra(u.GetExtra()) + config := restclient.CopyConfig(d.config) config.Impersonate = restclient.ImpersonationConfig{ UserName: u.GetName(), UID: u.GetUID(), Groups: u.GetGroups(), - Extra: u.GetExtra(), + Extra: extra, } // share the transport between all clients @@ -117,7 +142,7 @@ func (d *DelegatingClient) Impersonate(u user.Info) (*restclient.Config, client. UserName: u.GetName(), UID: u.GetUID(), Groups: u.GetGroups(), - Extra: u.GetExtra(), + Extra: extra, }, d.options.HTTPClient.Transport), } } diff --git a/vendor/kmodules.xyz/client-go/cluster/ocm.go b/vendor/kmodules.xyz/client-go/cluster/ocm.go index 755270809e..afcd1c6c37 100644 --- a/vendor/kmodules.xyz/client-go/cluster/ocm.go +++ b/vendor/kmodules.xyz/client-go/cluster/ocm.go @@ -50,8 +50,9 @@ func IsOpenClusterSpoke(kc client.Reader) bool { err := kc.List(context.TODO(), &list) if err != nil { if !meta.IsNoMatchError(err) && !apierrors.IsNotFound(err) { - panic(err) // panic if 403 (missing rbac) + klog.Errorln(err) // eg, 403 (missing rbac) } + return false } return len(list.Items) > 0 } diff --git a/vendor/kmodules.xyz/client-go/cluster/openshift.go b/vendor/kmodules.xyz/client-go/cluster/openshift.go index 1aa4996461..22c1b6ef99 100644 --- a/vendor/kmodules.xyz/client-go/cluster/openshift.go +++ b/vendor/kmodules.xyz/client-go/cluster/openshift.go @@ -17,8 +17,25 @@ limitations under the License. package cluster import ( + "context" + "fmt" + + core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + OpenShiftClusterMonitoringNamespace = "openshift-monitoring" + OpenShiftClusterPrometheus = "k8s" + OpenShiftClusterAlertmanager = "main" + OpenShiftThanosQuerierService = "thanos-querier" + + OpenShiftUserWorkloadMonitoringNamespace = "openshift-user-workload-monitoring" + OpenShiftUserWorkloadPrometheus = "user-workload" + OpenShiftUserWorkloadAlertmanager = "user-workload" ) func IsOpenShiftManaged(mapper meta.RESTMapper) bool { @@ -30,3 +47,32 @@ func IsOpenShiftManaged(mapper meta.RESTMapper) bool { } return false } + +// GetOpenShiftAppsDomain fetches the default *.apps.. domain for OpenShift +func GetOpenShiftAppsDomain(kc client.Client) (string, error) { + var ing unstructured.Unstructured + ing.SetAPIVersion("operator.openshift.io/v1") + ing.SetKind("IngressController") + key := client.ObjectKey{Namespace: "openshift-ingress-operator", Name: "default"} + if err := kc.Get(context.Background(), key, &ing); err != nil { + return "", err + } + domain, found, err := unstructured.NestedString(ing.Object, "status", "domain") + if err != nil { + return "", err + } + if !found || domain == "" { + return "", fmt.Errorf("status.domain not found in IngressController") + } + return domain, nil +} + +// GetOpenShiftServiceSigner fetches the OpenShift service signer CA certificate +func GetOpenShiftServiceSigner(kc client.Client) ([]byte, error) { + var cm core.ConfigMap + err := kc.Get(context.TODO(), client.ObjectKey{Namespace: "kube-public", Name: "openshift-service-ca.crt"}, &cm) + if err != nil { + return nil, err + } + return []byte(cm.Data["service-ca.crt"]), nil +} diff --git a/vendor/kmodules.xyz/client-go/discovery/lib.go b/vendor/kmodules.xyz/client-go/discovery/lib.go index dd425b63c8..8005043618 100644 --- a/vendor/kmodules.xyz/client-go/discovery/lib.go +++ b/vendor/kmodules.xyz/client-go/discovery/lib.go @@ -223,7 +223,8 @@ func IsDefaultSupportedVersion(kc kubernetes.Interface) error { kc, DefaultConstraint, DefaultBlackListedVersions, - DefaultBlackListedMultiMasterVersions) + DefaultBlackListedMultiMasterVersions, + ) } func IsSupportedVersion(kc kubernetes.Interface, constraint string, blackListedVersions map[string]error, blackListedMultiMasterVersions map[string]error) error { diff --git a/vendor/kmodules.xyz/client-go/gentype/fake.go b/vendor/kmodules.xyz/client-go/gentype/fake.go new file mode 100644 index 0000000000..655abe14d2 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/gentype/fake.go @@ -0,0 +1,55 @@ +/* +Copyright AppsCode Inc. and Contributors + +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 gentype + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/testing" +) + +// FakeClient represents a fake create-only client for a runtime.Object type +// with no real persisted identity, matching Client's shape. +type FakeClient[T runtime.Object] struct { + *testing.Fake + ns string + resource schema.GroupVersionResource + kind schema.GroupVersionKind + newObject func() T +} + +// NewFakeClient constructs a fake create-only client, namespaced or not. +// Non-namespaced clients are constructed by passing an empty namespace (""). +func NewFakeClient[T runtime.Object]( + fake *testing.Fake, namespace string, resource schema.GroupVersionResource, kind schema.GroupVersionKind, emptyObjectCreator func() T, +) *FakeClient[T] { + return &FakeClient[T]{fake, namespace, resource, kind, emptyObjectCreator} +} + +// Create takes the representation of a resource and creates it. Returns the +// server's representation of the resource, and an error, if there is any. +func (c *FakeClient[T]) Create(ctx context.Context, resource T, opts metav1.CreateOptions) (result T, err error) { + emptyResult := c.newObject() + obj, err := c.Invokes(testing.NewCreateActionWithOptions(c.resource, c.ns, resource, opts), emptyResult) + if obj == nil { + return emptyResult, err + } + return obj.(T), err +} diff --git a/vendor/kmodules.xyz/client-go/gentype/type.go b/vendor/kmodules.xyz/client-go/gentype/type.go new file mode 100644 index 0000000000..dbbe666481 --- /dev/null +++ b/vendor/kmodules.xyz/client-go/gentype/type.go @@ -0,0 +1,113 @@ +/* +Copyright AppsCode Inc. and Contributors + +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 gentype provides a generic, create-only client-go typed client +// for API types that are not real stored Kubernetes objects -- request/ +// response "action" payloads (e.g. an aggregated-apiserver endpoint that +// only ever accepts POST) which have no metav1.ObjectMeta and thus no real +// identity, labels, owner references, etc. +// +// k8s.io/client-go/gentype's Client[T] (which every generated client built +// since https://github.com/kubernetes/kubernetes/pull/121439 embeds) +// requires its type parameter to implement metav1.Object, even when the +// generated client only ever exposes Create -- Client[T].Create doesn't +// call any metav1.Object method on T, but the constraint is declared on the +// whole generic struct rather than per-method, so every type needs it +// regardless of which verbs its generated client actually has. +// +// This package provides the same shape (Client, NewClient, Option, +// PrefersProtobuf) but constrained to plain runtime.Object, for use by +// kmodules/code-generator's client-gen when it detects a +genclient type +// that is both create-only (+genclient:onlyVerbs=create, no other verb) and +// has no metav1.ObjectMeta member -- see cmd/client-gen/generators/util. +// IsCreateOnly/HasObjectMeta in that fork. Get/List/Update/Delete/Watch/ +// Patch/Apply all need real object identity and have no equivalent here; +// a type needing any of those must have a real metav1.ObjectMeta and use +// k8s.io/client-go/gentype directly instead. +package gentype + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/rest" +) + +// Client represents a create-only client, optionally namespaced, for a +// runtime.Object type with no real persisted identity. +type Client[T runtime.Object] struct { + resource string + client rest.Interface + namespace string // "" for non-namespaced clients + newObject func() T + parameterCodec runtime.ParameterCodec + + prefersProtobuf bool +} + +// Option configures a Client. +type Option[T runtime.Object] func(*Client[T]) + +// PrefersProtobuf marks the client as preferring protobuf, matching +// k8s.io/client-go/gentype.PrefersProtobuf. +func PrefersProtobuf[T runtime.Object]() Option[T] { + return func(c *Client[T]) { c.prefersProtobuf = true } +} + +// NewClient constructs a create-only client, namespaced or not. Non- +// namespaced clients are constructed by passing an empty namespace (""). +func NewClient[T runtime.Object]( + resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T, + options ...Option[T], +) *Client[T] { + c := &Client[T]{ + resource: resource, + client: client, + parameterCodec: parameterCodec, + namespace: namespace, + newObject: emptyObjectCreator, + } + for _, option := range options { + option(c) + } + return c +} + +// GetClient returns the REST interface. +func (c *Client[T]) GetClient() rest.Interface { + return c.client +} + +// GetNamespace returns the client's namespace, if any. +func (c *Client[T]) GetNamespace() string { + return c.namespace +} + +// Create takes the representation of a resource and creates it. Returns the +// server's representation of the resource, and an error, if there is any. +func (c *Client[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions) (T, error) { + result := c.newObject() + err := c.client.Post(). + UseProtobufAsDefaultIfPreferred(c.prefersProtobuf). + NamespaceIfScoped(c.namespace, c.namespace != ""). + Resource(c.resource). + VersionedParams(&opts, c.parameterCodec). + Body(obj). + Do(ctx). + Into(result) + return result, err +} diff --git a/vendor/kmodules.xyz/client-go/meta/labels.go b/vendor/kmodules.xyz/client-go/meta/labels.go index 41b1bc21cb..72c7208e78 100644 --- a/vendor/kmodules.xyz/client-go/meta/labels.go +++ b/vendor/kmodules.xyz/client-go/meta/labels.go @@ -16,31 +16,42 @@ limitations under the License. package meta -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +import ( + "maps" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) func LabelsForLabelSelector(sel *metav1.LabelSelector) (map[string]string, bool) { - if sel != nil { - if len(sel.MatchExpressions) > 0 { - expr := sel.MatchExpressions[0] - switch expr.Operator { - case metav1.LabelSelectorOpIn: - return map[string]string{ - expr.Key: expr.Values[0], - }, false - case metav1.LabelSelectorOpNotIn: - return map[string]string{ - expr.Key: "not-" + expr.Values[0], - }, false - case metav1.LabelSelectorOpExists: - return map[string]string{ - expr.Key: "", - }, false - case metav1.LabelSelectorOpDoesNotExist: - return make(map[string]string), false + if sel == nil { + return make(map[string]string), true + } + + labels := make(map[string]string, len(sel.MatchLabels)+len(sel.MatchExpressions)) + maps.Copy(labels, sel.MatchLabels) + + for _, expr := range sel.MatchExpressions { + switch expr.Operator { + case metav1.LabelSelectorOpIn: + if len(expr.Values) > 0 { + labels[expr.Key] = expr.Values[0] + } + case metav1.LabelSelectorOpNotIn: + if len(expr.Values) > 0 { + v := expr.Values[0] + if v == "true" && len(expr.Values) == 1 { + labels[expr.Key] = "false" + } else if v == "false" && len(expr.Values) == 1 { + labels[expr.Key] = "true" + } else { + labels[expr.Key] = "not-" + v + } } - } else { - return sel.MatchLabels, true + case metav1.LabelSelectorOpExists: + labels[expr.Key] = "" + case metav1.LabelSelectorOpDoesNotExist: + delete(labels, expr.Key) } } - return make(map[string]string), true + return labels, len(sel.MatchExpressions) == 0 } diff --git a/vendor/kmodules.xyz/client-go/meta/preconditions.go b/vendor/kmodules.xyz/client-go/meta/preconditions.go index 5dddddb481..cf7d673d5d 100644 --- a/vendor/kmodules.xyz/client-go/meta/preconditions.go +++ b/vendor/kmodules.xyz/client-go/meta/preconditions.go @@ -37,7 +37,8 @@ func (s PreConditionSet) PreconditionFunc() []mergepatch.PreconditionFunc { } for _, field := range sets.List[string](s.Set) { - preconditions = append(preconditions, + preconditions = append( + preconditions, RequireChainKeyUnchanged(field), ) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 02d48c106b..0f00a5adf7 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -318,13 +318,13 @@ go.yaml.in/yaml/v2 # go.yaml.in/yaml/v3 v3.0.4 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/crypto v0.52.0 +# golang.org/x/crypto v0.55.0 ## explicit; go 1.25.0 golang.org/x/crypto/bcrypt golang.org/x/crypto/blowfish golang.org/x/crypto/pbkdf2 golang.org/x/crypto/scrypt -# golang.org/x/net v0.55.0 +# golang.org/x/net v0.57.0 ## explicit; go 1.25.0 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -335,22 +335,22 @@ golang.org/x/net/internal/httpsfv golang.org/x/net/internal/socks golang.org/x/net/proxy golang.org/x/net/publicsuffix -# golang.org/x/oauth2 v0.33.0 -## explicit; go 1.24.0 +# golang.org/x/oauth2 v0.36.0 +## explicit; go 1.25.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.20.0 +# golang.org/x/sync v0.22.0 ## explicit; go 1.25.0 golang.org/x/sync/errgroup -# golang.org/x/sys v0.45.0 +# golang.org/x/sys v0.47.0 ## explicit; go 1.25.0 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.43.0 +# golang.org/x/term v0.45.0 ## explicit; go 1.25.0 golang.org/x/term -# golang.org/x/text v0.37.0 +# golang.org/x/text v0.41.0 ## explicit; go 1.25.0 golang.org/x/text/cases golang.org/x/text/internal @@ -390,8 +390,8 @@ gomodules.xyz/sets ## explicit; go 1.25.0 gomodules.xyz/x/ioutil gomodules.xyz/x/version -# google.golang.org/protobuf v1.36.6 -## explicit; go 1.22 +# google.golang.org/protobuf v1.36.11 +## explicit; go 1.23 google.golang.org/protobuf/encoding/protodelim google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire @@ -890,8 +890,8 @@ k8s.io/utils/trace # kmodules.xyz/apiversion v0.2.0 ## explicit; go 1.14 kmodules.xyz/apiversion -# kmodules.xyz/client-go v0.34.3 -## explicit; go 1.24.0 +# kmodules.xyz/client-go v0.34.6 +## explicit; go 1.25.0 kmodules.xyz/client-go kmodules.xyz/client-go/api/v1 kmodules.xyz/client-go/apiextensions @@ -901,6 +901,7 @@ kmodules.xyz/client-go/client/apiutil kmodules.xyz/client-go/cluster kmodules.xyz/client-go/core/v1 kmodules.xyz/client-go/discovery +kmodules.xyz/client-go/gentype kmodules.xyz/client-go/meta kmodules.xyz/client-go/tools/clusterid kmodules.xyz/client-go/tools/parser