Compare commits

..

50 Commits

Author SHA1 Message Date
Kubernetes Publisher
79a7334678 Update dependencies to v0.32.0-alpha.3 tag 2024-10-29 22:50:53 +00:00
Kubernetes Publisher
a887e579c0 Merge pull request #128323 from benluddy/cbor-client-gen
KEP-4222: Support CBOR for generated clients based on client-go feature gating.

Kubernetes-commit: 30ee35516b10120590bcc35ee8b4d8113493ddee
2024-10-29 17:46:14 +00:00
Ben Luddy
886262a3de Update vendor (client now calls ParseAccept from goautoneg).
Kubernetes-commit: 969357b99cd09d47d8a2d7073287f7316f3e6239
2024-10-28 11:22:59 -04:00
Ben Luddy
c957b59518 Wire client feature gates affecting RESTClient content config.
Kubernetes-commit: 67b9dc1f3e23529804345deea76d36d07dff59b1
2024-10-25 11:50:01 -04:00
Ben Luddy
9d19c65cdb Update generated clients.
Kubernetes-commit: 8fb9622b882496dad1e91103dd15fff7fc2658e0
2024-10-24 16:50:48 -04:00
Ben Luddy
d8fc5bb524 Make generated client codecs support CBOR based on feature gate.
Kubernetes-commit: 57e337dbbf9e437bcb350d6551689669bb79d579
2024-10-24 16:38:45 -04:00
Kubernetes Publisher
3dc7fd5f4c Merge pull request #128243 from benluddy/cbor-dynamic-integration
KEP-4222: Add CBOR variant of admission webhook integration test.

Kubernetes-commit: 5147eebf224ae41892b736179ca91c47fd794565
2024-10-25 01:56:21 +00:00
Kubernetes Publisher
abe0e99c21 Merge pull request #125314 from enj/enj/i/proto_for_core
Use protobuf for core clients

Kubernetes-commit: 7b7a7968d4c90c4430b1009546e13ce78bcde134
2024-10-24 17:56:17 +00:00
Ben Luddy
1cca19dc02 Add test-only client feature gates for CBOR.
As with the apiserver feature gate for CBOR as a serving and storage encoding, the client feature
gates for CBOR are being initially added through a test-only feature gate instance that is not wired
to environment variables or to command-line flags and is intended only to be enabled
programmatically from integration tests. The test-only instance will be removed as part of alpha
graduation and replaced by conventional client feature gating.

Kubernetes-commit: ea13190d8bd3a4bb3e82055b529aa7599ae5c6e1
2024-10-23 16:36:37 -04:00
Monis Khan
86e81b0a37 Generated
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 032e7f1556c74dbc25b5ed9368b2e86e26ba774f
2024-10-23 15:33:57 +00:00
Monis Khan
6f44458e5e Use protobuf for core clients
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: c2ae465355b5222dbc27b8de8c55095b4f1b431a
2024-08-19 10:37:15 -04:00
Monis Khan
1647efd5c4 client-go/rest: move content type wiring from client to request
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: fe1eda0649fdb6a15200d279be214c67246d3b12
2024-08-18 15:01:57 -04:00
Kubernetes Publisher
c5146a9031 Merge pull request #126697 from fedebongio/patch-1
Update OWNERS file in client-go/tools/leaderelection adding jefftree

Kubernetes-commit: 16dca1c330392f26f3421fd4cd7ee3d691b93213
2024-10-23 06:07:56 +00:00
Kubernetes Publisher
f05f3ca8bc Merge pull request #125516 from ComingCL/master
fix typo errors in client-go rest package

Kubernetes-commit: 367e7e889b993cedc5f775fba9782010f7219fc9
2024-10-23 01:56:27 +00:00
Federico Bongiovanni
65ed08a834 Update OWNERS
Adding  jefftree also to the reviewers list

Kubernetes-commit: 5f052ada19c43471bdcbb6da4e6f72405ca46bd7
2024-10-22 16:26:30 -07:00
Kubernetes Publisher
23900f4929 Merge pull request #128165 from liggitt/prune-self-require
Drop self-referencing replace directives

Kubernetes-commit: a8fc7ae761c19ab436cf513c9eed877f08961cf7
2024-10-18 04:29:40 +00:00
Kubernetes Publisher
6a276b2b95 Merge pull request #128003 from pohly/dra-classic-dra-removal
DRA: remove "classic DRA"

Kubernetes-commit: b1b4e5d397e303cf7a2a3fb02e90f40536da5896
2024-10-18 00:29:00 +00:00
Jordan Liggitt
607869c7d9 Drop self-referencing replace directives
Kubernetes-commit: 3be1109829d4b0921972bb8b5f66a4d179ff6255
2024-10-17 15:51:15 -04:00
Patrick Ohly
d366fa7737 DRA: remove "classic DRA"
This removes the DRAControlPlaneController feature gate, the fields controlled
by it (claim.spec.controller, claim.status.deallocationRequested,
claim.status.allocation.controller, class.spec.suitableNodes), the
PodSchedulingContext type, and all code related to the feature.

The feature gets removed because there is no path towards beta and GA and DRA
with "structured parameters" should be able to replace it.

Kubernetes-commit: f84eb5ecf894fa0fc4e0d05da52ef51d4cd723d9
2024-10-11 16:08:54 +02:00
Kubernetes Publisher
235936510e Merge pull request #128064 from dims/update-to-last-versions-of-some-very-infrequently-updated-repos
Update to last versions of some very infrequently updated repos

Kubernetes-commit: 07e73682b9a5259cacac978346ed4567588e4165
2024-10-16 06:00:06 +00:00
Kubernetes Publisher
43e9ea4bb5 Merge pull request #124059 from benluddy/dynamic-client-negotiation
Use content negotiation in the dynamic client.

Kubernetes-commit: c360a2c75c6e2a6a66bc5c6d37b30a4171b408da
2024-10-15 18:23:03 +01:00
Davanum Srinivas
e4db112974 Update to last versions of some very infrequently updated repos
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 7f8210e33f8cd626d1fb86cd7d12d077ec3047d5
2024-10-14 17:23:16 -04:00
Federico Bongiovanni
29ce700614 Update staging/src/k8s.io/client-go/tools/leaderelection/OWNERS
Co-authored-by: Benjamin Elder <bentheelder@google.com>

Kubernetes-commit: d20bc10645e716034e91d365d17d8b1011d3f1cd
2024-08-14 13:21:52 -07:00
Federico Bongiovanni
3c2f0814df Update OWNERS
Adding jefftree to the owners file for leaderelection

Kubernetes-commit: b5bbc1508f986df7811dd79e7b5116bbede784e8
2024-08-14 12:16:59 -07:00
ComingCL
de60f3ccb5 fix typo errors in client-go rest package
Kubernetes-commit: faf891ad2d6dd1706932c8cf8774b2c7fb2b4bb1
2024-06-15 00:28:03 +08:00
Ben Luddy
ee51eaf9d0 Use content negotiation in the dynamic client.
Kubernetes-commit: 97958d96a2911c8b1df324868f4730b1c622c798
2024-02-15 17:47:19 -05:00
Kubernetes Publisher
c38ce11939 Merge pull request #127812 from p0lyn0mial/upstream-decode-list-blueprint
client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests

Kubernetes-commit: a454563a8d5a93ae0288244eb63649e26e509991
2024-10-14 14:00:33 +00:00
Kubernetes Publisher
9cff3e43bd Merge pull request #128035 from alexanderstephan/export-reflector
Make getter names for reflector fields idiomatic

Kubernetes-commit: 4dc7a48ac6fb631a84e1974772bf7b8fd0bb9c59
2024-10-14 01:59:24 +00:00
Alexander Stephan
ce42c297f4 Make getter names for reflector fields idiomatic
Kubernetes-commit: fdabcb5141094cb99afde24ec1df15026b4ba349
2024-10-13 20:53:25 +00:00
Kubernetes Publisher
64f5574f09 Merge pull request #127998 from skitt/golang-x-oct-2024
October 2024 golang.org/x bump

Kubernetes-commit: 8cbb11519c54c120e2dc120a4799e53abbfea4a4
2024-10-11 14:00:21 +00:00
Kubernetes Publisher
2717ef67e3 Merge pull request #127985 from dims/update-moby-runc-dependencies-oct-10
Update moby/runc dependencies

Kubernetes-commit: 6e5e8f374e834fa8dab341bde5c522704ed55ba6
2024-10-11 14:00:19 +00:00
Stephen Kitt
9f84a0d8ed October 2024 golang.org/x bump
Nothing major here, but nothing liable to cause pain to downstreams
either.

* https://github.com/golang/crypto/compare/v0.26.0...v0.28.0 (there’s
  a SHA3 fix there but it’s only relevant for 32-bit platforms)
* https://github.com/golang/net/compare/v0.28.0...v0.30.0 (mostly
  http2; route address parsing fix on Darwin)
* https://github.com/golang/oauth2/compare/v0.21.0...v0.23.0 (Google
  license fix)
* https://github.com/golang/sys/compare/v0.23.0...v0.26.0 (faster
  getrandom() on Linux through the vDSO; improved RISC-V support)
* https://github.com/golang/term/compare/v0.23.0...v0.25.0
* https://github.com/golang/time/compare/v0.3.0...v0.7.0 (0-limit
  handling fix in x/time/rate; Google license fix)
* https://github.com/golang/tools/compare/v0.24.0...v0.26.0

This doesn’t include golang.org/x/exp; that doesn’t have any relevant
changes. There’s an apidiff fix but we always pull in the latest
apidiff anyway.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 6c5a528727c30803d4426b29c06ae5d350619877
2024-10-11 10:22:13 +02:00
Davanum Srinivas
6b8f524c7c Update moby/runc dependencies
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 521f2d106b9c5744ce57a8ec03124bcdadbca986
2024-10-10 11:58:22 -04:00
Kubernetes Publisher
d13452aae7 Merge pull request #127485 from seans3/websocket-upgrade-error-info
Upgrade websocket failure add extra error info

Kubernetes-commit: 5c96d8d34d44d5c03b206c9e48c8794730692dae
2024-10-11 02:00:19 +01:00
Lukasz Szaszkiewicz
d274c7ba36 client-go/rest/request: decodes initialEventsListBlueprint for watchlist requests
Kubernetes-commit: 7be192ae0bd5d9628c5ee37c2e8b843d602c0fa3
2024-10-02 15:03:39 +02:00
Sean Sullivan
3cd3050ffd Upgrade websocket failure add extra error info
Kubernetes-commit: eec2be81681c5ad147df13aad60a003af0c4c48f
2024-09-19 15:47:19 -07:00
Kubernetes Publisher
cd6681f3c4 Merge pull request #127942 from liggitt/json123
sigs.k8s.io/json go 1.23 bump

Kubernetes-commit: fc318e3ba4cb1db822d7f802993059846f64179d
2024-10-10 21:56:10 +00:00
Jordan Liggitt
bbcb9ac523 Update sigs.k8s.io/json to go1.23
Kubernetes-commit: 8eff759b6ac7c3bb0c6a8823c751f5a578d6f721
2024-10-10 11:00:11 -04:00
Kubernetes Publisher
cae730524e Merge pull request #127944 from antoninbas/use-generics-for-delaying-queue-waitFor
Use generics for waitFor (delaying workqueue) in client-go

Kubernetes-commit: f7fef0384ec1c666e6b68cae83a3b3c6d95aa7b0
2024-10-09 09:55:50 +00:00
Kubernetes Publisher
ba20fcad8f Merge pull request #127663 from alexanderstephan/export-reflector
Export name and typeDescription members of reflector struct

Kubernetes-commit: 95ec69c16c76b5ee71fdbebc7a5dea2c39341eb3
2024-10-09 01:56:00 +00:00
Antonin Bas
3c28f81659 Use generics for waitFor (delaying workqueue) in client-go
With this change, we can typically avoid an extra heap allocation when
calling AddAfter with a positive duration (which causes the creation of
a waitFor object). This is because workqueues are typically used with
string keys, and casting a string (or more generally, non-pointer types)
to an `interface{}` will cause an heap escape / allocation.

Ater this change, there is no longer any usage of `type t interface{}`,
which was creating some confusion after the switch to generics in the
workqueue package.

Co-authored-by: Quan Tian <quan.tian@broadcom.com>
Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>

Kubernetes-commit: 53ddffb55709857fec6bddbd5ca4ca1b03f7da97
2024-10-08 15:12:11 -07:00
Kubernetes Publisher
0dfea60d7a Merge pull request #127710 from alvaroaleman/document
RestCfg: Add godocs on how to disable ratelimiting

Kubernetes-commit: b2031b3cb46e946ee72eab7bda87b046db138d62
2024-10-08 10:20:58 +00:00
Kubernetes Publisher
5fceb99b61 Merge pull request #127635 from antoninbas/use-generics-for-queue-metrics
Use generics for workqueue metrics

Kubernetes-commit: 8461e630acd90a9eeebc7ffffefd81003be394bc
2024-10-08 10:20:56 +00:00
Alvaro Aleman
7416b2ea43 RestCfg: Add godocs on how to disable ratelimiting
I frequently find myself in the situation of not remembering which of
QPS/Burst I have to set. This change adds a small go doc to clarify
that.

Kubernetes-commit: cd1645ff2c195fbb353cfabcbc36e3c3b883c3c5
2024-09-27 10:34:15 -04:00
Alexander Stephan
146d03f559 Export name and typeDescription members of reflector struct
Kubernetes-commit: 154b8aa8806d743c41d1acf0b498bdecf1767872
2024-09-26 15:09:59 +00:00
Antonin Bas
5b31113588 Use generics for workqueue metrics
The workqueue implementation was recently updated to be strongly typed,
using Go generics. However the metrics implementation was not updated,
and continued using interface{}. This translated to unnecessary memory
allocations when invoking the queueMetrics interface methods to track
queue operation. We can avoid these extra heap allocations by using
generics for the metrics implementation as well.

Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>

Kubernetes-commit: 1aec7568e111f5855121e3afacacf431e5f95948
2024-09-25 14:35:03 -07:00
Kubernetes Publisher
ca4a13f6de Merge pull request #127827 from skitt/client-go-obsolete-plugins
client-go: remove obsolete auth plugins from examples

Kubernetes-commit: 8c2255657a7288386dc52acbaba81536bd1ac2d3
2024-10-03 21:30:27 +01:00
Stephen Kitt
105983d93c client-go: remove obsolete auth plugins from examples
The azure and gcp plugins no longer do anything other than point to
the corresponding external credential plugins. Client code should no
longer try to load them, so they should be removed from the examples.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 4531c6de760ec42941d9f509103f1b29c88bfae0
2024-10-03 11:08:52 +02:00
Kubernetes Publisher
3ecd72cc0b Merge pull request #127099 from jpbetz/object-selectors-ga
Add filtered informers tests for CRD field selectors

Kubernetes-commit: c5f2fc05ad5ef3d68f35263f9f965101b371b8cc
2024-10-02 02:00:09 +00:00
Joe Betz
1d3f0e5617 Add dynamic informers tests for field and label selectors
Kubernetes-commit: 6ba426c0c09c30411a7c6121044d7b1db1722776
2024-09-03 12:12:30 -04:00
233 changed files with 1318 additions and 1635 deletions

View File

@@ -12247,9 +12247,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.resource.v1alpha3.AllocationResult
map:
fields:
- name: controller
type:
scalar: string
- name: devices
type:
namedType: io.k8s.api.resource.v1alpha3.DeviceAllocationResult
@@ -12404,9 +12401,6 @@ var schemaYAML = typed.YAMLObject(`types:
elementType:
namedType: io.k8s.api.resource.v1alpha3.DeviceSelector
elementRelationship: atomic
- name: suitableNodes
type:
namedType: io.k8s.api.core.v1.NodeSelector
- name: io.k8s.api.resource.v1alpha3.DeviceConstraint
map:
fields:
@@ -12481,50 +12475,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: parameters
type:
namedType: __untyped_atomic_
- name: io.k8s.api.resource.v1alpha3.PodSchedulingContext
map:
fields:
- name: apiVersion
type:
scalar: string
- name: kind
type:
scalar: string
- name: metadata
type:
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
default: {}
- name: spec
type:
namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec
default: {}
- name: status
type:
namedType: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus
default: {}
- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextSpec
map:
fields:
- name: potentialNodes
type:
list:
elementType:
scalar: string
elementRelationship: atomic
- name: selectedNode
type:
scalar: string
- name: io.k8s.api.resource.v1alpha3.PodSchedulingContextStatus
map:
fields:
- name: resourceClaims
type:
list:
elementType:
namedType: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus
elementRelationship: associative
keys:
- name
- name: io.k8s.api.resource.v1alpha3.ResourceClaim
map:
fields:
@@ -12564,25 +12514,9 @@ var schemaYAML = typed.YAMLObject(`types:
type:
scalar: string
default: ""
- name: io.k8s.api.resource.v1alpha3.ResourceClaimSchedulingStatus
map:
fields:
- name: name
type:
scalar: string
default: ""
- name: unsuitableNodes
type:
list:
elementType:
scalar: string
elementRelationship: atomic
- name: io.k8s.api.resource.v1alpha3.ResourceClaimSpec
map:
fields:
- name: controller
type:
scalar: string
- name: devices
type:
namedType: io.k8s.api.resource.v1alpha3.DeviceClaim
@@ -12593,9 +12527,6 @@ var schemaYAML = typed.YAMLObject(`types:
- name: allocation
type:
namedType: io.k8s.api.resource.v1alpha3.AllocationResult
- name: deallocationRequested
type:
scalar: boolean
- name: reservedFor
type:
list:

View File

@@ -27,7 +27,6 @@ import (
type AllocationResultApplyConfiguration struct {
Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"`
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
Controller *string `json:"controller,omitempty"`
}
// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with
@@ -51,11 +50,3 @@ func (b *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSele
b.NodeSelector = value
return b
}
// WithController sets the Controller field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Controller field is set to the value of the last call.
func (b *AllocationResultApplyConfiguration) WithController(value string) *AllocationResultApplyConfiguration {
b.Controller = &value
return b
}

View File

@@ -18,16 +18,11 @@ limitations under the License.
package v1alpha3
import (
v1 "k8s.io/client-go/applyconfigurations/core/v1"
)
// DeviceClassSpecApplyConfiguration represents a declarative configuration of the DeviceClassSpec type for use
// with apply.
type DeviceClassSpecApplyConfiguration struct {
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"`
SuitableNodes *v1.NodeSelectorApplyConfiguration `json:"suitableNodes,omitempty"`
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
Config []DeviceClassConfigurationApplyConfiguration `json:"config,omitempty"`
}
// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with
@@ -61,11 +56,3 @@ func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassCon
}
return b
}
// WithSuitableNodes sets the SuitableNodes field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SuitableNodes field is set to the value of the last call.
func (b *DeviceClassSpecApplyConfiguration) WithSuitableNodes(value *v1.NodeSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration {
b.SuitableNodes = value
return b
}

View File

@@ -1,264 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
import (
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
internal "k8s.io/client-go/applyconfigurations/internal"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// PodSchedulingContextApplyConfiguration represents a declarative configuration of the PodSchedulingContext type for use
// with apply.
type PodSchedulingContextApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
Spec *PodSchedulingContextSpecApplyConfiguration `json:"spec,omitempty"`
Status *PodSchedulingContextStatusApplyConfiguration `json:"status,omitempty"`
}
// PodSchedulingContext constructs a declarative configuration of the PodSchedulingContext type for use with
// apply.
func PodSchedulingContext(name, namespace string) *PodSchedulingContextApplyConfiguration {
b := &PodSchedulingContextApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("PodSchedulingContext")
b.WithAPIVersion("resource.k8s.io/v1alpha3")
return b
}
// ExtractPodSchedulingContext extracts the applied configuration owned by fieldManager from
// podSchedulingContext. If no managedFields are found in podSchedulingContext for fieldManager, a
// PodSchedulingContextApplyConfiguration is returned with only the Name, Namespace (if applicable),
// APIVersion and Kind populated. It is possible that no managed fields were found for because other
// field managers have taken ownership of all the fields previously owned by fieldManager, or because
// the fieldManager never owned fields any fields.
// podSchedulingContext must be a unmodified PodSchedulingContext API object that was retrieved from the Kubernetes API.
// ExtractPodSchedulingContext provides a way to perform a extract/modify-in-place/apply workflow.
// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously
// applied if another fieldManager has updated or force applied any of the previously applied fields.
// Experimental!
func ExtractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) {
return extractPodSchedulingContext(podSchedulingContext, fieldManager, "")
}
// ExtractPodSchedulingContextStatus is the same as ExtractPodSchedulingContext except
// that it extracts the status subresource applied configuration.
// Experimental!
func ExtractPodSchedulingContextStatus(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string) (*PodSchedulingContextApplyConfiguration, error) {
return extractPodSchedulingContext(podSchedulingContext, fieldManager, "status")
}
func extractPodSchedulingContext(podSchedulingContext *resourcev1alpha3.PodSchedulingContext, fieldManager string, subresource string) (*PodSchedulingContextApplyConfiguration, error) {
b := &PodSchedulingContextApplyConfiguration{}
err := managedfields.ExtractInto(podSchedulingContext, internal.Parser().Type("io.k8s.api.resource.v1alpha3.PodSchedulingContext"), fieldManager, b, subresource)
if err != nil {
return nil, err
}
b.WithName(podSchedulingContext.Name)
b.WithNamespace(podSchedulingContext.Namespace)
b.WithKind("PodSchedulingContext")
b.WithAPIVersion("resource.k8s.io/v1alpha3")
return b, nil
}
// WithKind sets the Kind field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Kind field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithKind(value string) *PodSchedulingContextApplyConfiguration {
b.TypeMetaApplyConfiguration.Kind = &value
return b
}
// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the APIVersion field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithAPIVersion(value string) *PodSchedulingContextApplyConfiguration {
b.TypeMetaApplyConfiguration.APIVersion = &value
return b
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithName(value string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Name = &value
return b
}
// WithGenerateName sets the GenerateName field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the GenerateName field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithGenerateName(value string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.GenerateName = &value
return b
}
// WithNamespace sets the Namespace field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Namespace field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithNamespace(value string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Namespace = &value
return b
}
// WithUID sets the UID field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the UID field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithUID(value types.UID) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.UID = &value
return b
}
// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the ResourceVersion field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithResourceVersion(value string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.ResourceVersion = &value
return b
}
// WithGeneration sets the Generation field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Generation field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithGeneration(value int64) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.Generation = &value
return b
}
// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the CreationTimestamp field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.CreationTimestamp = &value
return b
}
// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionTimestamp field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionTimestamp = &value
return b
}
// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ObjectMetaApplyConfiguration.DeletionGracePeriodSeconds = &value
return b
}
// WithLabels puts the entries into the Labels field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Labels field,
// overwriting an existing map entries in Labels field with the same key.
func (b *PodSchedulingContextApplyConfiguration) WithLabels(entries map[string]string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Labels == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Labels[k] = v
}
return b
}
// WithAnnotations puts the entries into the Annotations field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, the entries provided by each call will be put on the Annotations field,
// overwriting an existing map entries in Annotations field with the same key.
func (b *PodSchedulingContextApplyConfiguration) WithAnnotations(entries map[string]string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.ObjectMetaApplyConfiguration.Annotations == nil && len(entries) > 0 {
b.ObjectMetaApplyConfiguration.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.ObjectMetaApplyConfiguration.Annotations[k] = v
}
return b
}
// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the OwnerReferences field.
func (b *PodSchedulingContextApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.ObjectMetaApplyConfiguration.OwnerReferences = append(b.ObjectMetaApplyConfiguration.OwnerReferences, *values[i])
}
return b
}
// WithFinalizers adds the given value to the Finalizers field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the Finalizers field.
func (b *PodSchedulingContextApplyConfiguration) WithFinalizers(values ...string) *PodSchedulingContextApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
}
return b
}
func (b *PodSchedulingContextApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithSpec sets the Spec field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Spec field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithSpec(value *PodSchedulingContextSpecApplyConfiguration) *PodSchedulingContextApplyConfiguration {
b.Spec = value
return b
}
// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *PodSchedulingContextApplyConfiguration) WithStatus(value *PodSchedulingContextStatusApplyConfiguration) *PodSchedulingContextApplyConfiguration {
b.Status = value
return b
}
// GetName retrieves the value of the Name field in the declarative configuration.
func (b *PodSchedulingContextApplyConfiguration) GetName() *string {
b.ensureObjectMetaApplyConfigurationExists()
return b.ObjectMetaApplyConfiguration.Name
}

View File

@@ -1,50 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// PodSchedulingContextSpecApplyConfiguration represents a declarative configuration of the PodSchedulingContextSpec type for use
// with apply.
type PodSchedulingContextSpecApplyConfiguration struct {
SelectedNode *string `json:"selectedNode,omitempty"`
PotentialNodes []string `json:"potentialNodes,omitempty"`
}
// PodSchedulingContextSpecApplyConfiguration constructs a declarative configuration of the PodSchedulingContextSpec type for use with
// apply.
func PodSchedulingContextSpec() *PodSchedulingContextSpecApplyConfiguration {
return &PodSchedulingContextSpecApplyConfiguration{}
}
// WithSelectedNode sets the SelectedNode field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the SelectedNode field is set to the value of the last call.
func (b *PodSchedulingContextSpecApplyConfiguration) WithSelectedNode(value string) *PodSchedulingContextSpecApplyConfiguration {
b.SelectedNode = &value
return b
}
// WithPotentialNodes adds the given value to the PotentialNodes field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the PotentialNodes field.
func (b *PodSchedulingContextSpecApplyConfiguration) WithPotentialNodes(values ...string) *PodSchedulingContextSpecApplyConfiguration {
for i := range values {
b.PotentialNodes = append(b.PotentialNodes, values[i])
}
return b
}

View File

@@ -1,44 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// PodSchedulingContextStatusApplyConfiguration represents a declarative configuration of the PodSchedulingContextStatus type for use
// with apply.
type PodSchedulingContextStatusApplyConfiguration struct {
ResourceClaims []ResourceClaimSchedulingStatusApplyConfiguration `json:"resourceClaims,omitempty"`
}
// PodSchedulingContextStatusApplyConfiguration constructs a declarative configuration of the PodSchedulingContextStatus type for use with
// apply.
func PodSchedulingContextStatus() *PodSchedulingContextStatusApplyConfiguration {
return &PodSchedulingContextStatusApplyConfiguration{}
}
// WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the ResourceClaims field.
func (b *PodSchedulingContextStatusApplyConfiguration) WithResourceClaims(values ...*ResourceClaimSchedulingStatusApplyConfiguration) *PodSchedulingContextStatusApplyConfiguration {
for i := range values {
if values[i] == nil {
panic("nil value passed to WithResourceClaims")
}
b.ResourceClaims = append(b.ResourceClaims, *values[i])
}
return b
}

View File

@@ -1,50 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1alpha3
// ResourceClaimSchedulingStatusApplyConfiguration represents a declarative configuration of the ResourceClaimSchedulingStatus type for use
// with apply.
type ResourceClaimSchedulingStatusApplyConfiguration struct {
Name *string `json:"name,omitempty"`
UnsuitableNodes []string `json:"unsuitableNodes,omitempty"`
}
// ResourceClaimSchedulingStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimSchedulingStatus type for use with
// apply.
func ResourceClaimSchedulingStatus() *ResourceClaimSchedulingStatusApplyConfiguration {
return &ResourceClaimSchedulingStatusApplyConfiguration{}
}
// WithName sets the Name field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Name field is set to the value of the last call.
func (b *ResourceClaimSchedulingStatusApplyConfiguration) WithName(value string) *ResourceClaimSchedulingStatusApplyConfiguration {
b.Name = &value
return b
}
// WithUnsuitableNodes adds the given value to the UnsuitableNodes field in the declarative configuration
// and returns the receiver, so that objects can be build by chaining "With" function invocations.
// If called multiple times, values provided by each call will be appended to the UnsuitableNodes field.
func (b *ResourceClaimSchedulingStatusApplyConfiguration) WithUnsuitableNodes(values ...string) *ResourceClaimSchedulingStatusApplyConfiguration {
for i := range values {
b.UnsuitableNodes = append(b.UnsuitableNodes, values[i])
}
return b
}

View File

@@ -21,8 +21,7 @@ package v1alpha3
// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use
// with apply.
type ResourceClaimSpecApplyConfiguration struct {
Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"`
Controller *string `json:"controller,omitempty"`
Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"`
}
// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with
@@ -38,11 +37,3 @@ func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimAppl
b.Devices = value
return b
}
// WithController sets the Controller field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Controller field is set to the value of the last call.
func (b *ResourceClaimSpecApplyConfiguration) WithController(value string) *ResourceClaimSpecApplyConfiguration {
b.Controller = &value
return b
}

View File

@@ -21,9 +21,8 @@ package v1alpha3
// ResourceClaimStatusApplyConfiguration represents a declarative configuration of the ResourceClaimStatus type for use
// with apply.
type ResourceClaimStatusApplyConfiguration struct {
Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"`
ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"`
DeallocationRequested *bool `json:"deallocationRequested,omitempty"`
Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"`
ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"`
}
// ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with
@@ -52,11 +51,3 @@ func (b *ResourceClaimStatusApplyConfiguration) WithReservedFor(values ...*Resou
}
return b
}
// WithDeallocationRequested sets the DeallocationRequested field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the DeallocationRequested field is set to the value of the last call.
func (b *ResourceClaimStatusApplyConfiguration) WithDeallocationRequested(value bool) *ResourceClaimStatusApplyConfiguration {
b.DeallocationRequested = &value
return b
}

View File

@@ -1602,18 +1602,10 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &resourcev1alpha3.DeviceSelectorApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContext"):
return &resourcev1alpha3.PodSchedulingContextApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextSpec"):
return &resourcev1alpha3.PodSchedulingContextSpecApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("PodSchedulingContextStatus"):
return &resourcev1alpha3.PodSchedulingContextStatusApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"):
return &resourcev1alpha3.ResourceClaimApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"):
return &resourcev1alpha3.ResourceClaimConsumerReferenceApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSchedulingStatus"):
return &resourcev1alpha3.ResourceClaimSchedulingStatusApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimSpec"):
return &resourcev1alpha3.ResourceClaimSpecApplyConfiguration{}
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaimStatus"):

View File

@@ -19,6 +19,7 @@ package dynamic
import (
"bytes"
"context"
"encoding/base64"
"fmt"
"io"
"net/http"
@@ -183,7 +184,10 @@ func TestWatchList(t *testing.T) {
{Type: watch.Bookmark, Object: func() runtime.Object {
obj := getObject("gtest/vTest", "rTest", "item2")
obj.SetResourceVersion("10")
obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"})
obj.SetAnnotations(map[string]string{
metav1.InitialEventsAnnotationKey: "true",
metav1.InitialEventsListBlueprintAnnotationKey: base64.StdEncoding.EncodeToString(getJSON("vTest", "rTests", "")),
})
return obj
}()},
},
@@ -195,9 +199,10 @@ func TestWatchList(t *testing.T) {
},
expectedList: &unstructured.UnstructuredList{
Object: map[string]interface{}{
"apiVersion": "",
"kind": "UnstructuredList",
"apiVersion": "vTest",
"kind": "rTests",
"metadata": map[string]interface{}{
"name": "",
"resourceVersion": "10",
},
},
@@ -215,7 +220,10 @@ func TestWatchList(t *testing.T) {
{Type: watch.Bookmark, Object: func() runtime.Object {
obj := getObject("gtest/vTest", "rTest", "item2")
obj.SetResourceVersion("39")
obj.SetAnnotations(map[string]string{metav1.InitialEventsAnnotationKey: "true"})
obj.SetAnnotations(map[string]string{
metav1.InitialEventsAnnotationKey: "true",
metav1.InitialEventsListBlueprintAnnotationKey: base64.StdEncoding.EncodeToString(getJSON("vTest", "rTests", "")),
})
return obj
}()},
},
@@ -227,9 +235,10 @@ func TestWatchList(t *testing.T) {
},
expectedList: &unstructured.UnstructuredList{
Object: map[string]interface{}{
"apiVersion": "",
"kind": "UnstructuredList",
"apiVersion": "vTest",
"kind": "rTests",
"metadata": map[string]interface{}{
"name": "",
"resourceVersion": "39",
},
},

View File

@@ -22,6 +22,7 @@ import (
"time"
"github.com/google/go-cmp/cmp"
"k8s.io/apimachinery/pkg/api/equality"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -37,6 +38,7 @@ type triggerFunc func(gvr schema.GroupVersionResource, ns string, fakeClient *fa
func triggerFactory(t *testing.T) triggerFunc {
return func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, _ *unstructured.Unstructured) *unstructured.Unstructured {
testObject := newUnstructured("apps/v1", "Deployment", "ns-foo", "name-foo")
testObject.SetLabels(map[string]string{"environment": "test"})
createdObj, err := fakeClient.Resource(gvr).Namespace(ns).Create(context.TODO(), testObject, metav1.CreateOptions{})
if err != nil {
t.Error(err)
@@ -55,13 +57,14 @@ func handler(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandle
func TestFilteredDynamicSharedInformerFactory(t *testing.T) {
scenarios := []struct {
name string
existingObj *unstructured.Unstructured
gvr schema.GroupVersionResource
informNS string
ns string
trigger func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured
handler func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs
name string
existingObj *unstructured.Unstructured
gvr schema.GroupVersionResource
informNS string
ns string
trigger func(gvr schema.GroupVersionResource, ns string, fakeClient *fake.FakeDynamicClient, testObject *unstructured.Unstructured) *unstructured.Unstructured
handler func(rcvCh chan<- *unstructured.Unstructured) *cache.ResourceEventHandlerFuncs
tweakListOptions dynamicinformer.TweakListOptionsFunc
}{
// scenario 1
{
@@ -81,6 +84,50 @@ func TestFilteredDynamicSharedInformerFactory(t *testing.T) {
trigger: triggerFactory(t),
handler: handler,
},
{
name: "tweak options: test adding an object not matching field selector should not trigger AddFunc",
informNS: "ns-foo",
ns: "ns-foo",
gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"},
trigger: triggerFactory(t),
handler: handler,
tweakListOptions: func(opts *metav1.ListOptions) {
opts.FieldSelector = "metadata.name=name-bar"
},
},
{
name: "tweak options: test adding an object matching field selector should trigger AddFunc",
informNS: "ns-foo",
ns: "ns-foo",
gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"},
trigger: triggerFactory(t),
handler: handler,
tweakListOptions: func(opts *metav1.ListOptions) {
opts.FieldSelector = "metadata.name=name-foo"
},
},
{
name: "tweak options: test adding an object not matching label selector should not trigger AddFunc",
informNS: "ns-foo",
ns: "ns-foo",
gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"},
trigger: triggerFactory(t),
handler: handler,
tweakListOptions: func(opts *metav1.ListOptions) {
opts.LabelSelector = "environment=production"
},
},
{
name: "tweak options: test adding an object matching label selector should trigger AddFunc",
informNS: "ns-foo",
ns: "ns-foo",
gvr: schema.GroupVersionResource{Group: "apps", Version: "v1", Resource: "deployments"},
trigger: triggerFactory(t),
handler: handler,
tweakListOptions: func(opts *metav1.ListOptions) {
opts.LabelSelector = "environment=test"
},
},
}
for _, ts := range scenarios {

View File

@@ -21,31 +21,24 @@ import (
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/runtime/serializer/cbor"
"k8s.io/apimachinery/pkg/runtime/serializer/json"
"k8s.io/client-go/features"
)
var watchScheme = runtime.NewScheme()
var basicScheme = runtime.NewScheme()
var deleteScheme = runtime.NewScheme()
var parameterScheme = runtime.NewScheme()
var deleteOptionsCodec = serializer.NewCodecFactory(deleteScheme)
var dynamicParameterCodec = runtime.NewParameterCodec(parameterScheme)
var versionV1 = schema.GroupVersion{Version: "v1"}
func init() {
metav1.AddToGroupVersion(watchScheme, versionV1)
metav1.AddToGroupVersion(basicScheme, versionV1)
metav1.AddToGroupVersion(parameterScheme, versionV1)
metav1.AddToGroupVersion(deleteScheme, versionV1)
}
// basicNegotiatedSerializer is used to handle discovery and error handling serialization
type basicNegotiatedSerializer struct{}
func (s basicNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
return []runtime.SerializerInfo{
func newBasicNegotiatedSerializer() basicNegotiatedSerializer {
supportedMediaTypes := []runtime.SerializerInfo{
{
MediaType: "application/json",
MediaTypeType: "application",
@@ -60,13 +53,34 @@ func (s basicNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInf
},
},
}
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientAllowsCBOR) {
supportedMediaTypes = append(supportedMediaTypes, runtime.SerializerInfo{
MediaType: "application/cbor",
MediaTypeType: "application",
MediaTypeSubType: "cbor",
Serializer: cbor.NewSerializer(unstructuredCreater{basicScheme}, unstructuredTyper{basicScheme}),
StreamSerializer: &runtime.StreamSerializerInfo{
Serializer: cbor.NewSerializer(basicScheme, basicScheme, cbor.Transcode(false)),
Framer: cbor.NewFramer(),
},
})
}
return basicNegotiatedSerializer{supportedMediaTypes: supportedMediaTypes}
}
type basicNegotiatedSerializer struct {
supportedMediaTypes []runtime.SerializerInfo
}
func (s basicNegotiatedSerializer) SupportedMediaTypes() []runtime.SerializerInfo {
return s.supportedMediaTypes
}
func (s basicNegotiatedSerializer) EncoderForVersion(encoder runtime.Encoder, gv runtime.GroupVersioner) runtime.Encoder {
return runtime.WithVersionEncoder{
Version: gv,
Encoder: encoder,
ObjectTyper: unstructuredTyper{basicScheme},
ObjectTyper: permissiveTyper{basicScheme},
}
}
@@ -106,3 +120,25 @@ func (t unstructuredTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersio
func (t unstructuredTyper) Recognizes(gvk schema.GroupVersionKind) bool {
return true
}
// The dynamic client has historically accepted Unstructured objects with missing or empty
// apiVersion and/or kind as arguments to its write request methods. This typer will return the type
// of a runtime.Unstructured with no error, even if the type is missing or empty.
type permissiveTyper struct {
nested runtime.ObjectTyper
}
func (t permissiveTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error) {
kinds, unversioned, err := t.nested.ObjectKinds(obj)
if err == nil {
return kinds, unversioned, nil
}
if _, ok := obj.(runtime.Unstructured); ok {
return []schema.GroupVersionKind{obj.GetObjectKind().GroupVersionKind()}, false, nil
}
return nil, false, err
}
func (t permissiveTyper) Recognizes(gvk schema.GroupVersionKind) bool {
return true
}

View File

@@ -29,6 +29,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/features"
"k8s.io/client-go/rest"
"k8s.io/client-go/util/consistencydetector"
"k8s.io/client-go/util/watchlist"
@@ -45,9 +46,17 @@ var _ Interface = &DynamicClient{}
// appropriate dynamic client defaults set.
func ConfigFor(inConfig *rest.Config) *rest.Config {
config := rest.CopyConfig(inConfig)
config.AcceptContentTypes = "application/json"
config.ContentType = "application/json"
config.NegotiatedSerializer = basicNegotiatedSerializer{} // this gets used for discovery and error handling types
config.AcceptContentTypes = "application/json"
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientAllowsCBOR) {
config.AcceptContentTypes = "application/json;q=0.9,application/cbor;q=1"
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientPrefersCBOR) {
config.ContentType = "application/cbor"
}
}
config.NegotiatedSerializer = newBasicNegotiatedSerializer()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
@@ -86,11 +95,10 @@ func NewForConfig(inConfig *rest.Config) (*DynamicClient, error) {
// Note the http client provided takes precedence over the configured transport values.
func NewForConfigAndClient(inConfig *rest.Config, h *http.Client) (*DynamicClient, error) {
config := ConfigFor(inConfig)
// for serializing the options
config.GroupVersion = &schema.GroupVersion{}
config.GroupVersion = nil
config.APIPath = "/if-you-see-this-search-for-the-break"
restClient, err := rest.RESTClientForConfigAndClient(config, h)
restClient, err := rest.UnversionedRESTClientForConfigAndClient(config, h)
if err != nil {
return nil, err
}
@@ -114,10 +122,6 @@ func (c *dynamicResourceClient) Namespace(ns string) ResourceInterface {
}
func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) {
outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
if err != nil {
return nil, err
}
name := ""
if len(subresources) > 0 {
accessor, err := meta.Accessor(obj)
@@ -133,26 +137,17 @@ func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Un
return nil, err
}
result := c.client.client.
var out unstructured.Unstructured
if err := c.client.client.
Post().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
SetHeader("Content-Type", runtime.ContentTypeJSON).
Body(outBytes).
Body(obj).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx)
if err := result.Error(); err != nil {
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
return nil, err
}
return uncastObj.(*unstructured.Unstructured), nil
return &out, nil
}
func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) {
@@ -167,31 +162,18 @@ func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Un
if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil {
return nil, err
}
outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
if err != nil {
return nil, err
}
result := c.client.client.
var out unstructured.Unstructured
if err := c.client.client.
Put().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
SetHeader("Content-Type", runtime.ContentTypeJSON).
Body(outBytes).
Body(obj).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx)
if err := result.Error(); err != nil {
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
return nil, err
}
return uncastObj.(*unstructured.Unstructured), nil
return &out, nil
}
func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) {
@@ -206,31 +188,18 @@ func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructu
if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil {
return nil, err
}
outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj)
if err != nil {
return nil, err
}
result := c.client.client.
var out unstructured.Unstructured
if err := c.client.client.
Put().
AbsPath(append(c.makeURLSegments(name), "status")...).
SetHeader("Content-Type", runtime.ContentTypeJSON).
Body(outBytes).
Body(obj).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx)
if err := result.Error(); err != nil {
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
return nil, err
}
return uncastObj.(*unstructured.Unstructured), nil
return &out, nil
}
func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error {
@@ -240,16 +209,11 @@ func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts me
if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil {
return err
}
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts)
if err != nil {
return err
}
result := c.client.client.
Delete().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
SetHeader("Content-Type", runtime.ContentTypeJSON).
Body(deleteOptionsByte).
Body(&opts).
Do(ctx)
return result.Error()
}
@@ -259,16 +223,10 @@ func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav
return err
}
deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts)
if err != nil {
return err
}
result := c.client.client.
Delete().
AbsPath(c.makeURLSegments("")...).
SetHeader("Content-Type", runtime.ContentTypeJSON).
Body(deleteOptionsByte).
Body(&opts).
SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1).
Do(ctx)
return result.Error()
@@ -281,20 +239,15 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav
if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil {
return nil, err
}
result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx)
if err := result.Error(); err != nil {
var out unstructured.Unstructured
if err := c.client.client.
Get().
AbsPath(append(c.makeURLSegments(name), subresources...)...).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
obj := &unstructured.Unstructured{}
err = runtime.DecodeInto(unstructured.UnstructuredJSONScheme, retBytes, obj)
if err != nil {
return nil, err
}
return obj, nil
return &out, nil
}
func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) {
@@ -319,27 +272,15 @@ func (c *dynamicResourceClient) list(ctx context.Context, opts metav1.ListOption
if err := validateNamespaceWithOptionalName(c.namespace); err != nil {
return nil, err
}
result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx)
if err := result.Error(); err != nil {
var out unstructured.UnstructuredList
if err := c.client.client.
Get().
AbsPath(c.makeURLSegments("")...).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
return nil, err
}
if list, ok := uncastObj.(*unstructured.UnstructuredList); ok {
return list, nil
}
list, err := uncastObj.(*unstructured.Unstructured).ToList()
if err != nil {
return nil, err
}
return list, nil
return &out, nil
}
// watchList establishes a watch stream with the server and returns an unstructured list.
@@ -380,24 +321,16 @@ func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types
if err := validateNamespaceWithOptionalName(c.namespace, name); err != nil {
return nil, err
}
result := c.client.client.
var out unstructured.Unstructured
if err := c.client.client.
Patch(pt).
AbsPath(append(c.makeURLSegments(name), subresources...)...).
Body(data).
SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).
Do(ctx)
if err := result.Error(); err != nil {
Do(ctx).Into(&out); err != nil {
return nil, err
}
retBytes, err := result.Raw()
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
return nil, err
}
return uncastObj.(*unstructured.Unstructured), nil
return &out, nil
}
func (c *dynamicResourceClient) Apply(ctx context.Context, name string, obj *unstructured.Unstructured, opts metav1.ApplyOptions, subresources ...string) (*unstructured.Unstructured, error) {
@@ -435,12 +368,13 @@ func (c *dynamicResourceClient) Apply(ctx context.Context, name string, obj *uns
if err != nil {
return nil, err
}
uncastObj, err := runtime.Decode(unstructured.UnstructuredJSONScheme, retBytes)
if err != nil {
var out unstructured.Unstructured
if err := runtime.DecodeInto(unstructured.UnstructuredJSONScheme, retBytes, &out); err != nil {
return nil, err
}
return uncastObj.(*unstructured.Unstructured), nil
return &out, nil
}
func (c *dynamicResourceClient) ApplyStatus(ctx context.Context, name string, obj *unstructured.Unstructured, opts metav1.ApplyOptions) (*unstructured.Unstructured, error) {
return c.Apply(ctx, name, obj, opts, "status")
}

View File

@@ -31,8 +31,6 @@ import (
// _ "k8s.io/client-go/plugin/pkg/client/auth"
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
)

View File

@@ -34,8 +34,6 @@ import (
// _ "k8s.io/client-go/plugin/pkg/client/auth"
//
// Or uncomment to load specific auth plugins
// _ "k8s.io/client-go/plugin/pkg/client/auth/azure"
// _ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
// _ "k8s.io/client-go/plugin/pkg/client/auth/oidc"
)

View File

@@ -18,9 +18,11 @@ package features
import (
"errors"
"fmt"
"sync"
"sync/atomic"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"sync/atomic"
)
// NOTE: types Feature, FeatureSpec, prerelease (and its values)
@@ -141,3 +143,43 @@ var (
// should use AddFeaturesToExistingFeatureGates followed by ReplaceFeatureGates.
featureGates = &atomic.Value{}
)
// TestOnlyFeatureGates is a distinct registry of pre-alpha client features that must not be
// included in runtime wiring to command-line flags or environment variables. It exists as a risk
// mitigation to allow only programmatic enablement of CBOR serialization for integration testing
// purposes.
//
// TODO: Once all required integration test coverage is complete, this will be deleted and the
// test-only feature gates will be replaced by normal feature gates.
var TestOnlyFeatureGates = &testOnlyFeatureGates{
features: map[Feature]bool{
TestOnlyClientAllowsCBOR: false,
TestOnlyClientPrefersCBOR: false,
},
}
type testOnlyFeatureGates struct {
lock sync.RWMutex
features map[Feature]bool
}
func (t *testOnlyFeatureGates) Enabled(feature Feature) bool {
t.lock.RLock()
defer t.lock.RUnlock()
enabled, ok := t.features[feature]
if !ok {
panic(fmt.Sprintf("test-only feature %q not recognized", feature))
}
return enabled
}
func (t *testOnlyFeatureGates) Set(feature Feature, enabled bool) error {
t.lock.Lock()
defer t.lock.Unlock()
if _, ok := t.features[feature]; !ok {
return fmt.Errorf("test-only feature %q not recognized", feature)
}
t.features[feature] = enabled
return nil
}

View File

@@ -41,6 +41,27 @@ const (
// owner: @nilekhc
// alpha: v1.30
InformerResourceVersion Feature = "InformerResourceVersion"
// owner: @benluddy
// kep: https://kep.k8s.io/4222
//
// If disabled, clients configured to accept "application/cbor" will instead accept
// "application/json" with the same relative preference, and clients configured to write
// "application/cbor" or "application/apply-patch+cbor" will instead write
// "application/json" or "application/apply-patch+yaml", respectively.
//
// This feature is currently PRE-ALPHA and MUST NOT be enabled outside of integration tests.
TestOnlyClientAllowsCBOR Feature = "TestOnlyClientAllowsCBOR"
// owner: @benluddy
// kep: https://kep.k8s.io/4222
//
// If enabled AND TestOnlyClientAllowsCBOR is also enabled, the default request content type
// (if not explicitly configured) and the dynamic client's request content type both become
// "application/cbor".
//
// This feature is currently PRE-ALPHA and MUST NOT be enabled outside of integration tests.
TestOnlyClientPrefersCBOR Feature = "TestOnlyClientPrefersCBOR"
)
// defaultKubernetesFeatureGates consists of all known Kubernetes-specific feature keys.

View File

@@ -51,6 +51,8 @@ type Client[T objectWithMeta] struct {
namespace string // "" for non-namespaced clients
newObject func() T
parameterCodec runtime.ParameterCodec
prefersProtobuf bool
}
// ClientWithList represents a client with support for lists.
@@ -82,26 +84,37 @@ type alsoApplier[T objectWithMeta, C namedObject] struct {
client *Client[T]
}
type Option[T objectWithMeta] func(*Client[T])
func PrefersProtobuf[T objectWithMeta]() Option[T] {
return func(c *Client[T]) { c.prefersProtobuf = true }
}
// NewClient constructs a client, namespaced or not, with no support for lists or apply.
// Non-namespaced clients are constructed by passing an empty namespace ("").
func NewClient[T objectWithMeta](
resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T,
options ...Option[T],
) *Client[T] {
return &Client[T]{
c := &Client[T]{
resource: resource,
client: client,
parameterCodec: parameterCodec,
namespace: namespace,
newObject: emptyObjectCreator,
}
for _, option := range options {
option(c)
}
return c
}
// NewClientWithList constructs a namespaced client with support for lists.
func NewClientWithList[T objectWithMeta, L runtime.Object](
resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T,
emptyListCreator func() L,
emptyListCreator func() L, options ...Option[T],
) *ClientWithList[T, L] {
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator)
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator, options...)
return &ClientWithList[T, L]{
typeClient,
alsoLister[T, L]{typeClient, emptyListCreator},
@@ -111,8 +124,9 @@ func NewClientWithList[T objectWithMeta, L runtime.Object](
// NewClientWithApply constructs a namespaced client with support for apply declarative configurations.
func NewClientWithApply[T objectWithMeta, C namedObject](
resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T,
options ...Option[T],
) *ClientWithApply[T, C] {
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator)
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator, options...)
return &ClientWithApply[T, C]{
typeClient,
alsoApplier[T, C]{typeClient},
@@ -122,9 +136,9 @@ func NewClientWithApply[T objectWithMeta, C namedObject](
// NewClientWithListAndApply constructs a client with support for lists and applying declarative configurations.
func NewClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject](
resource string, client rest.Interface, parameterCodec runtime.ParameterCodec, namespace string, emptyObjectCreator func() T,
emptyListCreator func() L,
emptyListCreator func() L, options ...Option[T],
) *ClientWithListAndApply[T, L, C] {
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator)
typeClient := NewClient[T](resource, client, parameterCodec, namespace, emptyObjectCreator, options...)
return &ClientWithListAndApply[T, L, C]{
typeClient,
alsoLister[T, L]{typeClient, emptyListCreator},
@@ -146,6 +160,7 @@ func (c *Client[T]) GetNamespace() string {
func (c *Client[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (T, error) {
result := c.newObject()
err := c.client.Get().
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
Name(name).
@@ -181,6 +196,7 @@ func (l *alsoLister[T, L]) list(ctx context.Context, opts metav1.ListOptions) (L
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
err := l.client.client.Get().
UseProtobufAsDefaultIfPreferred(l.client.prefersProtobuf).
NamespaceIfScoped(l.client.namespace, l.client.namespace != "").
Resource(l.client.resource).
VersionedParams(&opts, l.client.parameterCodec).
@@ -198,6 +214,7 @@ func (l *alsoLister[T, L]) watchList(ctx context.Context, opts metav1.ListOption
}
result = l.newList()
err = l.client.client.Get().
UseProtobufAsDefaultIfPreferred(l.client.prefersProtobuf).
NamespaceIfScoped(l.client.namespace, l.client.namespace != "").
Resource(l.client.resource).
VersionedParams(&opts, l.client.parameterCodec).
@@ -215,6 +232,7 @@ func (c *Client[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.I
}
opts.Watch = true
return c.client.Get().
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
VersionedParams(&opts, c.parameterCodec).
@@ -226,6 +244,7 @@ func (c *Client[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.I
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).
@@ -239,6 +258,7 @@ func (c *Client[T]) Create(ctx context.Context, obj T, opts metav1.CreateOptions
func (c *Client[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) {
result := c.newObject()
err := c.client.Put().
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
Name(obj.GetName()).
@@ -253,6 +273,7 @@ func (c *Client[T]) Update(ctx context.Context, obj T, opts metav1.UpdateOptions
func (c *Client[T]) UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateOptions) (T, error) {
result := c.newObject()
err := c.client.Put().
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
Name(obj.GetName()).
@@ -267,6 +288,7 @@ func (c *Client[T]) UpdateStatus(ctx context.Context, obj T, opts metav1.UpdateO
// Delete takes name of the resource and deletes it. Returns an error if one occurs.
func (c *Client[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
Name(name).
@@ -282,6 +304,7 @@ func (l *alsoLister[T, L]) DeleteCollection(ctx context.Context, opts metav1.Del
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return l.client.client.Delete().
UseProtobufAsDefaultIfPreferred(l.client.prefersProtobuf).
NamespaceIfScoped(l.client.namespace, l.client.namespace != "").
Resource(l.client.resource).
VersionedParams(&listOpts, l.client.parameterCodec).
@@ -295,6 +318,7 @@ func (l *alsoLister[T, L]) DeleteCollection(ctx context.Context, opts metav1.Del
func (c *Client[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (T, error) {
result := c.newObject()
err := c.client.Patch(pt).
UseProtobufAsDefaultIfPreferred(c.prefersProtobuf).
NamespaceIfScoped(c.namespace, c.namespace != "").
Resource(c.resource).
Name(name).
@@ -321,6 +345,7 @@ func (a *alsoApplier[T, C]) Apply(ctx context.Context, obj C, opts metav1.ApplyO
return *new(T), fmt.Errorf("obj.Name must be provided to Apply")
}
err = a.client.client.Patch(types.ApplyPatchType).
UseProtobufAsDefaultIfPreferred(a.client.prefersProtobuf).
NamespaceIfScoped(a.client.namespace, a.client.namespace != "").
Resource(a.client.resource).
Name(*obj.GetName()).
@@ -348,6 +373,7 @@ func (a *alsoApplier[T, C]) ApplyStatus(ctx context.Context, obj C, opts metav1.
result := a.client.newObject()
err = a.client.client.Patch(types.ApplyPatchType).
UseProtobufAsDefaultIfPreferred(a.client.prefersProtobuf).
NamespaceIfScoped(a.client.namespace, a.client.namespace != "").
Resource(a.client.resource).
Name(*obj.GetName()).

26
go.mod
View File

@@ -15,23 +15,24 @@ require (
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.0
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
github.com/peterbourgon/diskv v2.0.1+incompatible
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
golang.org/x/net v0.28.0
golang.org/x/oauth2 v0.21.0
golang.org/x/term v0.23.0
golang.org/x/time v0.3.0
golang.org/x/net v0.30.0
golang.org/x/oauth2 v0.23.0
golang.org/x/term v0.25.0
golang.org/x/time v0.7.0
google.golang.org/protobuf v1.34.2
gopkg.in/evanphx/json-patch.v4 v4.12.0
k8s.io/api v0.32.0-alpha.1
k8s.io/apimachinery v0.32.0-alpha.1
k8s.io/api v0.32.0-alpha.3
k8s.io/apimachinery v0.32.0-alpha.3
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3
sigs.k8s.io/structured-merge-diff/v4 v4.4.1
sigs.k8s.io/yaml v1.4.0
)
@@ -50,18 +51,17 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/moby/spdystream v0.4.0 // indirect
github.com/moby/spdystream v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
golang.org/x/tools v0.26.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect

48
go.sum
View File

@@ -43,8 +43,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
@@ -60,8 +60,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
github.com/moby/spdystream v0.4.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -110,32 +110,32 @@ 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.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4=
golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
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/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.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24=
golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M=
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.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM=
golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ=
golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ=
golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0=
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=
@@ -155,18 +155,18 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.32.0-alpha.1 h1:IouDRwpvuSiAJYsnCd5ygwZEJ6fXjTCrv1ucDjANQxE=
k8s.io/api v0.32.0-alpha.1/go.mod h1:dsKOyESAQh5qN2gci8jE1kwo5wqnf1lgCZgj39TFVx4=
k8s.io/apimachinery v0.32.0-alpha.1 h1:tDR19SzOmCOKVWtNhFbUtz1Axrt/1JJu7MRFiaEEhF4=
k8s.io/apimachinery v0.32.0-alpha.1/go.mod h1:5rKPDwwN9qm//xASFCZ83nyYEanHxxhc7pZ8AC4lukY=
k8s.io/api v0.32.0-alpha.3 h1:SCix13lbG8n/cmbYeYp1vkmlS4ccgGwaq83Y7G603GY=
k8s.io/api v0.32.0-alpha.3/go.mod h1:e5tjATGvBey/pzjehc7Od+VJCiDJp0iajdkFhxvJD4I=
k8s.io/apimachinery v0.32.0-alpha.3 h1:AmhRgOkgXFBLu2prIySmIS4KLGFiZKzeMMxnPPtEhnA=
k8s.io/apimachinery v0.32.0-alpha.3/go.mod h1:y/FzDt/GaPgPceo5rJcCtD4qW5l8SwtbzESSMGEY6P8=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 h1:GKE9U8BH16uynoxQii0auTjmmmuZ3O0LFMN6S0lPPhI=
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2/go.mod h1:coRQXBK9NxO98XUv3ZD6AK3xzHCxV6+b7lrquKwaKzA=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A=
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4=
sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08=
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=

View File

@@ -374,8 +374,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=resource.k8s.io, Version=v1alpha3
case v1alpha3.SchemeGroupVersion.WithResource("deviceclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().DeviceClasses().Informer()}, nil
case v1alpha3.SchemeGroupVersion.WithResource("podschedulingcontexts"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().PodSchedulingContexts().Informer()}, nil
case v1alpha3.SchemeGroupVersion.WithResource("resourceclaims"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceClaims().Informer()}, nil
case v1alpha3.SchemeGroupVersion.WithResource("resourceclaimtemplates"):

View File

@@ -26,8 +26,6 @@ import (
type Interface interface {
// DeviceClasses returns a DeviceClassInformer.
DeviceClasses() DeviceClassInformer
// PodSchedulingContexts returns a PodSchedulingContextInformer.
PodSchedulingContexts() PodSchedulingContextInformer
// ResourceClaims returns a ResourceClaimInformer.
ResourceClaims() ResourceClaimInformer
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
@@ -52,11 +50,6 @@ func (v *version) DeviceClasses() DeviceClassInformer {
return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}
// PodSchedulingContexts returns a PodSchedulingContextInformer.
func (v *version) PodSchedulingContexts() PodSchedulingContextInformer {
return &podSchedulingContextInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// ResourceClaims returns a ResourceClaimInformer.
func (v *version) ResourceClaims() ResourceClaimInformer {
return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}

View File

@@ -1,90 +0,0 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha3
import (
context "context"
time "time"
apiresourcev1alpha3 "k8s.io/api/resource/v1alpha3"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
resourcev1alpha3 "k8s.io/client-go/listers/resource/v1alpha3"
cache "k8s.io/client-go/tools/cache"
)
// PodSchedulingContextInformer provides access to a shared informer and lister for
// PodSchedulingContexts.
type PodSchedulingContextInformer interface {
Informer() cache.SharedIndexInformer
Lister() resourcev1alpha3.PodSchedulingContextLister
}
type podSchedulingContextInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewPodSchedulingContextInformer constructs a new informer for PodSchedulingContext type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewPodSchedulingContextInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPodSchedulingContextInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredPodSchedulingContextInformer constructs a new informer for PodSchedulingContext type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredPodSchedulingContextInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ResourceV1alpha3().PodSchedulingContexts(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ResourceV1alpha3().PodSchedulingContexts(namespace).Watch(context.TODO(), options)
},
},
&apiresourcev1alpha3.PodSchedulingContext{},
resyncPeriod,
indexers,
)
}
func (f *podSchedulingContextInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPodSchedulingContextInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *podSchedulingContextInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&apiresourcev1alpha3.PodSchedulingContext{}, f.defaultInformer)
}
func (f *podSchedulingContextInformer) Lister() resourcev1alpha3.PodSchedulingContextLister {
return resourcev1alpha3.NewPodSchedulingContextLister(f.Informer().GetIndexer())
}

View File

@@ -103,7 +103,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := admissionregistrationv1.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()

View File

@@ -68,6 +68,8 @@ func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatin
},
func() *admissionregistrationv1.MutatingWebhookConfigurationList {
return &admissionregistrationv1.MutatingWebhookConfigurationList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1.MutatingWebhookConfiguration](),
),
}
}

View File

@@ -72,6 +72,8 @@ func newValidatingAdmissionPolicies(c *AdmissionregistrationV1Client) *validatin
},
func() *admissionregistrationv1.ValidatingAdmissionPolicyList {
return &admissionregistrationv1.ValidatingAdmissionPolicyList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1.ValidatingAdmissionPolicy](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1Client) *val
},
func() *admissionregistrationv1.ValidatingAdmissionPolicyBindingList {
return &admissionregistrationv1.ValidatingAdmissionPolicyBindingList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1.ValidatingAdmissionPolicyBinding](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *valid
},
func() *admissionregistrationv1.ValidatingWebhookConfigurationList {
return &admissionregistrationv1.ValidatingWebhookConfigurationList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1.ValidatingWebhookConfiguration](),
),
}
}

View File

@@ -93,7 +93,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := admissionregistrationv1alpha1.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()

View File

@@ -72,6 +72,8 @@ func newValidatingAdmissionPolicies(c *AdmissionregistrationV1alpha1Client) *val
},
func() *admissionregistrationv1alpha1.ValidatingAdmissionPolicyList {
return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1alpha1.ValidatingAdmissionPolicy](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1alpha1Client
},
func() *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingList {
return &admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1alpha1.ValidatingAdmissionPolicyBinding](),
),
}
}

View File

@@ -103,7 +103,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := admissionregistrationv1beta1.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()

View File

@@ -68,6 +68,8 @@ func newMutatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *mu
},
func() *admissionregistrationv1beta1.MutatingWebhookConfigurationList {
return &admissionregistrationv1beta1.MutatingWebhookConfigurationList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1beta1.MutatingWebhookConfiguration](),
),
}
}

View File

@@ -72,6 +72,8 @@ func newValidatingAdmissionPolicies(c *AdmissionregistrationV1beta1Client) *vali
},
func() *admissionregistrationv1beta1.ValidatingAdmissionPolicyList {
return &admissionregistrationv1beta1.ValidatingAdmissionPolicyList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1beta1.ValidatingAdmissionPolicy](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newValidatingAdmissionPolicyBindings(c *AdmissionregistrationV1beta1Client)
},
func() *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingList {
return &admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1beta1.ValidatingAdmissionPolicyBinding](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newValidatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *
},
func() *admissionregistrationv1beta1.ValidatingWebhookConfigurationList {
return &admissionregistrationv1beta1.ValidatingWebhookConfigurationList{}
}),
},
gentype.PrefersProtobuf[*admissionregistrationv1beta1.ValidatingWebhookConfiguration](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := apiserverinternalv1alpha1.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()

View File

@@ -70,6 +70,8 @@ func newStorageVersions(c *InternalV1alpha1Client) *storageVersions {
func() *apiserverinternalv1alpha1.StorageVersion { return &apiserverinternalv1alpha1.StorageVersion{} },
func() *apiserverinternalv1alpha1.StorageVersionList {
return &apiserverinternalv1alpha1.StorageVersionList{}
}),
},
gentype.PrefersProtobuf[*apiserverinternalv1alpha1.StorageVersion](),
),
}
}

View File

@@ -108,7 +108,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := appsv1.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()

View File

@@ -64,6 +64,8 @@ func newControllerRevisions(c *AppsV1Client, namespace string) *controllerRevisi
scheme.ParameterCodec,
namespace,
func() *appsv1.ControllerRevision { return &appsv1.ControllerRevision{} },
func() *appsv1.ControllerRevisionList { return &appsv1.ControllerRevisionList{} }),
func() *appsv1.ControllerRevisionList { return &appsv1.ControllerRevisionList{} },
gentype.PrefersProtobuf[*appsv1.ControllerRevision](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newDaemonSets(c *AppsV1Client, namespace string) *daemonSets {
scheme.ParameterCodec,
namespace,
func() *appsv1.DaemonSet { return &appsv1.DaemonSet{} },
func() *appsv1.DaemonSetList { return &appsv1.DaemonSetList{} }),
func() *appsv1.DaemonSetList { return &appsv1.DaemonSetList{} },
gentype.PrefersProtobuf[*appsv1.DaemonSet](),
),
}
}

View File

@@ -76,7 +76,9 @@ func newDeployments(c *AppsV1Client, namespace string) *deployments {
scheme.ParameterCodec,
namespace,
func() *appsv1.Deployment { return &appsv1.Deployment{} },
func() *appsv1.DeploymentList { return &appsv1.DeploymentList{} }),
func() *appsv1.DeploymentList { return &appsv1.DeploymentList{} },
gentype.PrefersProtobuf[*appsv1.Deployment](),
),
}
}
@@ -84,6 +86,7 @@ func newDeployments(c *AppsV1Client, namespace string) *deployments {
func (c *deployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Get().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("deployments").
Name(deploymentName).
@@ -98,6 +101,7 @@ func (c *deployments) GetScale(ctx context.Context, deploymentName string, optio
func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Put().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("deployments").
Name(deploymentName).
@@ -123,6 +127,7 @@ func (c *deployments) ApplyScale(ctx context.Context, deploymentName string, sca
result = &autoscalingv1.Scale{}
err = c.GetClient().Patch(types.ApplyPatchType).
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("deployments").
Name(deploymentName).

View File

@@ -76,7 +76,9 @@ func newReplicaSets(c *AppsV1Client, namespace string) *replicaSets {
scheme.ParameterCodec,
namespace,
func() *appsv1.ReplicaSet { return &appsv1.ReplicaSet{} },
func() *appsv1.ReplicaSetList { return &appsv1.ReplicaSetList{} }),
func() *appsv1.ReplicaSetList { return &appsv1.ReplicaSetList{} },
gentype.PrefersProtobuf[*appsv1.ReplicaSet](),
),
}
}
@@ -84,6 +86,7 @@ func newReplicaSets(c *AppsV1Client, namespace string) *replicaSets {
func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Get().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("replicasets").
Name(replicaSetName).
@@ -98,6 +101,7 @@ func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, optio
func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Put().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("replicasets").
Name(replicaSetName).
@@ -123,6 +127,7 @@ func (c *replicaSets) ApplyScale(ctx context.Context, replicaSetName string, sca
result = &autoscalingv1.Scale{}
err = c.GetClient().Patch(types.ApplyPatchType).
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("replicasets").
Name(replicaSetName).

View File

@@ -76,7 +76,9 @@ func newStatefulSets(c *AppsV1Client, namespace string) *statefulSets {
scheme.ParameterCodec,
namespace,
func() *appsv1.StatefulSet { return &appsv1.StatefulSet{} },
func() *appsv1.StatefulSetList { return &appsv1.StatefulSetList{} }),
func() *appsv1.StatefulSetList { return &appsv1.StatefulSetList{} },
gentype.PrefersProtobuf[*appsv1.StatefulSet](),
),
}
}
@@ -84,6 +86,7 @@ func newStatefulSets(c *AppsV1Client, namespace string) *statefulSets {
func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Get().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).
@@ -98,6 +101,7 @@ func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, opt
func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}
err = c.GetClient().Put().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).
@@ -123,6 +127,7 @@ func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, s
result = &autoscalingv1.Scale{}
err = c.GetClient().Patch(types.ApplyPatchType).
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).

View File

@@ -98,7 +98,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := appsv1beta1.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()

View File

@@ -64,6 +64,8 @@ func newControllerRevisions(c *AppsV1beta1Client, namespace string) *controllerR
scheme.ParameterCodec,
namespace,
func() *appsv1beta1.ControllerRevision { return &appsv1beta1.ControllerRevision{} },
func() *appsv1beta1.ControllerRevisionList { return &appsv1beta1.ControllerRevisionList{} }),
func() *appsv1beta1.ControllerRevisionList { return &appsv1beta1.ControllerRevisionList{} },
gentype.PrefersProtobuf[*appsv1beta1.ControllerRevision](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newDeployments(c *AppsV1beta1Client, namespace string) *deployments {
scheme.ParameterCodec,
namespace,
func() *appsv1beta1.Deployment { return &appsv1beta1.Deployment{} },
func() *appsv1beta1.DeploymentList { return &appsv1beta1.DeploymentList{} }),
func() *appsv1beta1.DeploymentList { return &appsv1beta1.DeploymentList{} },
gentype.PrefersProtobuf[*appsv1beta1.Deployment](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets {
scheme.ParameterCodec,
namespace,
func() *appsv1beta1.StatefulSet { return &appsv1beta1.StatefulSet{} },
func() *appsv1beta1.StatefulSetList { return &appsv1beta1.StatefulSetList{} }),
func() *appsv1beta1.StatefulSetList { return &appsv1beta1.StatefulSetList{} },
gentype.PrefersProtobuf[*appsv1beta1.StatefulSet](),
),
}
}

View File

@@ -108,7 +108,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := appsv1beta2.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()

View File

@@ -64,6 +64,8 @@ func newControllerRevisions(c *AppsV1beta2Client, namespace string) *controllerR
scheme.ParameterCodec,
namespace,
func() *appsv1beta2.ControllerRevision { return &appsv1beta2.ControllerRevision{} },
func() *appsv1beta2.ControllerRevisionList { return &appsv1beta2.ControllerRevisionList{} }),
func() *appsv1beta2.ControllerRevisionList { return &appsv1beta2.ControllerRevisionList{} },
gentype.PrefersProtobuf[*appsv1beta2.ControllerRevision](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newDaemonSets(c *AppsV1beta2Client, namespace string) *daemonSets {
scheme.ParameterCodec,
namespace,
func() *appsv1beta2.DaemonSet { return &appsv1beta2.DaemonSet{} },
func() *appsv1beta2.DaemonSetList { return &appsv1beta2.DaemonSetList{} }),
func() *appsv1beta2.DaemonSetList { return &appsv1beta2.DaemonSetList{} },
gentype.PrefersProtobuf[*appsv1beta2.DaemonSet](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newDeployments(c *AppsV1beta2Client, namespace string) *deployments {
scheme.ParameterCodec,
namespace,
func() *appsv1beta2.Deployment { return &appsv1beta2.Deployment{} },
func() *appsv1beta2.DeploymentList { return &appsv1beta2.DeploymentList{} }),
func() *appsv1beta2.DeploymentList { return &appsv1beta2.DeploymentList{} },
gentype.PrefersProtobuf[*appsv1beta2.Deployment](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newReplicaSets(c *AppsV1beta2Client, namespace string) *replicaSets {
scheme.ParameterCodec,
namespace,
func() *appsv1beta2.ReplicaSet { return &appsv1beta2.ReplicaSet{} },
func() *appsv1beta2.ReplicaSetList { return &appsv1beta2.ReplicaSetList{} }),
func() *appsv1beta2.ReplicaSetList { return &appsv1beta2.ReplicaSetList{} },
gentype.PrefersProtobuf[*appsv1beta2.ReplicaSet](),
),
}
}

View File

@@ -74,7 +74,9 @@ func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets {
scheme.ParameterCodec,
namespace,
func() *appsv1beta2.StatefulSet { return &appsv1beta2.StatefulSet{} },
func() *appsv1beta2.StatefulSetList { return &appsv1beta2.StatefulSetList{} }),
func() *appsv1beta2.StatefulSetList { return &appsv1beta2.StatefulSetList{} },
gentype.PrefersProtobuf[*appsv1beta2.StatefulSet](),
),
}
}
@@ -82,6 +84,7 @@ func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets {
func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *appsv1beta2.Scale, err error) {
result = &appsv1beta2.Scale{}
err = c.GetClient().Get().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).
@@ -96,6 +99,7 @@ func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, opt
func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.Scale, opts v1.UpdateOptions) (result *appsv1beta2.Scale, err error) {
result = &appsv1beta2.Scale{}
err = c.GetClient().Put().
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).
@@ -121,6 +125,7 @@ func (c *statefulSets) ApplyScale(ctx context.Context, statefulSetName string, s
result = &appsv1beta2.Scale{}
err = c.GetClient().Patch(types.ApplyPatchType).
UseProtobufAsDefault().
Namespace(c.GetNamespace()).
Resource("statefulsets").
Name(statefulSetName).

View File

@@ -93,7 +93,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := authenticationv1.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()

View File

@@ -52,6 +52,8 @@ func newSelfSubjectReviews(c *AuthenticationV1Client) *selfSubjectReviews {
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authenticationv1.SelfSubjectReview { return &authenticationv1.SelfSubjectReview{} }),
func() *authenticationv1.SelfSubjectReview { return &authenticationv1.SelfSubjectReview{} },
gentype.PrefersProtobuf[*authenticationv1.SelfSubjectReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newTokenReviews(c *AuthenticationV1Client) *tokenReviews {
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authenticationv1.TokenReview { return &authenticationv1.TokenReview{} }),
func() *authenticationv1.TokenReview { return &authenticationv1.TokenReview{} },
gentype.PrefersProtobuf[*authenticationv1.TokenReview](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := authenticationv1alpha1.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()

View File

@@ -52,6 +52,8 @@ func newSelfSubjectReviews(c *AuthenticationV1alpha1Client) *selfSubjectReviews
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authenticationv1alpha1.SelfSubjectReview { return &authenticationv1alpha1.SelfSubjectReview{} }),
func() *authenticationv1alpha1.SelfSubjectReview { return &authenticationv1alpha1.SelfSubjectReview{} },
gentype.PrefersProtobuf[*authenticationv1alpha1.SelfSubjectReview](),
),
}
}

View File

@@ -93,7 +93,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := authenticationv1beta1.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()

View File

@@ -52,6 +52,8 @@ func newSelfSubjectReviews(c *AuthenticationV1beta1Client) *selfSubjectReviews {
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authenticationv1beta1.SelfSubjectReview { return &authenticationv1beta1.SelfSubjectReview{} }),
func() *authenticationv1beta1.SelfSubjectReview { return &authenticationv1beta1.SelfSubjectReview{} },
gentype.PrefersProtobuf[*authenticationv1beta1.SelfSubjectReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews {
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authenticationv1beta1.TokenReview { return &authenticationv1beta1.TokenReview{} }),
func() *authenticationv1beta1.TokenReview { return &authenticationv1beta1.TokenReview{} },
gentype.PrefersProtobuf[*authenticationv1beta1.TokenReview](),
),
}
}

View File

@@ -103,7 +103,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := authorizationv1.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()

View File

@@ -52,6 +52,8 @@ func newLocalSubjectAccessReviews(c *AuthorizationV1Client, namespace string) *l
c.RESTClient(),
scheme.ParameterCodec,
namespace,
func() *authorizationv1.LocalSubjectAccessReview { return &authorizationv1.LocalSubjectAccessReview{} }),
func() *authorizationv1.LocalSubjectAccessReview { return &authorizationv1.LocalSubjectAccessReview{} },
gentype.PrefersProtobuf[*authorizationv1.LocalSubjectAccessReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newSelfSubjectAccessReviews(c *AuthorizationV1Client) *selfSubjectAccessRev
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authorizationv1.SelfSubjectAccessReview { return &authorizationv1.SelfSubjectAccessReview{} }),
func() *authorizationv1.SelfSubjectAccessReview { return &authorizationv1.SelfSubjectAccessReview{} },
gentype.PrefersProtobuf[*authorizationv1.SelfSubjectAccessReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newSelfSubjectRulesReviews(c *AuthorizationV1Client) *selfSubjectRulesRevie
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authorizationv1.SelfSubjectRulesReview { return &authorizationv1.SelfSubjectRulesReview{} }),
func() *authorizationv1.SelfSubjectRulesReview { return &authorizationv1.SelfSubjectRulesReview{} },
gentype.PrefersProtobuf[*authorizationv1.SelfSubjectRulesReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newSubjectAccessReviews(c *AuthorizationV1Client) *subjectAccessReviews {
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authorizationv1.SubjectAccessReview { return &authorizationv1.SubjectAccessReview{} }),
func() *authorizationv1.SubjectAccessReview { return &authorizationv1.SubjectAccessReview{} },
gentype.PrefersProtobuf[*authorizationv1.SubjectAccessReview](),
),
}
}

View File

@@ -103,7 +103,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := authorizationv1beta1.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()

View File

@@ -54,6 +54,8 @@ func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace strin
namespace,
func() *authorizationv1beta1.LocalSubjectAccessReview {
return &authorizationv1beta1.LocalSubjectAccessReview{}
}),
},
gentype.PrefersProtobuf[*authorizationv1beta1.LocalSubjectAccessReview](),
),
}
}

View File

@@ -54,6 +54,8 @@ func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAcce
"",
func() *authorizationv1beta1.SelfSubjectAccessReview {
return &authorizationv1beta1.SelfSubjectAccessReview{}
}),
},
gentype.PrefersProtobuf[*authorizationv1beta1.SelfSubjectAccessReview](),
),
}
}

View File

@@ -54,6 +54,8 @@ func newSelfSubjectRulesReviews(c *AuthorizationV1beta1Client) *selfSubjectRules
"",
func() *authorizationv1beta1.SelfSubjectRulesReview {
return &authorizationv1beta1.SelfSubjectRulesReview{}
}),
},
gentype.PrefersProtobuf[*authorizationv1beta1.SelfSubjectRulesReview](),
),
}
}

View File

@@ -52,6 +52,8 @@ func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReview
c.RESTClient(),
scheme.ParameterCodec,
"",
func() *authorizationv1beta1.SubjectAccessReview { return &authorizationv1beta1.SubjectAccessReview{} }),
func() *authorizationv1beta1.SubjectAccessReview { return &authorizationv1beta1.SubjectAccessReview{} },
gentype.PrefersProtobuf[*authorizationv1beta1.SubjectAccessReview](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := autoscalingv1.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()

View File

@@ -68,6 +68,8 @@ func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *hori
scheme.ParameterCodec,
namespace,
func() *autoscalingv1.HorizontalPodAutoscaler { return &autoscalingv1.HorizontalPodAutoscaler{} },
func() *autoscalingv1.HorizontalPodAutoscalerList { return &autoscalingv1.HorizontalPodAutoscalerList{} }),
func() *autoscalingv1.HorizontalPodAutoscalerList { return &autoscalingv1.HorizontalPodAutoscalerList{} },
gentype.PrefersProtobuf[*autoscalingv1.HorizontalPodAutoscaler](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := autoscalingv2.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()

View File

@@ -68,6 +68,8 @@ func newHorizontalPodAutoscalers(c *AutoscalingV2Client, namespace string) *hori
scheme.ParameterCodec,
namespace,
func() *autoscalingv2.HorizontalPodAutoscaler { return &autoscalingv2.HorizontalPodAutoscaler{} },
func() *autoscalingv2.HorizontalPodAutoscalerList { return &autoscalingv2.HorizontalPodAutoscalerList{} }),
func() *autoscalingv2.HorizontalPodAutoscalerList { return &autoscalingv2.HorizontalPodAutoscalerList{} },
gentype.PrefersProtobuf[*autoscalingv2.HorizontalPodAutoscaler](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := autoscalingv2beta1.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()

View File

@@ -72,6 +72,8 @@ func newHorizontalPodAutoscalers(c *AutoscalingV2beta1Client, namespace string)
},
func() *autoscalingv2beta1.HorizontalPodAutoscalerList {
return &autoscalingv2beta1.HorizontalPodAutoscalerList{}
}),
},
gentype.PrefersProtobuf[*autoscalingv2beta1.HorizontalPodAutoscaler](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := autoscalingv2beta2.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()

View File

@@ -72,6 +72,8 @@ func newHorizontalPodAutoscalers(c *AutoscalingV2beta2Client, namespace string)
},
func() *autoscalingv2beta2.HorizontalPodAutoscalerList {
return &autoscalingv2beta2.HorizontalPodAutoscalerList{}
}),
},
gentype.PrefersProtobuf[*autoscalingv2beta2.HorizontalPodAutoscaler](),
),
}
}

View File

@@ -93,7 +93,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := batchv1.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()

View File

@@ -68,6 +68,8 @@ func newCronJobs(c *BatchV1Client, namespace string) *cronJobs {
scheme.ParameterCodec,
namespace,
func() *batchv1.CronJob { return &batchv1.CronJob{} },
func() *batchv1.CronJobList { return &batchv1.CronJobList{} }),
func() *batchv1.CronJobList { return &batchv1.CronJobList{} },
gentype.PrefersProtobuf[*batchv1.CronJob](),
),
}
}

View File

@@ -68,6 +68,8 @@ func newJobs(c *BatchV1Client, namespace string) *jobs {
scheme.ParameterCodec,
namespace,
func() *batchv1.Job { return &batchv1.Job{} },
func() *batchv1.JobList { return &batchv1.JobList{} }),
func() *batchv1.JobList { return &batchv1.JobList{} },
gentype.PrefersProtobuf[*batchv1.Job](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := batchv1beta1.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()

View File

@@ -68,6 +68,8 @@ func newCronJobs(c *BatchV1beta1Client, namespace string) *cronJobs {
scheme.ParameterCodec,
namespace,
func() *batchv1beta1.CronJob { return &batchv1beta1.CronJob{} },
func() *batchv1beta1.CronJobList { return &batchv1beta1.CronJobList{} }),
func() *batchv1beta1.CronJobList { return &batchv1beta1.CronJobList{} },
gentype.PrefersProtobuf[*batchv1beta1.CronJob](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := certificatesv1.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()

View File

@@ -72,7 +72,9 @@ func newCertificateSigningRequests(c *CertificatesV1Client) *certificateSigningR
func() *certificatesv1.CertificateSigningRequest { return &certificatesv1.CertificateSigningRequest{} },
func() *certificatesv1.CertificateSigningRequestList {
return &certificatesv1.CertificateSigningRequestList{}
}),
},
gentype.PrefersProtobuf[*certificatesv1.CertificateSigningRequest](),
),
}
}
@@ -80,6 +82,7 @@ func newCertificateSigningRequests(c *CertificatesV1Client) *certificateSigningR
func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificatesv1.CertificateSigningRequest, err error) {
result = &certificatesv1.CertificateSigningRequest{}
err = c.GetClient().Put().
UseProtobufAsDefault().
Resource("certificatesigningrequests").
Name(certificateSigningRequestName).
SubResource("approval").

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := certificatesv1alpha1.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()

View File

@@ -66,6 +66,8 @@ func newClusterTrustBundles(c *CertificatesV1alpha1Client) *clusterTrustBundles
func() *certificatesv1alpha1.ClusterTrustBundle { return &certificatesv1alpha1.ClusterTrustBundle{} },
func() *certificatesv1alpha1.ClusterTrustBundleList {
return &certificatesv1alpha1.ClusterTrustBundleList{}
}),
},
gentype.PrefersProtobuf[*certificatesv1alpha1.ClusterTrustBundle](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := certificatesv1beta1.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()

View File

@@ -72,6 +72,8 @@ func newCertificateSigningRequests(c *CertificatesV1beta1Client) *certificateSig
},
func() *certificatesv1beta1.CertificateSigningRequestList {
return &certificatesv1beta1.CertificateSigningRequestList{}
}),
},
gentype.PrefersProtobuf[*certificatesv1beta1.CertificateSigningRequest](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := coordinationv1.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()

View File

@@ -64,6 +64,8 @@ func newLeases(c *CoordinationV1Client, namespace string) *leases {
scheme.ParameterCodec,
namespace,
func() *coordinationv1.Lease { return &coordinationv1.Lease{} },
func() *coordinationv1.LeaseList { return &coordinationv1.LeaseList{} }),
func() *coordinationv1.LeaseList { return &coordinationv1.LeaseList{} },
gentype.PrefersProtobuf[*coordinationv1.Lease](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := coordinationv1alpha1.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()

View File

@@ -64,6 +64,8 @@ func newLeaseCandidates(c *CoordinationV1alpha1Client, namespace string) *leaseC
scheme.ParameterCodec,
namespace,
func() *coordinationv1alpha1.LeaseCandidate { return &coordinationv1alpha1.LeaseCandidate{} },
func() *coordinationv1alpha1.LeaseCandidateList { return &coordinationv1alpha1.LeaseCandidateList{} }),
func() *coordinationv1alpha1.LeaseCandidateList { return &coordinationv1alpha1.LeaseCandidateList{} },
gentype.PrefersProtobuf[*coordinationv1alpha1.LeaseCandidate](),
),
}
}

View File

@@ -88,7 +88,7 @@ func setConfigDefaults(config *rest.Config) error {
gv := coordinationv1beta1.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()

View File

@@ -64,6 +64,8 @@ func newLeases(c *CoordinationV1beta1Client, namespace string) *leases {
scheme.ParameterCodec,
namespace,
func() *coordinationv1beta1.Lease { return &coordinationv1beta1.Lease{} },
func() *coordinationv1beta1.LeaseList { return &coordinationv1beta1.LeaseList{} }),
func() *coordinationv1beta1.LeaseList { return &coordinationv1beta1.LeaseList{} },
gentype.PrefersProtobuf[*coordinationv1beta1.Lease](),
),
}
}

View File

@@ -64,6 +64,8 @@ func newComponentStatuses(c *CoreV1Client) *componentStatuses {
scheme.ParameterCodec,
"",
func() *corev1.ComponentStatus { return &corev1.ComponentStatus{} },
func() *corev1.ComponentStatusList { return &corev1.ComponentStatusList{} }),
func() *corev1.ComponentStatusList { return &corev1.ComponentStatusList{} },
gentype.PrefersProtobuf[*corev1.ComponentStatus](),
),
}
}

View File

@@ -64,6 +64,8 @@ func newConfigMaps(c *CoreV1Client, namespace string) *configMaps {
scheme.ParameterCodec,
namespace,
func() *corev1.ConfigMap { return &corev1.ConfigMap{} },
func() *corev1.ConfigMapList { return &corev1.ConfigMapList{} }),
func() *corev1.ConfigMapList { return &corev1.ConfigMapList{} },
gentype.PrefersProtobuf[*corev1.ConfigMap](),
),
}
}

Some files were not shown because too many files have changed in this diff Show More