mirror of
https://github.com/kubernetes/client-go.git
synced 2026-06-16 14:56:00 +00:00
Compare commits
1 Commits
v0.32.0
...
v0.32.0-be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42722cdad2 |
@@ -16,10 +16,10 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
coordinationv1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
managedfields "k8s.io/apimachinery/pkg/util/managedfields"
|
||||
@@ -42,7 +42,7 @@ func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration {
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("LeaseCandidate")
|
||||
b.WithAPIVersion("coordination.k8s.io/v1alpha2")
|
||||
b.WithAPIVersion("coordination.k8s.io/v1alpha1")
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -57,20 +57,20 @@ func LeaseCandidate(name, namespace string) *LeaseCandidateApplyConfiguration {
|
||||
// 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 ExtractLeaseCandidate(leaseCandidate *coordinationv1alpha2.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
func ExtractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
return extractLeaseCandidate(leaseCandidate, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractLeaseCandidateStatus is the same as ExtractLeaseCandidate except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1alpha2.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
func ExtractLeaseCandidateStatus(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
return extractLeaseCandidate(leaseCandidate, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractLeaseCandidate(leaseCandidate *coordinationv1alpha2.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
func extractLeaseCandidate(leaseCandidate *coordinationv1alpha1.LeaseCandidate, fieldManager string, subresource string) (*LeaseCandidateApplyConfiguration, error) {
|
||||
b := &LeaseCandidateApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1alpha2.LeaseCandidate"), fieldManager, b, subresource)
|
||||
err := managedfields.ExtractInto(leaseCandidate, internal.Parser().Type("io.k8s.api.coordination.v1alpha1.LeaseCandidate"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func extractLeaseCandidate(leaseCandidate *coordinationv1alpha2.LeaseCandidate,
|
||||
b.WithNamespace(leaseCandidate.Namespace)
|
||||
|
||||
b.WithKind("LeaseCandidate")
|
||||
b.WithAPIVersion("coordination.k8s.io/v1alpha2")
|
||||
b.WithAPIVersion("coordination.k8s.io/v1alpha1")
|
||||
return b, nil
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by applyconfiguration-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
@@ -26,12 +26,12 @@ import (
|
||||
// LeaseCandidateSpecApplyConfiguration represents a declarative configuration of the LeaseCandidateSpec type for use
|
||||
// with apply.
|
||||
type LeaseCandidateSpecApplyConfiguration struct {
|
||||
LeaseName *string `json:"leaseName,omitempty"`
|
||||
PingTime *v1.MicroTime `json:"pingTime,omitempty"`
|
||||
RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
|
||||
BinaryVersion *string `json:"binaryVersion,omitempty"`
|
||||
EmulationVersion *string `json:"emulationVersion,omitempty"`
|
||||
Strategy *coordinationv1.CoordinatedLeaseStrategy `json:"strategy,omitempty"`
|
||||
LeaseName *string `json:"leaseName,omitempty"`
|
||||
PingTime *v1.MicroTime `json:"pingTime,omitempty"`
|
||||
RenewTime *v1.MicroTime `json:"renewTime,omitempty"`
|
||||
BinaryVersion *string `json:"binaryVersion,omitempty"`
|
||||
EmulationVersion *string `json:"emulationVersion,omitempty"`
|
||||
PreferredStrategies []coordinationv1.CoordinatedLeaseStrategy `json:"preferredStrategies,omitempty"`
|
||||
}
|
||||
|
||||
// LeaseCandidateSpecApplyConfiguration constructs a declarative configuration of the LeaseCandidateSpec type for use with
|
||||
@@ -80,10 +80,12 @@ func (b *LeaseCandidateSpecApplyConfiguration) WithEmulationVersion(value string
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStrategy sets the Strategy 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 Strategy field is set to the value of the last call.
|
||||
func (b *LeaseCandidateSpecApplyConfiguration) WithStrategy(value coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration {
|
||||
b.Strategy = &value
|
||||
// WithPreferredStrategies adds the given value to the PreferredStrategies 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 PreferredStrategies field.
|
||||
func (b *LeaseCandidateSpecApplyConfiguration) WithPreferredStrategies(values ...coordinationv1.CoordinatedLeaseStrategy) *LeaseCandidateSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
b.PreferredStrategies = append(b.PreferredStrategies, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -64,7 +64,6 @@ type PodSpecApplyConfiguration struct {
|
||||
HostUsers *bool `json:"hostUsers,omitempty"`
|
||||
SchedulingGates []PodSchedulingGateApplyConfiguration `json:"schedulingGates,omitempty"`
|
||||
ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"`
|
||||
Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"`
|
||||
}
|
||||
|
||||
// PodSpecApplyConfiguration constructs a declarative configuration of the PodSpec type for use with
|
||||
@@ -445,11 +444,3 @@ func (b *PodSpecApplyConfiguration) WithResourceClaims(values ...*PodResourceCla
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResources sets the Resources 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 Resources field is set to the value of the last call.
|
||||
func (b *PodSpecApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *PodSpecApplyConfiguration {
|
||||
b.Resources = value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -4471,7 +4471,7 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: strategy
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.coordination.v1alpha2.LeaseCandidate
|
||||
- name: io.k8s.api.coordination.v1alpha1.LeaseCandidate
|
||||
map:
|
||||
fields:
|
||||
- name: apiVersion
|
||||
@@ -4486,15 +4486,14 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.coordination.v1alpha2.LeaseCandidateSpec
|
||||
namedType: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.coordination.v1alpha2.LeaseCandidateSpec
|
||||
- name: io.k8s.api.coordination.v1alpha1.LeaseCandidateSpec
|
||||
map:
|
||||
fields:
|
||||
- name: binaryVersion
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: emulationVersion
|
||||
type:
|
||||
scalar: string
|
||||
@@ -4505,12 +4504,15 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: pingTime
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime
|
||||
- name: preferredStrategies
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: renewTime
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime
|
||||
- name: strategy
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.coordination.v1beta1.Lease
|
||||
map:
|
||||
fields:
|
||||
@@ -7167,9 +7169,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- name
|
||||
- name: resources
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.ResourceRequirements
|
||||
- name: restartPolicy
|
||||
type:
|
||||
scalar: string
|
||||
@@ -12354,35 +12353,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: namespace
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1alpha3.AllocatedDeviceStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: data
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: device
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: networkData
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.NetworkDeviceData
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1alpha3.AllocationResult
|
||||
map:
|
||||
fields:
|
||||
@@ -12606,21 +12576,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: cel
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.CELDeviceSelector
|
||||
- name: io.k8s.api.resource.v1alpha3.NetworkDeviceData
|
||||
map:
|
||||
fields:
|
||||
- name: hardwareAddress
|
||||
type:
|
||||
scalar: string
|
||||
- name: interfaceName
|
||||
type:
|
||||
scalar: string
|
||||
- name: ips
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1alpha3.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
@@ -12683,16 +12638,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: allocation
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.AllocationResult
|
||||
- name: devices
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1alpha3.AllocatedDeviceStatus
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- driver
|
||||
- device
|
||||
- pool
|
||||
- name: reservedFor
|
||||
type:
|
||||
list:
|
||||
@@ -12787,445 +12732,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1alpha3.ResourcePool
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
|
||||
map:
|
||||
fields:
|
||||
- name: conditions
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- type
|
||||
- name: data
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: device
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: networkData
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.NetworkDeviceData
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.AllocationResult
|
||||
map:
|
||||
fields:
|
||||
- name: devices
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceAllocationResult
|
||||
default: {}
|
||||
- name: nodeSelector
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeSelector
|
||||
- name: io.k8s.api.resource.v1beta1.BasicDevice
|
||||
map:
|
||||
fields:
|
||||
- name: attributes
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceAttribute
|
||||
- name: capacity
|
||||
type:
|
||||
map:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceCapacity
|
||||
- name: io.k8s.api.resource.v1beta1.CELDeviceSelector
|
||||
map:
|
||||
fields:
|
||||
- name: expression
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.Device
|
||||
map:
|
||||
fields:
|
||||
- name: basic
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.BasicDevice
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceAllocationConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: opaque
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
- name: requests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: source
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceAllocationResult
|
||||
map:
|
||||
fields:
|
||||
- name: config
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceAllocationConfiguration
|
||||
elementRelationship: atomic
|
||||
- name: results
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceRequestAllocationResult
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceAttribute
|
||||
map:
|
||||
fields:
|
||||
- name: bool
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: int
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: string
|
||||
type:
|
||||
scalar: string
|
||||
- name: version
|
||||
type:
|
||||
scalar: string
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceCapacity
|
||||
map:
|
||||
fields:
|
||||
- name: value
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.api.resource.Quantity
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceClaim
|
||||
map:
|
||||
fields:
|
||||
- name: config
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceClaimConfiguration
|
||||
elementRelationship: atomic
|
||||
- name: constraints
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceConstraint
|
||||
elementRelationship: atomic
|
||||
- name: requests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceRequest
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceClaimConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: opaque
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
- name: requests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceClass
|
||||
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.v1beta1.DeviceClassSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceClassConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: opaque
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceClassSpec
|
||||
map:
|
||||
fields:
|
||||
- name: config
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceClassConfiguration
|
||||
elementRelationship: atomic
|
||||
- name: selectors
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceSelector
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceConstraint
|
||||
map:
|
||||
fields:
|
||||
- name: matchAttribute
|
||||
type:
|
||||
scalar: string
|
||||
- name: requests
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceRequest
|
||||
map:
|
||||
fields:
|
||||
- name: adminAccess
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: allocationMode
|
||||
type:
|
||||
scalar: string
|
||||
- name: count
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: deviceClassName
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: selectors
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceSelector
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceRequestAllocationResult
|
||||
map:
|
||||
fields:
|
||||
- name: adminAccess
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: device
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: pool
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: request
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.DeviceSelector
|
||||
map:
|
||||
fields:
|
||||
- name: cel
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.CELDeviceSelector
|
||||
- name: io.k8s.api.resource.v1beta1.NetworkDeviceData
|
||||
map:
|
||||
fields:
|
||||
- name: hardwareAddress
|
||||
type:
|
||||
scalar: string
|
||||
- name: interfaceName
|
||||
type:
|
||||
scalar: string
|
||||
- name: ips
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
scalar: string
|
||||
elementRelationship: atomic
|
||||
- name: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration
|
||||
map:
|
||||
fields:
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: parameters
|
||||
type:
|
||||
namedType: __untyped_atomic_
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaim
|
||||
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.v1beta1.ResourceClaimSpec
|
||||
default: {}
|
||||
- name: status
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.ResourceClaimStatus
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaimConsumerReference
|
||||
map:
|
||||
fields:
|
||||
- name: apiGroup
|
||||
type:
|
||||
scalar: string
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resource
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: uid
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaimSpec
|
||||
map:
|
||||
fields:
|
||||
- name: devices
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.DeviceClaim
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaimStatus
|
||||
map:
|
||||
fields:
|
||||
- name: allocation
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.AllocationResult
|
||||
- name: devices
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- driver
|
||||
- device
|
||||
- pool
|
||||
- name: reservedFor
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.ResourceClaimConsumerReference
|
||||
elementRelationship: associative
|
||||
keys:
|
||||
- uid
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaimTemplate
|
||||
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.v1beta1.ResourceClaimTemplateSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceClaimTemplateSpec
|
||||
map:
|
||||
fields:
|
||||
- name: metadata
|
||||
type:
|
||||
namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta
|
||||
default: {}
|
||||
- name: spec
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.ResourceClaimSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.ResourcePool
|
||||
map:
|
||||
fields:
|
||||
- name: generation
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: name
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: resourceSliceCount
|
||||
type:
|
||||
scalar: numeric
|
||||
default: 0
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceSlice
|
||||
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.v1beta1.ResourceSliceSpec
|
||||
default: {}
|
||||
- name: io.k8s.api.resource.v1beta1.ResourceSliceSpec
|
||||
map:
|
||||
fields:
|
||||
- name: allNodes
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: devices
|
||||
type:
|
||||
list:
|
||||
elementType:
|
||||
namedType: io.k8s.api.resource.v1beta1.Device
|
||||
elementRelationship: atomic
|
||||
- name: driver
|
||||
type:
|
||||
scalar: string
|
||||
default: ""
|
||||
- name: nodeName
|
||||
type:
|
||||
scalar: string
|
||||
- name: nodeSelector
|
||||
type:
|
||||
namedType: io.k8s.api.core.v1.NodeSelector
|
||||
- name: pool
|
||||
type:
|
||||
namedType: io.k8s.api.resource.v1beta1.ResourcePool
|
||||
default: {}
|
||||
- name: io.k8s.api.scheduling.v1.PriorityClass
|
||||
map:
|
||||
fields:
|
||||
@@ -14075,9 +13581,6 @@ var schemaYAML = typed.YAMLObject(`types:
|
||||
- name: gracePeriodSeconds
|
||||
type:
|
||||
scalar: numeric
|
||||
- name: ignoreStoreReadErrorWithClusterBreakingPotential
|
||||
type:
|
||||
scalar: boolean
|
||||
- name: kind
|
||||
type:
|
||||
scalar: string
|
||||
|
||||
@@ -25,13 +25,12 @@ import (
|
||||
// DeleteOptionsApplyConfiguration represents a declarative configuration of the DeleteOptions type for use
|
||||
// with apply.
|
||||
type DeleteOptionsApplyConfiguration struct {
|
||||
TypeMetaApplyConfiguration `json:",inline"`
|
||||
GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"`
|
||||
Preconditions *PreconditionsApplyConfiguration `json:"preconditions,omitempty"`
|
||||
OrphanDependents *bool `json:"orphanDependents,omitempty"`
|
||||
PropagationPolicy *metav1.DeletionPropagation `json:"propagationPolicy,omitempty"`
|
||||
DryRun []string `json:"dryRun,omitempty"`
|
||||
IgnoreStoreReadErrorWithClusterBreakingPotential *bool `json:"ignoreStoreReadErrorWithClusterBreakingPotential,omitempty"`
|
||||
TypeMetaApplyConfiguration `json:",inline"`
|
||||
GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"`
|
||||
Preconditions *PreconditionsApplyConfiguration `json:"preconditions,omitempty"`
|
||||
OrphanDependents *bool `json:"orphanDependents,omitempty"`
|
||||
PropagationPolicy *metav1.DeletionPropagation `json:"propagationPolicy,omitempty"`
|
||||
DryRun []string `json:"dryRun,omitempty"`
|
||||
}
|
||||
|
||||
// DeleteOptionsApplyConfiguration constructs a declarative configuration of the DeleteOptions type for use with
|
||||
@@ -100,11 +99,3 @@ func (b *DeleteOptionsApplyConfiguration) WithDryRun(values ...string) *DeleteOp
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIgnoreStoreReadErrorWithClusterBreakingPotential sets the IgnoreStoreReadErrorWithClusterBreakingPotential 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 IgnoreStoreReadErrorWithClusterBreakingPotential field is set to the value of the last call.
|
||||
func (b *DeleteOptionsApplyConfiguration) WithIgnoreStoreReadErrorWithClusterBreakingPotential(value bool) *DeleteOptionsApplyConfiguration {
|
||||
b.IgnoreStoreReadErrorWithClusterBreakingPotential = &value
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -1,94 +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 (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// AllocatedDeviceStatusApplyConfiguration represents a declarative configuration of the AllocatedDeviceStatus type for use
|
||||
// with apply.
|
||||
type AllocatedDeviceStatusApplyConfiguration struct {
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
Pool *string `json:"pool,omitempty"`
|
||||
Device *string `json:"device,omitempty"`
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
Data *runtime.RawExtension `json:"data,omitempty"`
|
||||
NetworkData *NetworkDeviceDataApplyConfiguration `json:"networkData,omitempty"`
|
||||
}
|
||||
|
||||
// AllocatedDeviceStatusApplyConfiguration constructs a declarative configuration of the AllocatedDeviceStatus type for use with
|
||||
// apply.
|
||||
func AllocatedDeviceStatus() *AllocatedDeviceStatusApplyConfiguration {
|
||||
return &AllocatedDeviceStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithDriver(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPool sets the Pool 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 Pool field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithPool(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Pool = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevice sets the Device 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 Device field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithDevice(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Device = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithData sets the Data 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 Data field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithData(value runtime.RawExtension) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Data = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNetworkData sets the NetworkData 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 NetworkData field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithNetworkData(value *NetworkDeviceDataApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.NetworkData = value
|
||||
return b
|
||||
}
|
||||
@@ -1,59 +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
|
||||
|
||||
// NetworkDeviceDataApplyConfiguration represents a declarative configuration of the NetworkDeviceData type for use
|
||||
// with apply.
|
||||
type NetworkDeviceDataApplyConfiguration struct {
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkDeviceDataApplyConfiguration constructs a declarative configuration of the NetworkDeviceData type for use with
|
||||
// apply.
|
||||
func NetworkDeviceData() *NetworkDeviceDataApplyConfiguration {
|
||||
return &NetworkDeviceDataApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithInterfaceName sets the InterfaceName 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 InterfaceName field is set to the value of the last call.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithInterfaceName(value string) *NetworkDeviceDataApplyConfiguration {
|
||||
b.InterfaceName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIPs adds the given value to the IPs 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 IPs field.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithIPs(values ...string) *NetworkDeviceDataApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IPs = append(b.IPs, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithHardwareAddress sets the HardwareAddress 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 HardwareAddress field is set to the value of the last call.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithHardwareAddress(value string) *NetworkDeviceDataApplyConfiguration {
|
||||
b.HardwareAddress = &value
|
||||
return b
|
||||
}
|
||||
@@ -23,7 +23,6 @@ package v1alpha3
|
||||
type ResourceClaimStatusApplyConfiguration struct {
|
||||
Allocation *AllocationResultApplyConfiguration `json:"allocation,omitempty"`
|
||||
ReservedFor []ResourceClaimConsumerReferenceApplyConfiguration `json:"reservedFor,omitempty"`
|
||||
Devices []AllocatedDeviceStatusApplyConfiguration `json:"devices,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with
|
||||
@@ -52,16 +51,3 @@ func (b *ResourceClaimStatusApplyConfiguration) WithReservedFor(values ...*Resou
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevices adds the given value to the Devices 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 Devices field.
|
||||
func (b *ResourceClaimStatusApplyConfiguration) WithDevices(values ...*AllocatedDeviceStatusApplyConfiguration) *ResourceClaimStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithDevices")
|
||||
}
|
||||
b.Devices = append(b.Devices, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -1,94 +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 v1beta1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// AllocatedDeviceStatusApplyConfiguration represents a declarative configuration of the AllocatedDeviceStatus type for use
|
||||
// with apply.
|
||||
type AllocatedDeviceStatusApplyConfiguration struct {
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
Pool *string `json:"pool,omitempty"`
|
||||
Device *string `json:"device,omitempty"`
|
||||
Conditions []v1.ConditionApplyConfiguration `json:"conditions,omitempty"`
|
||||
Data *runtime.RawExtension `json:"data,omitempty"`
|
||||
NetworkData *NetworkDeviceDataApplyConfiguration `json:"networkData,omitempty"`
|
||||
}
|
||||
|
||||
// AllocatedDeviceStatusApplyConfiguration constructs a declarative configuration of the AllocatedDeviceStatus type for use with
|
||||
// apply.
|
||||
func AllocatedDeviceStatus() *AllocatedDeviceStatusApplyConfiguration {
|
||||
return &AllocatedDeviceStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithDriver(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPool sets the Pool 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 Pool field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithPool(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Pool = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevice sets the Device 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 Device field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithDevice(value string) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Device = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConditions adds the given value to the Conditions 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 Conditions field.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithConditions(values ...*v1.ConditionApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConditions")
|
||||
}
|
||||
b.Conditions = append(b.Conditions, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithData sets the Data 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 Data field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithData(value runtime.RawExtension) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.Data = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNetworkData sets the NetworkData 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 NetworkData field is set to the value of the last call.
|
||||
func (b *AllocatedDeviceStatusApplyConfiguration) WithNetworkData(value *NetworkDeviceDataApplyConfiguration) *AllocatedDeviceStatusApplyConfiguration {
|
||||
b.NetworkData = value
|
||||
return b
|
||||
}
|
||||
@@ -1,52 +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 v1beta1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
|
||||
// AllocationResultApplyConfiguration represents a declarative configuration of the AllocationResult type for use
|
||||
// with apply.
|
||||
type AllocationResultApplyConfiguration struct {
|
||||
Devices *DeviceAllocationResultApplyConfiguration `json:"devices,omitempty"`
|
||||
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
|
||||
}
|
||||
|
||||
// AllocationResultApplyConfiguration constructs a declarative configuration of the AllocationResult type for use with
|
||||
// apply.
|
||||
func AllocationResult() *AllocationResultApplyConfiguration {
|
||||
return &AllocationResultApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDevices sets the Devices 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 Devices field is set to the value of the last call.
|
||||
func (b *AllocationResultApplyConfiguration) WithDevices(value *DeviceAllocationResultApplyConfiguration) *AllocationResultApplyConfiguration {
|
||||
b.Devices = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeSelector sets the NodeSelector 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 NodeSelector field is set to the value of the last call.
|
||||
func (b *AllocationResultApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *AllocationResultApplyConfiguration {
|
||||
b.NodeSelector = value
|
||||
return b
|
||||
}
|
||||
@@ -1,64 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
)
|
||||
|
||||
// BasicDeviceApplyConfiguration represents a declarative configuration of the BasicDevice type for use
|
||||
// with apply.
|
||||
type BasicDeviceApplyConfiguration struct {
|
||||
Attributes map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration `json:"attributes,omitempty"`
|
||||
Capacity map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration `json:"capacity,omitempty"`
|
||||
}
|
||||
|
||||
// BasicDeviceApplyConfiguration constructs a declarative configuration of the BasicDevice type for use with
|
||||
// apply.
|
||||
func BasicDevice() *BasicDeviceApplyConfiguration {
|
||||
return &BasicDeviceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithAttributes puts the entries into the Attributes 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 Attributes field,
|
||||
// overwriting an existing map entries in Attributes field with the same key.
|
||||
func (b *BasicDeviceApplyConfiguration) WithAttributes(entries map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration) *BasicDeviceApplyConfiguration {
|
||||
if b.Attributes == nil && len(entries) > 0 {
|
||||
b.Attributes = make(map[resourcev1beta1.QualifiedName]DeviceAttributeApplyConfiguration, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Attributes[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCapacity puts the entries into the Capacity 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 Capacity field,
|
||||
// overwriting an existing map entries in Capacity field with the same key.
|
||||
func (b *BasicDeviceApplyConfiguration) WithCapacity(entries map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration) *BasicDeviceApplyConfiguration {
|
||||
if b.Capacity == nil && len(entries) > 0 {
|
||||
b.Capacity = make(map[resourcev1beta1.QualifiedName]DeviceCapacityApplyConfiguration, len(entries))
|
||||
}
|
||||
for k, v := range entries {
|
||||
b.Capacity[k] = v
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -1,39 +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 v1beta1
|
||||
|
||||
// CELDeviceSelectorApplyConfiguration represents a declarative configuration of the CELDeviceSelector type for use
|
||||
// with apply.
|
||||
type CELDeviceSelectorApplyConfiguration struct {
|
||||
Expression *string `json:"expression,omitempty"`
|
||||
}
|
||||
|
||||
// CELDeviceSelectorApplyConfiguration constructs a declarative configuration of the CELDeviceSelector type for use with
|
||||
// apply.
|
||||
func CELDeviceSelector() *CELDeviceSelectorApplyConfiguration {
|
||||
return &CELDeviceSelectorApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithExpression sets the Expression 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 Expression field is set to the value of the last call.
|
||||
func (b *CELDeviceSelectorApplyConfiguration) WithExpression(value string) *CELDeviceSelectorApplyConfiguration {
|
||||
b.Expression = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,48 +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 v1beta1
|
||||
|
||||
// DeviceApplyConfiguration represents a declarative configuration of the Device type for use
|
||||
// with apply.
|
||||
type DeviceApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Basic *BasicDeviceApplyConfiguration `json:"basic,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceApplyConfiguration constructs a declarative configuration of the Device type for use with
|
||||
// apply.
|
||||
func Device() *DeviceApplyConfiguration {
|
||||
return &DeviceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *DeviceApplyConfiguration) WithName(value string) *DeviceApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBasic sets the Basic 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 Basic field is set to the value of the last call.
|
||||
func (b *DeviceApplyConfiguration) WithBasic(value *BasicDeviceApplyConfiguration) *DeviceApplyConfiguration {
|
||||
b.Basic = value
|
||||
return b
|
||||
}
|
||||
@@ -1,63 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
)
|
||||
|
||||
// DeviceAllocationConfigurationApplyConfiguration represents a declarative configuration of the DeviceAllocationConfiguration type for use
|
||||
// with apply.
|
||||
type DeviceAllocationConfigurationApplyConfiguration struct {
|
||||
Source *resourcev1beta1.AllocationConfigSource `json:"source,omitempty"`
|
||||
Requests []string `json:"requests,omitempty"`
|
||||
DeviceConfigurationApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// DeviceAllocationConfigurationApplyConfiguration constructs a declarative configuration of the DeviceAllocationConfiguration type for use with
|
||||
// apply.
|
||||
func DeviceAllocationConfiguration() *DeviceAllocationConfigurationApplyConfiguration {
|
||||
return &DeviceAllocationConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSource sets the Source 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 Source field is set to the value of the last call.
|
||||
func (b *DeviceAllocationConfigurationApplyConfiguration) WithSource(value resourcev1beta1.AllocationConfigSource) *DeviceAllocationConfigurationApplyConfiguration {
|
||||
b.Source = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithRequests adds the given value to the Requests 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 Requests field.
|
||||
func (b *DeviceAllocationConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceAllocationConfigurationApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Requests = append(b.Requests, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call.
|
||||
func (b *DeviceAllocationConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceAllocationConfigurationApplyConfiguration {
|
||||
b.DeviceConfigurationApplyConfiguration.Opaque = value
|
||||
return b
|
||||
}
|
||||
@@ -1,58 +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 v1beta1
|
||||
|
||||
// DeviceAllocationResultApplyConfiguration represents a declarative configuration of the DeviceAllocationResult type for use
|
||||
// with apply.
|
||||
type DeviceAllocationResultApplyConfiguration struct {
|
||||
Results []DeviceRequestAllocationResultApplyConfiguration `json:"results,omitempty"`
|
||||
Config []DeviceAllocationConfigurationApplyConfiguration `json:"config,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceAllocationResult type for use with
|
||||
// apply.
|
||||
func DeviceAllocationResult() *DeviceAllocationResultApplyConfiguration {
|
||||
return &DeviceAllocationResultApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithResults adds the given value to the Results 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 Results field.
|
||||
func (b *DeviceAllocationResultApplyConfiguration) WithResults(values ...*DeviceRequestAllocationResultApplyConfiguration) *DeviceAllocationResultApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithResults")
|
||||
}
|
||||
b.Results = append(b.Results, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConfig adds the given value to the Config 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 Config field.
|
||||
func (b *DeviceAllocationResultApplyConfiguration) WithConfig(values ...*DeviceAllocationConfigurationApplyConfiguration) *DeviceAllocationResultApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConfig")
|
||||
}
|
||||
b.Config = append(b.Config, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -1,66 +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 v1beta1
|
||||
|
||||
// DeviceAttributeApplyConfiguration represents a declarative configuration of the DeviceAttribute type for use
|
||||
// with apply.
|
||||
type DeviceAttributeApplyConfiguration struct {
|
||||
IntValue *int64 `json:"int,omitempty"`
|
||||
BoolValue *bool `json:"bool,omitempty"`
|
||||
StringValue *string `json:"string,omitempty"`
|
||||
VersionValue *string `json:"version,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceAttributeApplyConfiguration constructs a declarative configuration of the DeviceAttribute type for use with
|
||||
// apply.
|
||||
func DeviceAttribute() *DeviceAttributeApplyConfiguration {
|
||||
return &DeviceAttributeApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithIntValue sets the IntValue 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 IntValue field is set to the value of the last call.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithIntValue(value int64) *DeviceAttributeApplyConfiguration {
|
||||
b.IntValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithBoolValue sets the BoolValue 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 BoolValue field is set to the value of the last call.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithBoolValue(value bool) *DeviceAttributeApplyConfiguration {
|
||||
b.BoolValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithStringValue sets the StringValue 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 StringValue field is set to the value of the last call.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithStringValue(value string) *DeviceAttributeApplyConfiguration {
|
||||
b.StringValue = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithVersionValue sets the VersionValue 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 VersionValue field is set to the value of the last call.
|
||||
func (b *DeviceAttributeApplyConfiguration) WithVersionValue(value string) *DeviceAttributeApplyConfiguration {
|
||||
b.VersionValue = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,43 +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 v1beta1
|
||||
|
||||
import (
|
||||
resource "k8s.io/apimachinery/pkg/api/resource"
|
||||
)
|
||||
|
||||
// DeviceCapacityApplyConfiguration represents a declarative configuration of the DeviceCapacity type for use
|
||||
// with apply.
|
||||
type DeviceCapacityApplyConfiguration struct {
|
||||
Value *resource.Quantity `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceCapacityApplyConfiguration constructs a declarative configuration of the DeviceCapacity type for use with
|
||||
// apply.
|
||||
func DeviceCapacity() *DeviceCapacityApplyConfiguration {
|
||||
return &DeviceCapacityApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithValue sets the Value 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 Value field is set to the value of the last call.
|
||||
func (b *DeviceCapacityApplyConfiguration) WithValue(value resource.Quantity) *DeviceCapacityApplyConfiguration {
|
||||
b.Value = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,72 +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 v1beta1
|
||||
|
||||
// DeviceClaimApplyConfiguration represents a declarative configuration of the DeviceClaim type for use
|
||||
// with apply.
|
||||
type DeviceClaimApplyConfiguration struct {
|
||||
Requests []DeviceRequestApplyConfiguration `json:"requests,omitempty"`
|
||||
Constraints []DeviceConstraintApplyConfiguration `json:"constraints,omitempty"`
|
||||
Config []DeviceClaimConfigurationApplyConfiguration `json:"config,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceClaimApplyConfiguration constructs a declarative configuration of the DeviceClaim type for use with
|
||||
// apply.
|
||||
func DeviceClaim() *DeviceClaimApplyConfiguration {
|
||||
return &DeviceClaimApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRequests adds the given value to the Requests 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 Requests field.
|
||||
func (b *DeviceClaimApplyConfiguration) WithRequests(values ...*DeviceRequestApplyConfiguration) *DeviceClaimApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithRequests")
|
||||
}
|
||||
b.Requests = append(b.Requests, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConstraints adds the given value to the Constraints 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 Constraints field.
|
||||
func (b *DeviceClaimApplyConfiguration) WithConstraints(values ...*DeviceConstraintApplyConfiguration) *DeviceClaimApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConstraints")
|
||||
}
|
||||
b.Constraints = append(b.Constraints, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConfig adds the given value to the Config 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 Config field.
|
||||
func (b *DeviceClaimApplyConfiguration) WithConfig(values ...*DeviceClaimConfigurationApplyConfiguration) *DeviceClaimApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConfig")
|
||||
}
|
||||
b.Config = append(b.Config, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -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 v1beta1
|
||||
|
||||
// DeviceClaimConfigurationApplyConfiguration represents a declarative configuration of the DeviceClaimConfiguration type for use
|
||||
// with apply.
|
||||
type DeviceClaimConfigurationApplyConfiguration struct {
|
||||
Requests []string `json:"requests,omitempty"`
|
||||
DeviceConfigurationApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// DeviceClaimConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClaimConfiguration type for use with
|
||||
// apply.
|
||||
func DeviceClaimConfiguration() *DeviceClaimConfigurationApplyConfiguration {
|
||||
return &DeviceClaimConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRequests adds the given value to the Requests 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 Requests field.
|
||||
func (b *DeviceClaimConfigurationApplyConfiguration) WithRequests(values ...string) *DeviceClaimConfigurationApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Requests = append(b.Requests, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call.
|
||||
func (b *DeviceClaimConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClaimConfigurationApplyConfiguration {
|
||||
b.DeviceConfigurationApplyConfiguration.Opaque = value
|
||||
return b
|
||||
}
|
||||
@@ -1,253 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
)
|
||||
|
||||
// DeviceClassApplyConfiguration represents a declarative configuration of the DeviceClass type for use
|
||||
// with apply.
|
||||
type DeviceClassApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *DeviceClassSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceClass constructs a declarative configuration of the DeviceClass type for use with
|
||||
// apply.
|
||||
func DeviceClass(name string) *DeviceClassApplyConfiguration {
|
||||
b := &DeviceClassApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("DeviceClass")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractDeviceClass extracts the applied configuration owned by fieldManager from
|
||||
// deviceClass. If no managedFields are found in deviceClass for fieldManager, a
|
||||
// DeviceClassApplyConfiguration 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.
|
||||
// deviceClass must be a unmodified DeviceClass API object that was retrieved from the Kubernetes API.
|
||||
// ExtractDeviceClass 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 ExtractDeviceClass(deviceClass *resourcev1beta1.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) {
|
||||
return extractDeviceClass(deviceClass, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractDeviceClassStatus is the same as ExtractDeviceClass except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractDeviceClassStatus(deviceClass *resourcev1beta1.DeviceClass, fieldManager string) (*DeviceClassApplyConfiguration, error) {
|
||||
return extractDeviceClass(deviceClass, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractDeviceClass(deviceClass *resourcev1beta1.DeviceClass, fieldManager string, subresource string) (*DeviceClassApplyConfiguration, error) {
|
||||
b := &DeviceClassApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(deviceClass, internal.Parser().Type("io.k8s.api.resource.v1beta1.DeviceClass"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(deviceClass.Name)
|
||||
|
||||
b.WithKind("DeviceClass")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
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 *DeviceClassApplyConfiguration) WithKind(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithAPIVersion(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithName(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithGenerateName(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithNamespace(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithUID(value types.UID) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithResourceVersion(value string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithGeneration(value int64) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithCreationTimestamp(value metav1.Time) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithLabels(entries map[string]string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithAnnotations(entries map[string]string) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *DeviceClassApplyConfiguration {
|
||||
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 *DeviceClassApplyConfiguration) WithFinalizers(values ...string) *DeviceClassApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *DeviceClassApplyConfiguration) 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 *DeviceClassApplyConfiguration) WithSpec(value *DeviceClassSpecApplyConfiguration) *DeviceClassApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *DeviceClassApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
@@ -1,39 +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 v1beta1
|
||||
|
||||
// DeviceClassConfigurationApplyConfiguration represents a declarative configuration of the DeviceClassConfiguration type for use
|
||||
// with apply.
|
||||
type DeviceClassConfigurationApplyConfiguration struct {
|
||||
DeviceConfigurationApplyConfiguration `json:",inline"`
|
||||
}
|
||||
|
||||
// DeviceClassConfigurationApplyConfiguration constructs a declarative configuration of the DeviceClassConfiguration type for use with
|
||||
// apply.
|
||||
func DeviceClassConfiguration() *DeviceClassConfigurationApplyConfiguration {
|
||||
return &DeviceClassConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call.
|
||||
func (b *DeviceClassConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceClassConfigurationApplyConfiguration {
|
||||
b.DeviceConfigurationApplyConfiguration.Opaque = value
|
||||
return b
|
||||
}
|
||||
@@ -1,58 +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 v1beta1
|
||||
|
||||
// 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"`
|
||||
}
|
||||
|
||||
// DeviceClassSpecApplyConfiguration constructs a declarative configuration of the DeviceClassSpec type for use with
|
||||
// apply.
|
||||
func DeviceClassSpec() *DeviceClassSpecApplyConfiguration {
|
||||
return &DeviceClassSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithSelectors adds the given value to the Selectors 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 Selectors field.
|
||||
func (b *DeviceClassSpecApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceClassSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithSelectors")
|
||||
}
|
||||
b.Selectors = append(b.Selectors, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithConfig adds the given value to the Config 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 Config field.
|
||||
func (b *DeviceClassSpecApplyConfiguration) WithConfig(values ...*DeviceClassConfigurationApplyConfiguration) *DeviceClassSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithConfig")
|
||||
}
|
||||
b.Config = append(b.Config, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -1,39 +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 v1beta1
|
||||
|
||||
// DeviceConfigurationApplyConfiguration represents a declarative configuration of the DeviceConfiguration type for use
|
||||
// with apply.
|
||||
type DeviceConfigurationApplyConfiguration struct {
|
||||
Opaque *OpaqueDeviceConfigurationApplyConfiguration `json:"opaque,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceConfigurationApplyConfiguration constructs a declarative configuration of the DeviceConfiguration type for use with
|
||||
// apply.
|
||||
func DeviceConfiguration() *DeviceConfigurationApplyConfiguration {
|
||||
return &DeviceConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithOpaque sets the Opaque 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 Opaque field is set to the value of the last call.
|
||||
func (b *DeviceConfigurationApplyConfiguration) WithOpaque(value *OpaqueDeviceConfigurationApplyConfiguration) *DeviceConfigurationApplyConfiguration {
|
||||
b.Opaque = value
|
||||
return b
|
||||
}
|
||||
@@ -1,54 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
)
|
||||
|
||||
// DeviceConstraintApplyConfiguration represents a declarative configuration of the DeviceConstraint type for use
|
||||
// with apply.
|
||||
type DeviceConstraintApplyConfiguration struct {
|
||||
Requests []string `json:"requests,omitempty"`
|
||||
MatchAttribute *resourcev1beta1.FullyQualifiedName `json:"matchAttribute,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceConstraintApplyConfiguration constructs a declarative configuration of the DeviceConstraint type for use with
|
||||
// apply.
|
||||
func DeviceConstraint() *DeviceConstraintApplyConfiguration {
|
||||
return &DeviceConstraintApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRequests adds the given value to the Requests 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 Requests field.
|
||||
func (b *DeviceConstraintApplyConfiguration) WithRequests(values ...string) *DeviceConstraintApplyConfiguration {
|
||||
for i := range values {
|
||||
b.Requests = append(b.Requests, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithMatchAttribute sets the MatchAttribute 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 MatchAttribute field is set to the value of the last call.
|
||||
func (b *DeviceConstraintApplyConfiguration) WithMatchAttribute(value resourcev1beta1.FullyQualifiedName) *DeviceConstraintApplyConfiguration {
|
||||
b.MatchAttribute = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,93 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
)
|
||||
|
||||
// DeviceRequestApplyConfiguration represents a declarative configuration of the DeviceRequest type for use
|
||||
// with apply.
|
||||
type DeviceRequestApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
DeviceClassName *string `json:"deviceClassName,omitempty"`
|
||||
Selectors []DeviceSelectorApplyConfiguration `json:"selectors,omitempty"`
|
||||
AllocationMode *resourcev1beta1.DeviceAllocationMode `json:"allocationMode,omitempty"`
|
||||
Count *int64 `json:"count,omitempty"`
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceRequestApplyConfiguration constructs a declarative configuration of the DeviceRequest type for use with
|
||||
// apply.
|
||||
func DeviceRequest() *DeviceRequestApplyConfiguration {
|
||||
return &DeviceRequestApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *DeviceRequestApplyConfiguration) WithName(value string) *DeviceRequestApplyConfiguration {
|
||||
b.Name = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDeviceClassName sets the DeviceClassName 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 DeviceClassName field is set to the value of the last call.
|
||||
func (b *DeviceRequestApplyConfiguration) WithDeviceClassName(value string) *DeviceRequestApplyConfiguration {
|
||||
b.DeviceClassName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithSelectors adds the given value to the Selectors 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 Selectors field.
|
||||
func (b *DeviceRequestApplyConfiguration) WithSelectors(values ...*DeviceSelectorApplyConfiguration) *DeviceRequestApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithSelectors")
|
||||
}
|
||||
b.Selectors = append(b.Selectors, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllocationMode sets the AllocationMode 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 AllocationMode field is set to the value of the last call.
|
||||
func (b *DeviceRequestApplyConfiguration) WithAllocationMode(value resourcev1beta1.DeviceAllocationMode) *DeviceRequestApplyConfiguration {
|
||||
b.AllocationMode = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithCount sets the Count 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 Count field is set to the value of the last call.
|
||||
func (b *DeviceRequestApplyConfiguration) WithCount(value int64) *DeviceRequestApplyConfiguration {
|
||||
b.Count = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAdminAccess sets the AdminAccess 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 AdminAccess field is set to the value of the last call.
|
||||
func (b *DeviceRequestApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestApplyConfiguration {
|
||||
b.AdminAccess = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,75 +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 v1beta1
|
||||
|
||||
// DeviceRequestAllocationResultApplyConfiguration represents a declarative configuration of the DeviceRequestAllocationResult type for use
|
||||
// with apply.
|
||||
type DeviceRequestAllocationResultApplyConfiguration struct {
|
||||
Request *string `json:"request,omitempty"`
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
Pool *string `json:"pool,omitempty"`
|
||||
Device *string `json:"device,omitempty"`
|
||||
AdminAccess *bool `json:"adminAccess,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceRequestAllocationResultApplyConfiguration constructs a declarative configuration of the DeviceRequestAllocationResult type for use with
|
||||
// apply.
|
||||
func DeviceRequestAllocationResult() *DeviceRequestAllocationResultApplyConfiguration {
|
||||
return &DeviceRequestAllocationResultApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithRequest sets the Request 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 Request field is set to the value of the last call.
|
||||
func (b *DeviceRequestAllocationResultApplyConfiguration) WithRequest(value string) *DeviceRequestAllocationResultApplyConfiguration {
|
||||
b.Request = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *DeviceRequestAllocationResultApplyConfiguration) WithDriver(value string) *DeviceRequestAllocationResultApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPool sets the Pool 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 Pool field is set to the value of the last call.
|
||||
func (b *DeviceRequestAllocationResultApplyConfiguration) WithPool(value string) *DeviceRequestAllocationResultApplyConfiguration {
|
||||
b.Pool = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevice sets the Device 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 Device field is set to the value of the last call.
|
||||
func (b *DeviceRequestAllocationResultApplyConfiguration) WithDevice(value string) *DeviceRequestAllocationResultApplyConfiguration {
|
||||
b.Device = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAdminAccess sets the AdminAccess 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 AdminAccess field is set to the value of the last call.
|
||||
func (b *DeviceRequestAllocationResultApplyConfiguration) WithAdminAccess(value bool) *DeviceRequestAllocationResultApplyConfiguration {
|
||||
b.AdminAccess = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,39 +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 v1beta1
|
||||
|
||||
// DeviceSelectorApplyConfiguration represents a declarative configuration of the DeviceSelector type for use
|
||||
// with apply.
|
||||
type DeviceSelectorApplyConfiguration struct {
|
||||
CEL *CELDeviceSelectorApplyConfiguration `json:"cel,omitempty"`
|
||||
}
|
||||
|
||||
// DeviceSelectorApplyConfiguration constructs a declarative configuration of the DeviceSelector type for use with
|
||||
// apply.
|
||||
func DeviceSelector() *DeviceSelectorApplyConfiguration {
|
||||
return &DeviceSelectorApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithCEL sets the CEL 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 CEL field is set to the value of the last call.
|
||||
func (b *DeviceSelectorApplyConfiguration) WithCEL(value *CELDeviceSelectorApplyConfiguration) *DeviceSelectorApplyConfiguration {
|
||||
b.CEL = value
|
||||
return b
|
||||
}
|
||||
@@ -1,59 +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 v1beta1
|
||||
|
||||
// NetworkDeviceDataApplyConfiguration represents a declarative configuration of the NetworkDeviceData type for use
|
||||
// with apply.
|
||||
type NetworkDeviceDataApplyConfiguration struct {
|
||||
InterfaceName *string `json:"interfaceName,omitempty"`
|
||||
IPs []string `json:"ips,omitempty"`
|
||||
HardwareAddress *string `json:"hardwareAddress,omitempty"`
|
||||
}
|
||||
|
||||
// NetworkDeviceDataApplyConfiguration constructs a declarative configuration of the NetworkDeviceData type for use with
|
||||
// apply.
|
||||
func NetworkDeviceData() *NetworkDeviceDataApplyConfiguration {
|
||||
return &NetworkDeviceDataApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithInterfaceName sets the InterfaceName 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 InterfaceName field is set to the value of the last call.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithInterfaceName(value string) *NetworkDeviceDataApplyConfiguration {
|
||||
b.InterfaceName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithIPs adds the given value to the IPs 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 IPs field.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithIPs(values ...string) *NetworkDeviceDataApplyConfiguration {
|
||||
for i := range values {
|
||||
b.IPs = append(b.IPs, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithHardwareAddress sets the HardwareAddress 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 HardwareAddress field is set to the value of the last call.
|
||||
func (b *NetworkDeviceDataApplyConfiguration) WithHardwareAddress(value string) *NetworkDeviceDataApplyConfiguration {
|
||||
b.HardwareAddress = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,52 +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 v1beta1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// OpaqueDeviceConfigurationApplyConfiguration represents a declarative configuration of the OpaqueDeviceConfiguration type for use
|
||||
// with apply.
|
||||
type OpaqueDeviceConfigurationApplyConfiguration struct {
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
Parameters *runtime.RawExtension `json:"parameters,omitempty"`
|
||||
}
|
||||
|
||||
// OpaqueDeviceConfigurationApplyConfiguration constructs a declarative configuration of the OpaqueDeviceConfiguration type for use with
|
||||
// apply.
|
||||
func OpaqueDeviceConfiguration() *OpaqueDeviceConfigurationApplyConfiguration {
|
||||
return &OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *OpaqueDeviceConfigurationApplyConfiguration) WithDriver(value string) *OpaqueDeviceConfigurationApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithParameters sets the Parameters 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 Parameters field is set to the value of the last call.
|
||||
func (b *OpaqueDeviceConfigurationApplyConfiguration) WithParameters(value runtime.RawExtension) *OpaqueDeviceConfigurationApplyConfiguration {
|
||||
b.Parameters = &value
|
||||
return b
|
||||
}
|
||||
@@ -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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
)
|
||||
|
||||
// ResourceClaimApplyConfiguration represents a declarative configuration of the ResourceClaim type for use
|
||||
// with apply.
|
||||
type ResourceClaimApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
Status *ResourceClaimStatusApplyConfiguration `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaim constructs a declarative configuration of the ResourceClaim type for use with
|
||||
// apply.
|
||||
func ResourceClaim(name, namespace string) *ResourceClaimApplyConfiguration {
|
||||
b := &ResourceClaimApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("ResourceClaim")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceClaim extracts the applied configuration owned by fieldManager from
|
||||
// resourceClaim. If no managedFields are found in resourceClaim for fieldManager, a
|
||||
// ResourceClaimApplyConfiguration 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.
|
||||
// resourceClaim must be a unmodified ResourceClaim API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceClaim 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 ExtractResourceClaim(resourceClaim *resourcev1beta1.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) {
|
||||
return extractResourceClaim(resourceClaim, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceClaimStatus is the same as ExtractResourceClaim except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceClaimStatus(resourceClaim *resourcev1beta1.ResourceClaim, fieldManager string) (*ResourceClaimApplyConfiguration, error) {
|
||||
return extractResourceClaim(resourceClaim, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceClaim(resourceClaim *resourcev1beta1.ResourceClaim, fieldManager string, subresource string) (*ResourceClaimApplyConfiguration, error) {
|
||||
b := &ResourceClaimApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceClaim, internal.Parser().Type("io.k8s.api.resource.v1beta1.ResourceClaim"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceClaim.Name)
|
||||
b.WithNamespace(resourceClaim.Namespace)
|
||||
|
||||
b.WithKind("ResourceClaim")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
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 *ResourceClaimApplyConfiguration) WithKind(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithAPIVersion(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithGenerateName(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithNamespace(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithUID(value types.UID) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithResourceVersion(value string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithGeneration(value int64) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceClaimApplyConfiguration) 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 *ResourceClaimApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimApplyConfiguration {
|
||||
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 *ResourceClaimApplyConfiguration) WithStatus(value *ResourceClaimStatusApplyConfiguration) *ResourceClaimApplyConfiguration {
|
||||
b.Status = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourceClaimApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
@@ -1,70 +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 v1beta1
|
||||
|
||||
import (
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
)
|
||||
|
||||
// ResourceClaimConsumerReferenceApplyConfiguration represents a declarative configuration of the ResourceClaimConsumerReference type for use
|
||||
// with apply.
|
||||
type ResourceClaimConsumerReferenceApplyConfiguration struct {
|
||||
APIGroup *string `json:"apiGroup,omitempty"`
|
||||
Resource *string `json:"resource,omitempty"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
UID *types.UID `json:"uid,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimConsumerReferenceApplyConfiguration constructs a declarative configuration of the ResourceClaimConsumerReference type for use with
|
||||
// apply.
|
||||
func ResourceClaimConsumerReference() *ResourceClaimConsumerReferenceApplyConfiguration {
|
||||
return &ResourceClaimConsumerReferenceApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithAPIGroup sets the APIGroup 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 APIGroup field is set to the value of the last call.
|
||||
func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithAPIGroup(value string) *ResourceClaimConsumerReferenceApplyConfiguration {
|
||||
b.APIGroup = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResource sets the Resource 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 Resource field is set to the value of the last call.
|
||||
func (b *ResourceClaimConsumerReferenceApplyConfiguration) WithResource(value string) *ResourceClaimConsumerReferenceApplyConfiguration {
|
||||
b.Resource = &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 *ResourceClaimConsumerReferenceApplyConfiguration) WithName(value string) *ResourceClaimConsumerReferenceApplyConfiguration {
|
||||
b.Name = &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 *ResourceClaimConsumerReferenceApplyConfiguration) WithUID(value types.UID) *ResourceClaimConsumerReferenceApplyConfiguration {
|
||||
b.UID = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,39 +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 v1beta1
|
||||
|
||||
// ResourceClaimSpecApplyConfiguration represents a declarative configuration of the ResourceClaimSpec type for use
|
||||
// with apply.
|
||||
type ResourceClaimSpecApplyConfiguration struct {
|
||||
Devices *DeviceClaimApplyConfiguration `json:"devices,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimSpec type for use with
|
||||
// apply.
|
||||
func ResourceClaimSpec() *ResourceClaimSpecApplyConfiguration {
|
||||
return &ResourceClaimSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDevices sets the Devices 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 Devices field is set to the value of the last call.
|
||||
func (b *ResourceClaimSpecApplyConfiguration) WithDevices(value *DeviceClaimApplyConfiguration) *ResourceClaimSpecApplyConfiguration {
|
||||
b.Devices = value
|
||||
return b
|
||||
}
|
||||
@@ -1,67 +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 v1beta1
|
||||
|
||||
// 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"`
|
||||
Devices []AllocatedDeviceStatusApplyConfiguration `json:"devices,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimStatusApplyConfiguration constructs a declarative configuration of the ResourceClaimStatus type for use with
|
||||
// apply.
|
||||
func ResourceClaimStatus() *ResourceClaimStatusApplyConfiguration {
|
||||
return &ResourceClaimStatusApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithAllocation sets the Allocation 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 Allocation field is set to the value of the last call.
|
||||
func (b *ResourceClaimStatusApplyConfiguration) WithAllocation(value *AllocationResultApplyConfiguration) *ResourceClaimStatusApplyConfiguration {
|
||||
b.Allocation = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithReservedFor adds the given value to the ReservedFor 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 ReservedFor field.
|
||||
func (b *ResourceClaimStatusApplyConfiguration) WithReservedFor(values ...*ResourceClaimConsumerReferenceApplyConfiguration) *ResourceClaimStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithReservedFor")
|
||||
}
|
||||
b.ReservedFor = append(b.ReservedFor, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevices adds the given value to the Devices 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 Devices field.
|
||||
func (b *ResourceClaimStatusApplyConfiguration) WithDevices(values ...*AllocatedDeviceStatusApplyConfiguration) *ResourceClaimStatusApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithDevices")
|
||||
}
|
||||
b.Devices = append(b.Devices, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -1,255 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
)
|
||||
|
||||
// ResourceClaimTemplateApplyConfiguration represents a declarative configuration of the ResourceClaimTemplate type for use
|
||||
// with apply.
|
||||
type ResourceClaimTemplateApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ResourceClaimTemplateSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimTemplate constructs a declarative configuration of the ResourceClaimTemplate type for use with
|
||||
// apply.
|
||||
func ResourceClaimTemplate(name, namespace string) *ResourceClaimTemplateApplyConfiguration {
|
||||
b := &ResourceClaimTemplateApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithNamespace(namespace)
|
||||
b.WithKind("ResourceClaimTemplate")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceClaimTemplate extracts the applied configuration owned by fieldManager from
|
||||
// resourceClaimTemplate. If no managedFields are found in resourceClaimTemplate for fieldManager, a
|
||||
// ResourceClaimTemplateApplyConfiguration 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.
|
||||
// resourceClaimTemplate must be a unmodified ResourceClaimTemplate API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceClaimTemplate 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 ExtractResourceClaimTemplate(resourceClaimTemplate *resourcev1beta1.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) {
|
||||
return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceClaimTemplateStatus is the same as ExtractResourceClaimTemplate except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceClaimTemplateStatus(resourceClaimTemplate *resourcev1beta1.ResourceClaimTemplate, fieldManager string) (*ResourceClaimTemplateApplyConfiguration, error) {
|
||||
return extractResourceClaimTemplate(resourceClaimTemplate, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceClaimTemplate(resourceClaimTemplate *resourcev1beta1.ResourceClaimTemplate, fieldManager string, subresource string) (*ResourceClaimTemplateApplyConfiguration, error) {
|
||||
b := &ResourceClaimTemplateApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceClaimTemplate, internal.Parser().Type("io.k8s.api.resource.v1beta1.ResourceClaimTemplate"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceClaimTemplate.Name)
|
||||
b.WithNamespace(resourceClaimTemplate.Namespace)
|
||||
|
||||
b.WithKind("ResourceClaimTemplate")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithKind(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithAPIVersion(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithName(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateApplyConfiguration {
|
||||
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 *ResourceClaimTemplateApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceClaimTemplateApplyConfiguration) 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 *ResourceClaimTemplateApplyConfiguration) WithSpec(value *ResourceClaimTemplateSpecApplyConfiguration) *ResourceClaimTemplateApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourceClaimTemplateApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
@@ -1,194 +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 v1beta1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
|
||||
)
|
||||
|
||||
// ResourceClaimTemplateSpecApplyConfiguration represents a declarative configuration of the ResourceClaimTemplateSpec type for use
|
||||
// with apply.
|
||||
type ResourceClaimTemplateSpecApplyConfiguration struct {
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ResourceClaimSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceClaimTemplateSpecApplyConfiguration constructs a declarative configuration of the ResourceClaimTemplateSpec type for use with
|
||||
// apply.
|
||||
func ResourceClaimTemplateSpec() *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
return &ResourceClaimTemplateSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *ResourceClaimTemplateSpecApplyConfiguration) WithName(value string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithGenerateName(value string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithNamespace(value string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithUID(value types.UID) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithResourceVersion(value string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithGeneration(value int64) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
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 *ResourceClaimTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceClaimTemplateSpecApplyConfiguration) 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 *ResourceClaimTemplateSpecApplyConfiguration) WithSpec(value *ResourceClaimSpecApplyConfiguration) *ResourceClaimTemplateSpecApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourceClaimTemplateSpecApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
@@ -1,57 +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 v1beta1
|
||||
|
||||
// ResourcePoolApplyConfiguration represents a declarative configuration of the ResourcePool type for use
|
||||
// with apply.
|
||||
type ResourcePoolApplyConfiguration struct {
|
||||
Name *string `json:"name,omitempty"`
|
||||
Generation *int64 `json:"generation,omitempty"`
|
||||
ResourceSliceCount *int64 `json:"resourceSliceCount,omitempty"`
|
||||
}
|
||||
|
||||
// ResourcePoolApplyConfiguration constructs a declarative configuration of the ResourcePool type for use with
|
||||
// apply.
|
||||
func ResourcePool() *ResourcePoolApplyConfiguration {
|
||||
return &ResourcePoolApplyConfiguration{}
|
||||
}
|
||||
|
||||
// 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 *ResourcePoolApplyConfiguration) WithName(value string) *ResourcePoolApplyConfiguration {
|
||||
b.Name = &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 *ResourcePoolApplyConfiguration) WithGeneration(value int64) *ResourcePoolApplyConfiguration {
|
||||
b.Generation = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithResourceSliceCount sets the ResourceSliceCount 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 ResourceSliceCount field is set to the value of the last call.
|
||||
func (b *ResourcePoolApplyConfiguration) WithResourceSliceCount(value int64) *ResourcePoolApplyConfiguration {
|
||||
b.ResourceSliceCount = &value
|
||||
return b
|
||||
}
|
||||
@@ -1,253 +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 v1beta1
|
||||
|
||||
import (
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
)
|
||||
|
||||
// ResourceSliceApplyConfiguration represents a declarative configuration of the ResourceSlice type for use
|
||||
// with apply.
|
||||
type ResourceSliceApplyConfiguration struct {
|
||||
v1.TypeMetaApplyConfiguration `json:",inline"`
|
||||
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
|
||||
Spec *ResourceSliceSpecApplyConfiguration `json:"spec,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceSlice constructs a declarative configuration of the ResourceSlice type for use with
|
||||
// apply.
|
||||
func ResourceSlice(name string) *ResourceSliceApplyConfiguration {
|
||||
b := &ResourceSliceApplyConfiguration{}
|
||||
b.WithName(name)
|
||||
b.WithKind("ResourceSlice")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
return b
|
||||
}
|
||||
|
||||
// ExtractResourceSlice extracts the applied configuration owned by fieldManager from
|
||||
// resourceSlice. If no managedFields are found in resourceSlice for fieldManager, a
|
||||
// ResourceSliceApplyConfiguration 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.
|
||||
// resourceSlice must be a unmodified ResourceSlice API object that was retrieved from the Kubernetes API.
|
||||
// ExtractResourceSlice 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 ExtractResourceSlice(resourceSlice *resourcev1beta1.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) {
|
||||
return extractResourceSlice(resourceSlice, fieldManager, "")
|
||||
}
|
||||
|
||||
// ExtractResourceSliceStatus is the same as ExtractResourceSlice except
|
||||
// that it extracts the status subresource applied configuration.
|
||||
// Experimental!
|
||||
func ExtractResourceSliceStatus(resourceSlice *resourcev1beta1.ResourceSlice, fieldManager string) (*ResourceSliceApplyConfiguration, error) {
|
||||
return extractResourceSlice(resourceSlice, fieldManager, "status")
|
||||
}
|
||||
|
||||
func extractResourceSlice(resourceSlice *resourcev1beta1.ResourceSlice, fieldManager string, subresource string) (*ResourceSliceApplyConfiguration, error) {
|
||||
b := &ResourceSliceApplyConfiguration{}
|
||||
err := managedfields.ExtractInto(resourceSlice, internal.Parser().Type("io.k8s.api.resource.v1beta1.ResourceSlice"), fieldManager, b, subresource)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.WithName(resourceSlice.Name)
|
||||
|
||||
b.WithKind("ResourceSlice")
|
||||
b.WithAPIVersion("resource.k8s.io/v1beta1")
|
||||
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 *ResourceSliceApplyConfiguration) WithKind(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithAPIVersion(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithName(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithGenerateName(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithNamespace(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithUID(value types.UID) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithResourceVersion(value string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithGeneration(value int64) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithLabels(entries map[string]string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceSliceApplyConfiguration {
|
||||
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 *ResourceSliceApplyConfiguration) WithFinalizers(values ...string) *ResourceSliceApplyConfiguration {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
for i := range values {
|
||||
b.ObjectMetaApplyConfiguration.Finalizers = append(b.ObjectMetaApplyConfiguration.Finalizers, values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
func (b *ResourceSliceApplyConfiguration) 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 *ResourceSliceApplyConfiguration) WithSpec(value *ResourceSliceSpecApplyConfiguration) *ResourceSliceApplyConfiguration {
|
||||
b.Spec = value
|
||||
return b
|
||||
}
|
||||
|
||||
// GetName retrieves the value of the Name field in the declarative configuration.
|
||||
func (b *ResourceSliceApplyConfiguration) GetName() *string {
|
||||
b.ensureObjectMetaApplyConfigurationExists()
|
||||
return b.ObjectMetaApplyConfiguration.Name
|
||||
}
|
||||
@@ -1,93 +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 v1beta1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
)
|
||||
|
||||
// ResourceSliceSpecApplyConfiguration represents a declarative configuration of the ResourceSliceSpec type for use
|
||||
// with apply.
|
||||
type ResourceSliceSpecApplyConfiguration struct {
|
||||
Driver *string `json:"driver,omitempty"`
|
||||
Pool *ResourcePoolApplyConfiguration `json:"pool,omitempty"`
|
||||
NodeName *string `json:"nodeName,omitempty"`
|
||||
NodeSelector *v1.NodeSelectorApplyConfiguration `json:"nodeSelector,omitempty"`
|
||||
AllNodes *bool `json:"allNodes,omitempty"`
|
||||
Devices []DeviceApplyConfiguration `json:"devices,omitempty"`
|
||||
}
|
||||
|
||||
// ResourceSliceSpecApplyConfiguration constructs a declarative configuration of the ResourceSliceSpec type for use with
|
||||
// apply.
|
||||
func ResourceSliceSpec() *ResourceSliceSpecApplyConfiguration {
|
||||
return &ResourceSliceSpecApplyConfiguration{}
|
||||
}
|
||||
|
||||
// WithDriver sets the Driver 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 Driver field is set to the value of the last call.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithDriver(value string) *ResourceSliceSpecApplyConfiguration {
|
||||
b.Driver = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithPool sets the Pool 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 Pool field is set to the value of the last call.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithPool(value *ResourcePoolApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
|
||||
b.Pool = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeName sets the NodeName 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 NodeName field is set to the value of the last call.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithNodeName(value string) *ResourceSliceSpecApplyConfiguration {
|
||||
b.NodeName = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithNodeSelector sets the NodeSelector 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 NodeSelector field is set to the value of the last call.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithNodeSelector(value *v1.NodeSelectorApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
|
||||
b.NodeSelector = value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithAllNodes sets the AllNodes 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 AllNodes field is set to the value of the last call.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithAllNodes(value bool) *ResourceSliceSpecApplyConfiguration {
|
||||
b.AllNodes = &value
|
||||
return b
|
||||
}
|
||||
|
||||
// WithDevices adds the given value to the Devices 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 Devices field.
|
||||
func (b *ResourceSliceSpecApplyConfiguration) WithDevices(values ...*DeviceApplyConfiguration) *ResourceSliceSpecApplyConfiguration {
|
||||
for i := range values {
|
||||
if values[i] == nil {
|
||||
panic("nil value passed to WithDevices")
|
||||
}
|
||||
b.Devices = append(b.Devices, *values[i])
|
||||
}
|
||||
return b
|
||||
}
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1"
|
||||
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
v1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
@@ -61,7 +61,6 @@ import (
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
v1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
@@ -89,7 +88,7 @@ import (
|
||||
applyconfigurationscertificatesv1alpha1 "k8s.io/client-go/applyconfigurations/certificates/v1alpha1"
|
||||
applyconfigurationscertificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1"
|
||||
applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1"
|
||||
coordinationv1alpha2 "k8s.io/client-go/applyconfigurations/coordination/v1alpha2"
|
||||
applyconfigurationscoordinationv1alpha1 "k8s.io/client-go/applyconfigurations/coordination/v1alpha1"
|
||||
applyconfigurationscoordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
|
||||
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
|
||||
applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1"
|
||||
@@ -116,7 +115,6 @@ import (
|
||||
applyconfigurationsrbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1"
|
||||
applyconfigurationsrbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1"
|
||||
resourcev1alpha3 "k8s.io/client-go/applyconfigurations/resource/v1alpha3"
|
||||
applyconfigurationsresourcev1beta1 "k8s.io/client-go/applyconfigurations/resource/v1beta1"
|
||||
applyconfigurationsschedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1"
|
||||
applyconfigurationsschedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1"
|
||||
applyconfigurationsschedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1"
|
||||
@@ -631,11 +629,11 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case coordinationv1.SchemeGroupVersion.WithKind("LeaseSpec"):
|
||||
return &applyconfigurationscoordinationv1.LeaseSpecApplyConfiguration{}
|
||||
|
||||
// Group=coordination.k8s.io, Version=v1alpha2
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("LeaseCandidate"):
|
||||
return &coordinationv1alpha2.LeaseCandidateApplyConfiguration{}
|
||||
case v1alpha2.SchemeGroupVersion.WithKind("LeaseCandidateSpec"):
|
||||
return &coordinationv1alpha2.LeaseCandidateSpecApplyConfiguration{}
|
||||
// Group=coordination.k8s.io, Version=v1alpha1
|
||||
case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidate"):
|
||||
return &applyconfigurationscoordinationv1alpha1.LeaseCandidateApplyConfiguration{}
|
||||
case coordinationv1alpha1.SchemeGroupVersion.WithKind("LeaseCandidateSpec"):
|
||||
return &applyconfigurationscoordinationv1alpha1.LeaseCandidateSpecApplyConfiguration{}
|
||||
|
||||
// Group=coordination.k8s.io, Version=v1beta1
|
||||
case coordinationv1beta1.SchemeGroupVersion.WithKind("Lease"):
|
||||
@@ -1582,8 +1580,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &applyconfigurationsrbacv1beta1.SubjectApplyConfiguration{}
|
||||
|
||||
// Group=resource.k8s.io, Version=v1alpha3
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"):
|
||||
return &resourcev1alpha3.AllocatedDeviceStatusApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("AllocationResult"):
|
||||
return &resourcev1alpha3.AllocationResultApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("BasicDevice"):
|
||||
@@ -1618,8 +1614,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
return &resourcev1alpha3.DeviceRequestAllocationResultApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("DeviceSelector"):
|
||||
return &resourcev1alpha3.DeviceSelectorApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &resourcev1alpha3.NetworkDeviceDataApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &resourcev1alpha3.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
@@ -1641,68 +1635,6 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
|
||||
case v1alpha3.SchemeGroupVersion.WithKind("ResourceSliceSpec"):
|
||||
return &resourcev1alpha3.ResourceSliceSpecApplyConfiguration{}
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("AllocatedDeviceStatus"):
|
||||
return &applyconfigurationsresourcev1beta1.AllocatedDeviceStatusApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("AllocationResult"):
|
||||
return &applyconfigurationsresourcev1beta1.AllocationResultApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("BasicDevice"):
|
||||
return &applyconfigurationsresourcev1beta1.BasicDeviceApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("CELDeviceSelector"):
|
||||
return &applyconfigurationsresourcev1beta1.CELDeviceSelectorApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("Device"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAllocationConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceAllocationConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAllocationResult"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceAllocationResultApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceAttribute"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceAttributeApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceCapacity"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceCapacityApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceClaim"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceClaimApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceClaimConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceClaimConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceClass"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceClassApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceClassConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceClassConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceClassSpec"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceClassSpecApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceConstraint"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceConstraintApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequest"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceRequestApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceRequestAllocationResult"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceRequestAllocationResultApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("DeviceSelector"):
|
||||
return &applyconfigurationsresourcev1beta1.DeviceSelectorApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("NetworkDeviceData"):
|
||||
return &applyconfigurationsresourcev1beta1.NetworkDeviceDataApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("OpaqueDeviceConfiguration"):
|
||||
return &applyconfigurationsresourcev1beta1.OpaqueDeviceConfigurationApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaim"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaimConsumerReference"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimConsumerReferenceApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaimSpec"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimSpecApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaimStatus"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimStatusApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaimTemplate"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimTemplateApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceClaimTemplateSpec"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceClaimTemplateSpecApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourcePool"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourcePoolApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceSlice"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceSliceApplyConfiguration{}
|
||||
case resourcev1beta1.SchemeGroupVersion.WithKind("ResourceSliceSpec"):
|
||||
return &applyconfigurationsresourcev1beta1.ResourceSliceSpecApplyConfiguration{}
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1
|
||||
case schedulingv1.SchemeGroupVersion.WithKind("PriorityClass"):
|
||||
return &applyconfigurationsschedulingv1.PriorityClassApplyConfiguration{}
|
||||
|
||||
@@ -53,7 +53,7 @@ func newBasicNegotiatedSerializer() basicNegotiatedSerializer {
|
||||
},
|
||||
},
|
||||
}
|
||||
if features.FeatureGates().Enabled(features.ClientsAllowCBOR) {
|
||||
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientAllowsCBOR) {
|
||||
supportedMediaTypes = append(supportedMediaTypes, runtime.SerializerInfo{
|
||||
MediaType: "application/cbor",
|
||||
MediaTypeType: "application",
|
||||
|
||||
@@ -49,9 +49,9 @@ func ConfigFor(inConfig *rest.Config) *rest.Config {
|
||||
|
||||
config.ContentType = "application/json"
|
||||
config.AcceptContentTypes = "application/json"
|
||||
if features.FeatureGates().Enabled(features.ClientsAllowCBOR) {
|
||||
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientAllowsCBOR) {
|
||||
config.AcceptContentTypes = "application/json;q=0.9,application/cbor;q=1"
|
||||
if features.FeatureGates().Enabled(features.ClientsPreferCBOR) {
|
||||
if features.TestOnlyFeatureGates.Enabled(features.TestOnlyClientPrefersCBOR) {
|
||||
config.ContentType = "application/cbor"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ package features
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -28,31 +28,6 @@ const (
|
||||
// of code conflicts because changes are more likely to be scattered
|
||||
// across the file.
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
//
|
||||
// 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.
|
||||
ClientsAllowCBOR Feature = "ClientsAllowCBOR"
|
||||
|
||||
// owner: @benluddy
|
||||
// kep: https://kep.k8s.io/4222
|
||||
// alpha: 1.32
|
||||
//
|
||||
// If enabled, and only if ClientsAllowCBOR is also enabled, the default request content
|
||||
// type (if not explicitly configured) and the dynamic client's request content type both
|
||||
// become "application/cbor" instead of "application/json". The default content type for
|
||||
// apply patch requests becomes "application/apply-patch+cbor" instead of
|
||||
// "application/apply-patch+yaml".
|
||||
ClientsPreferCBOR Feature = "ClientsPreferCBOR"
|
||||
|
||||
// owner: @nilekhc
|
||||
// alpha: v1.30
|
||||
InformerResourceVersion Feature = "InformerResourceVersion"
|
||||
|
||||
// owner: @p0lyn0mial
|
||||
// beta: v1.30
|
||||
//
|
||||
@@ -62,6 +37,31 @@ const (
|
||||
// The feature is disabled in Beta by default because
|
||||
// it will only be turned on for selected control plane component(s).
|
||||
WatchListClient Feature = "WatchListClient"
|
||||
|
||||
// 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.
|
||||
@@ -70,8 +70,6 @@ const (
|
||||
// After registering with the binary, the features are, by default, controllable using environment variables.
|
||||
// For more details, please see envVarFeatureGates implementation.
|
||||
var defaultKubernetesFeatureGates = map[Feature]FeatureSpec{
|
||||
ClientsAllowCBOR: {Default: false, PreRelease: Alpha},
|
||||
ClientsPreferCBOR: {Default: false, PreRelease: Alpha},
|
||||
InformerResourceVersion: {Default: false, PreRelease: Alpha},
|
||||
WatchListClient: {Default: false, PreRelease: Beta},
|
||||
InformerResourceVersion: {Default: false, PreRelease: Alpha},
|
||||
}
|
||||
|
||||
304
gentype/fake.go
304
gentype/fake.go
@@ -1,304 +0,0 @@
|
||||
/*
|
||||
Copyright 2024 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package gentype
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeClient represents a fake client
|
||||
type FakeClient[T objectWithMeta] struct {
|
||||
*testing.Fake
|
||||
ns string
|
||||
resource schema.GroupVersionResource
|
||||
kind schema.GroupVersionKind
|
||||
newObject func() T
|
||||
}
|
||||
|
||||
// FakeClientWithList represents a fake client with support for lists.
|
||||
type FakeClientWithList[T objectWithMeta, L runtime.Object] struct {
|
||||
*FakeClient[T]
|
||||
alsoFakeLister[T, L]
|
||||
}
|
||||
|
||||
// FakeClientWithApply represents a fake client with support for apply declarative configurations.
|
||||
type FakeClientWithApply[T objectWithMeta, C namedObject] struct {
|
||||
*FakeClient[T]
|
||||
alsoFakeApplier[T, C]
|
||||
}
|
||||
|
||||
// FakeClientWithListAndApply represents a fake client with support for lists and apply declarative configurations.
|
||||
type FakeClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject] struct {
|
||||
*FakeClient[T]
|
||||
alsoFakeLister[T, L]
|
||||
alsoFakeApplier[T, C]
|
||||
}
|
||||
|
||||
// Helper types for composition
|
||||
type alsoFakeLister[T objectWithMeta, L runtime.Object] struct {
|
||||
client *FakeClient[T]
|
||||
newList func() L
|
||||
copyListMeta func(L, L)
|
||||
getItems func(L) []T
|
||||
setItems func(L, []T)
|
||||
}
|
||||
|
||||
type alsoFakeApplier[T objectWithMeta, C namedObject] struct {
|
||||
client *FakeClient[T]
|
||||
}
|
||||
|
||||
// NewFakeClient constructs a fake client, namespaced or not, with no support for lists or apply.
|
||||
// Non-namespaced clients are constructed by passing an empty namespace ("").
|
||||
func NewFakeClient[T objectWithMeta](
|
||||
fake *testing.Fake, namespace string, resource schema.GroupVersionResource, kind schema.GroupVersionKind, emptyObjectCreator func() T,
|
||||
) *FakeClient[T] {
|
||||
return &FakeClient[T]{fake, namespace, resource, kind, emptyObjectCreator}
|
||||
}
|
||||
|
||||
// NewFakeClientWithList constructs a namespaced client with support for lists.
|
||||
func NewFakeClientWithList[T objectWithMeta, L runtime.Object](
|
||||
fake *testing.Fake, namespace string, resource schema.GroupVersionResource, kind schema.GroupVersionKind, emptyObjectCreator func() T,
|
||||
emptyListCreator func() L, listMetaCopier func(L, L), itemGetter func(L) []T, itemSetter func(L, []T),
|
||||
) *FakeClientWithList[T, L] {
|
||||
fakeClient := NewFakeClient[T](fake, namespace, resource, kind, emptyObjectCreator)
|
||||
return &FakeClientWithList[T, L]{
|
||||
fakeClient,
|
||||
alsoFakeLister[T, L]{fakeClient, emptyListCreator, listMetaCopier, itemGetter, itemSetter},
|
||||
}
|
||||
}
|
||||
|
||||
// NewFakeClientWithApply constructs a namespaced client with support for apply declarative configurations.
|
||||
func NewFakeClientWithApply[T objectWithMeta, C namedObject](
|
||||
fake *testing.Fake, namespace string, resource schema.GroupVersionResource, kind schema.GroupVersionKind, emptyObjectCreator func() T,
|
||||
) *FakeClientWithApply[T, C] {
|
||||
fakeClient := NewFakeClient[T](fake, namespace, resource, kind, emptyObjectCreator)
|
||||
return &FakeClientWithApply[T, C]{
|
||||
fakeClient,
|
||||
alsoFakeApplier[T, C]{fakeClient},
|
||||
}
|
||||
}
|
||||
|
||||
// NewFakeClientWithListAndApply constructs a client with support for lists and applying declarative configurations.
|
||||
func NewFakeClientWithListAndApply[T objectWithMeta, L runtime.Object, C namedObject](
|
||||
fake *testing.Fake, namespace string, resource schema.GroupVersionResource, kind schema.GroupVersionKind, emptyObjectCreator func() T,
|
||||
emptyListCreator func() L, listMetaCopier func(L, L), itemGetter func(L) []T, itemSetter func(L, []T),
|
||||
) *FakeClientWithListAndApply[T, L, C] {
|
||||
fakeClient := NewFakeClient[T](fake, namespace, resource, kind, emptyObjectCreator)
|
||||
return &FakeClientWithListAndApply[T, L, C]{
|
||||
fakeClient,
|
||||
alsoFakeLister[T, L]{fakeClient, emptyListCreator, listMetaCopier, itemGetter, itemSetter},
|
||||
alsoFakeApplier[T, C]{fakeClient},
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of a resource, and returns the corresponding object, and an error if there is any.
|
||||
func (c *FakeClient[T]) Get(ctx context.Context, name string, options metav1.GetOptions) (T, error) {
|
||||
emptyResult := c.newObject()
|
||||
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(c.resource, c.ns, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
func ToPointerSlice[T any](src []T) []*T {
|
||||
if src == nil {
|
||||
return nil
|
||||
}
|
||||
result := make([]*T, len(src))
|
||||
for i := range src {
|
||||
result[i] = &src[i]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func FromPointerSlice[T any](src []*T) []T {
|
||||
if src == nil {
|
||||
return nil
|
||||
}
|
||||
result := make([]T, len(src))
|
||||
for i := range src {
|
||||
result[i] = *src[i]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of resources that match those selectors.
|
||||
func (l *alsoFakeLister[T, L]) List(ctx context.Context, opts metav1.ListOptions) (result L, err error) {
|
||||
emptyResult := l.newList()
|
||||
obj, err := l.client.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(l.client.resource, l.client.kind, l.client.ns, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
// Everything matches
|
||||
return obj.(L), nil
|
||||
}
|
||||
list := l.newList()
|
||||
l.copyListMeta(list, obj.(L))
|
||||
var items []T
|
||||
for _, item := range l.getItems(obj.(L)) {
|
||||
itemMeta, err := meta.Accessor(item)
|
||||
if err != nil {
|
||||
// No ObjectMeta, nothing can match
|
||||
continue
|
||||
}
|
||||
if label.Matches(labels.Set(itemMeta.GetLabels())) {
|
||||
items = append(items, item)
|
||||
}
|
||||
}
|
||||
l.setItems(list, items)
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested resources.
|
||||
func (c *FakeClient[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(c.resource, c.ns, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a resource and creates it. Returns the server's representation of the resource, and an error, if there is any.
|
||||
func (c *FakeClient[T]) Create(ctx context.Context, resource T, opts metav1.CreateOptions) (result T, err error) {
|
||||
emptyResult := c.newObject()
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(c.resource, c.ns, resource, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a resource and updates it. Returns the server's representation of the resource, and an error, if there is any.
|
||||
func (c *FakeClient[T]) Update(ctx context.Context, resource T, opts metav1.UpdateOptions) (result T, err error) {
|
||||
emptyResult := c.newObject()
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(c.resource, c.ns, resource, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
// UpdateStatus updates the resource's status and returns the updated resource.
|
||||
func (c *FakeClient[T]) UpdateStatus(ctx context.Context, resource T, opts metav1.UpdateOptions) (result T, err error) {
|
||||
emptyResult := c.newObject()
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(c.resource, "status", c.ns, resource, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
// Delete deletes the resource matching the given name. Returns an error if one occurs.
|
||||
func (c *FakeClient[T]) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(c.resource, c.ns, name, opts), c.newObject())
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (l *alsoFakeLister[T, L]) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
_, err := l.client.Fake.
|
||||
Invokes(testing.NewDeleteCollectionActionWithOptions(l.client.resource, l.client.ns, opts, listOpts), l.newList())
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched resource.
|
||||
func (c *FakeClient[T]) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result T, err error) {
|
||||
emptyResult := c.newObject()
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(c.resource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied resource.
|
||||
func (a *alsoFakeApplier[T, C]) Apply(ctx context.Context, configuration C, opts metav1.ApplyOptions) (result T, err error) {
|
||||
if configuration == *new(C) {
|
||||
return *new(T), fmt.Errorf("configuration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(configuration)
|
||||
if err != nil {
|
||||
return *new(T), err
|
||||
}
|
||||
name := configuration.GetName()
|
||||
if name == nil {
|
||||
return *new(T), fmt.Errorf("configuration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := a.client.newObject()
|
||||
obj, err := a.client.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(a.client.resource, a.client.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
// ApplyStatus applies the given apply declarative configuration to the resource's status and returns the updated resource.
|
||||
func (a *alsoFakeApplier[T, C]) ApplyStatus(ctx context.Context, configuration C, opts metav1.ApplyOptions) (result T, err error) {
|
||||
if configuration == *new(C) {
|
||||
return *new(T), fmt.Errorf("configuration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(configuration)
|
||||
if err != nil {
|
||||
return *new(T), err
|
||||
}
|
||||
name := configuration.GetName()
|
||||
if name == nil {
|
||||
return *new(T), fmt.Errorf("configuration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := a.client.newObject()
|
||||
obj, err := a.client.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(a.client.resource, a.client.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(T), err
|
||||
}
|
||||
|
||||
func (c *FakeClient[T]) Namespace() string {
|
||||
return c.ns
|
||||
}
|
||||
|
||||
func (c *FakeClient[T]) Kind() schema.GroupVersionKind {
|
||||
return c.kind
|
||||
}
|
||||
|
||||
func (c *FakeClient[T]) Resource() schema.GroupVersionResource {
|
||||
return c.resource
|
||||
}
|
||||
9
go.mod
9
go.mod
@@ -6,8 +6,6 @@ go 1.23.0
|
||||
|
||||
godebug default=go1.23
|
||||
|
||||
godebug winsymlink=0
|
||||
|
||||
require (
|
||||
github.com/gogo/protobuf v1.3.2
|
||||
github.com/golang/protobuf v1.5.4
|
||||
@@ -28,10 +26,10 @@ require (
|
||||
golang.org/x/time v0.7.0
|
||||
google.golang.org/protobuf v1.35.1
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0
|
||||
k8s.io/api v0.32.0
|
||||
k8s.io/apimachinery v0.32.0
|
||||
k8s.io/api v0.32.0-beta.0
|
||||
k8s.io/apimachinery v0.32.0-beta.0
|
||||
k8s.io/klog/v2 v2.130.1
|
||||
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f
|
||||
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3
|
||||
sigs.k8s.io/structured-merge-diff/v4 v4.4.2
|
||||
@@ -64,5 +62,6 @@ require (
|
||||
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
|
||||
)
|
||||
|
||||
14
go.sum
14
go.sum
@@ -147,17 +147,19 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP
|
||||
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
|
||||
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
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 h1:OL9JpbvAU5ny9ga2fb24X8H6xQlVp+aJMFlgtQjR9CE=
|
||||
k8s.io/api v0.32.0/go.mod h1:4LEwHZEf6Q/cG96F3dqR965sYOfmPM7rq81BLgsE0p0=
|
||||
k8s.io/apimachinery v0.32.0 h1:cFSE7N3rmEEtv4ei5X6DaJPHHX0C+upp+v5lVPiEwpg=
|
||||
k8s.io/apimachinery v0.32.0/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE=
|
||||
k8s.io/api v0.32.0-beta.0 h1:LW+CrsFQoKZOyLUa+Bf41tt54+JGlpT2+DZkGYqOlBU=
|
||||
k8s.io/api v0.32.0-beta.0/go.mod h1:33Wz5e2udOIvYDiwVjLOhwztCGp6NgU8aek42yZ1jjA=
|
||||
k8s.io/apimachinery v0.32.0-beta.0 h1:xThnRQcnBNOC8cI6hsQenJWJ85TV0Eqw5QQWL8Zmz4k=
|
||||
k8s.io/apimachinery v0.32.0-beta.0/go.mod h1:RBz1atosgwQyw4A8TzwjTQDnBVo/eak+3xLfOQr/By8=
|
||||
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-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y=
|
||||
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4=
|
||||
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-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
|
||||
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
|
||||
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
|
||||
|
||||
@@ -20,7 +20,7 @@ package coordination
|
||||
|
||||
import (
|
||||
v1 "k8s.io/client-go/informers/coordination/v1"
|
||||
v1alpha2 "k8s.io/client-go/informers/coordination/v1alpha2"
|
||||
v1alpha1 "k8s.io/client-go/informers/coordination/v1alpha1"
|
||||
v1beta1 "k8s.io/client-go/informers/coordination/v1beta1"
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
)
|
||||
@@ -29,8 +29,8 @@ import (
|
||||
type Interface interface {
|
||||
// V1 provides access to shared informers for resources in V1.
|
||||
V1() v1.Interface
|
||||
// V1alpha2 provides access to shared informers for resources in V1alpha2.
|
||||
V1alpha2() v1alpha2.Interface
|
||||
// V1alpha1 provides access to shared informers for resources in V1alpha1.
|
||||
V1alpha1() v1alpha1.Interface
|
||||
// V1beta1 provides access to shared informers for resources in V1beta1.
|
||||
V1beta1() v1beta1.Interface
|
||||
}
|
||||
@@ -51,9 +51,9 @@ func (g *group) V1() v1.Interface {
|
||||
return v1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1alpha2 returns a new v1alpha2.Interface.
|
||||
func (g *group) V1alpha2() v1alpha2.Interface {
|
||||
return v1alpha2.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
// V1alpha1 returns a new v1alpha1.Interface.
|
||||
func (g *group) V1alpha1() v1alpha1.Interface {
|
||||
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1beta1 returns a new v1beta1.Interface.
|
||||
|
||||
@@ -16,7 +16,7 @@ limitations under the License.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
@@ -16,19 +16,19 @@ limitations under the License.
|
||||
|
||||
// Code generated by informer-gen. DO NOT EDIT.
|
||||
|
||||
package v1alpha2
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apicoordinationv1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
apicoordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
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"
|
||||
coordinationv1alpha2 "k8s.io/client-go/listers/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/client-go/listers/coordination/v1alpha1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ import (
|
||||
// LeaseCandidates.
|
||||
type LeaseCandidateInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() coordinationv1alpha2.LeaseCandidateLister
|
||||
Lister() coordinationv1alpha1.LeaseCandidateLister
|
||||
}
|
||||
|
||||
type leaseCandidateInformer struct {
|
||||
@@ -62,16 +62,16 @@ func NewFilteredLeaseCandidateInformer(client kubernetes.Interface, namespace st
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoordinationV1alpha2().LeaseCandidates(namespace).List(context.TODO(), options)
|
||||
return client.CoordinationV1alpha1().LeaseCandidates(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CoordinationV1alpha2().LeaseCandidates(namespace).Watch(context.TODO(), options)
|
||||
return client.CoordinationV1alpha1().LeaseCandidates(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&apicoordinationv1alpha2.LeaseCandidate{},
|
||||
&apicoordinationv1alpha1.LeaseCandidate{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
@@ -82,9 +82,9 @@ func (f *leaseCandidateInformer) defaultInformer(client kubernetes.Interface, re
|
||||
}
|
||||
|
||||
func (f *leaseCandidateInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apicoordinationv1alpha2.LeaseCandidate{}, f.defaultInformer)
|
||||
return f.factory.InformerFor(&apicoordinationv1alpha1.LeaseCandidate{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *leaseCandidateInformer) Lister() coordinationv1alpha2.LeaseCandidateLister {
|
||||
return coordinationv1alpha2.NewLeaseCandidateLister(f.Informer().GetIndexer())
|
||||
func (f *leaseCandidateInformer) Lister() coordinationv1alpha1.LeaseCandidateLister {
|
||||
return coordinationv1alpha1.NewLeaseCandidateLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1"
|
||||
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
v1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
@@ -62,7 +62,6 @@ import (
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
v1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
@@ -204,9 +203,9 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case coordinationv1.SchemeGroupVersion.WithResource("leases"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1().Leases().Informer()}, nil
|
||||
|
||||
// Group=coordination.k8s.io, Version=v1alpha2
|
||||
case v1alpha2.SchemeGroupVersion.WithResource("leasecandidates"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1alpha2().LeaseCandidates().Informer()}, nil
|
||||
// Group=coordination.k8s.io, Version=v1alpha1
|
||||
case coordinationv1alpha1.SchemeGroupVersion.WithResource("leasecandidates"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1alpha1().LeaseCandidates().Informer()}, nil
|
||||
|
||||
// Group=coordination.k8s.io, Version=v1beta1
|
||||
case coordinationv1beta1.SchemeGroupVersion.WithResource("leases"):
|
||||
@@ -386,16 +385,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case v1alpha3.SchemeGroupVersion.WithResource("resourceslices"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1alpha3().ResourceSlices().Informer()}, nil
|
||||
|
||||
// Group=resource.k8s.io, Version=v1beta1
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("deviceclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta1().DeviceClasses().Informer()}, nil
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("resourceclaims"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta1().ResourceClaims().Informer()}, nil
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("resourceclaimtemplates"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta1().ResourceClaimTemplates().Informer()}, nil
|
||||
case resourcev1beta1.SchemeGroupVersion.WithResource("resourceslices"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Resource().V1beta1().ResourceSlices().Informer()}, nil
|
||||
|
||||
// Group=scheduling.k8s.io, Version=v1
|
||||
case schedulingv1.SchemeGroupVersion.WithResource("priorityclasses"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Scheduling().V1().PriorityClasses().Informer()}, nil
|
||||
|
||||
@@ -21,15 +21,12 @@ package resource
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
v1alpha3 "k8s.io/client-go/informers/resource/v1alpha3"
|
||||
v1beta1 "k8s.io/client-go/informers/resource/v1beta1"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V1alpha3 provides access to shared informers for resources in V1alpha3.
|
||||
V1alpha3() v1alpha3.Interface
|
||||
// V1beta1 provides access to shared informers for resources in V1beta1.
|
||||
V1beta1() v1beta1.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
@@ -47,8 +44,3 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
func (g *group) V1alpha3() v1alpha3.Interface {
|
||||
return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V1beta1 returns a new v1beta1.Interface.
|
||||
func (g *group) V1beta1() v1beta1.Interface {
|
||||
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
@@ -1,89 +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 v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
resourcev1beta1 "k8s.io/client-go/listers/resource/v1beta1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// DeviceClassInformer provides access to a shared informer and lister for
|
||||
// DeviceClasses.
|
||||
type DeviceClassInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1beta1.DeviceClassLister
|
||||
}
|
||||
|
||||
type deviceClassInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewDeviceClassInformer constructs a new informer for DeviceClass 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 NewDeviceClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredDeviceClassInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredDeviceClassInformer constructs a new informer for DeviceClass 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 NewFilteredDeviceClassInformer(client kubernetes.Interface, 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.ResourceV1beta1().DeviceClasses().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1beta1().DeviceClasses().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&apiresourcev1beta1.DeviceClass{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *deviceClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredDeviceClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *deviceClassInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1beta1.DeviceClass{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *deviceClassInformer) Lister() resourcev1beta1.DeviceClassLister {
|
||||
return resourcev1beta1.NewDeviceClassLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,66 +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 v1beta1
|
||||
|
||||
import (
|
||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// DeviceClasses returns a DeviceClassInformer.
|
||||
DeviceClasses() DeviceClassInformer
|
||||
// ResourceClaims returns a ResourceClaimInformer.
|
||||
ResourceClaims() ResourceClaimInformer
|
||||
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
|
||||
ResourceClaimTemplates() ResourceClaimTemplateInformer
|
||||
// ResourceSlices returns a ResourceSliceInformer.
|
||||
ResourceSlices() ResourceSliceInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// DeviceClasses returns a DeviceClassInformer.
|
||||
func (v *version) DeviceClasses() DeviceClassInformer {
|
||||
return &deviceClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClaims returns a ResourceClaimInformer.
|
||||
func (v *version) ResourceClaims() ResourceClaimInformer {
|
||||
return &resourceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceClaimTemplates returns a ResourceClaimTemplateInformer.
|
||||
func (v *version) ResourceClaimTemplates() ResourceClaimTemplateInformer {
|
||||
return &resourceClaimTemplateInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// ResourceSlices returns a ResourceSliceInformer.
|
||||
func (v *version) ResourceSlices() ResourceSliceInformer {
|
||||
return &resourceSliceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
@@ -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 v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
resourcev1beta1 "k8s.io/client-go/listers/resource/v1beta1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourceClaimInformer provides access to a shared informer and lister for
|
||||
// ResourceClaims.
|
||||
type ResourceClaimInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1beta1.ResourceClaimLister
|
||||
}
|
||||
|
||||
type resourceClaimInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewResourceClaimInformer constructs a new informer for ResourceClaim 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 NewResourceClaimInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResourceClaimInformer constructs a new informer for ResourceClaim 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 NewFilteredResourceClaimInformer(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.ResourceV1beta1().ResourceClaims(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1beta1().ResourceClaims(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&apiresourcev1beta1.ResourceClaim{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourceClaimInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resourceClaimInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1beta1.ResourceClaim{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourceClaimInformer) Lister() resourcev1beta1.ResourceClaimLister {
|
||||
return resourcev1beta1.NewResourceClaimLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -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 v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
resourcev1beta1 "k8s.io/client-go/listers/resource/v1beta1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourceClaimTemplateInformer provides access to a shared informer and lister for
|
||||
// ResourceClaimTemplates.
|
||||
type ResourceClaimTemplateInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1beta1.ResourceClaimTemplateLister
|
||||
}
|
||||
|
||||
type resourceClaimTemplateInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate 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 NewResourceClaimTemplateInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimTemplateInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResourceClaimTemplateInformer constructs a new informer for ResourceClaimTemplate 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 NewFilteredResourceClaimTemplateInformer(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.ResourceV1beta1().ResourceClaimTemplates(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1beta1().ResourceClaimTemplates(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&apiresourcev1beta1.ResourceClaimTemplate{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourceClaimTemplateInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceClaimTemplateInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resourceClaimTemplateInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1beta1.ResourceClaimTemplate{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourceClaimTemplateInformer) Lister() resourcev1beta1.ResourceClaimTemplateLister {
|
||||
return resourcev1beta1.NewResourceClaimTemplateLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -1,89 +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 v1beta1
|
||||
|
||||
import (
|
||||
context "context"
|
||||
time "time"
|
||||
|
||||
apiresourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
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"
|
||||
resourcev1beta1 "k8s.io/client-go/listers/resource/v1beta1"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// ResourceSliceInformer provides access to a shared informer and lister for
|
||||
// ResourceSlices.
|
||||
type ResourceSliceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() resourcev1beta1.ResourceSliceLister
|
||||
}
|
||||
|
||||
type resourceSliceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewResourceSliceInformer constructs a new informer for ResourceSlice 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 NewResourceSliceInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceSliceInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredResourceSliceInformer constructs a new informer for ResourceSlice 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 NewFilteredResourceSliceInformer(client kubernetes.Interface, 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.ResourceV1beta1().ResourceSlices().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.ResourceV1beta1().ResourceSlices().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&apiresourcev1beta1.ResourceSlice{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *resourceSliceInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredResourceSliceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *resourceSliceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&apiresourcev1beta1.ResourceSlice{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *resourceSliceInformer) Lister() resourcev1beta1.ResourceSliceLister {
|
||||
return resourcev1beta1.NewResourceSliceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -45,7 +45,7 @@ import (
|
||||
certificatesv1alpha1 "k8s.io/client-go/kubernetes/typed/certificates/v1alpha1"
|
||||
certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
|
||||
coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
|
||||
coordinationv1alpha2 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1"
|
||||
coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1"
|
||||
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
|
||||
@@ -69,7 +69,6 @@ import (
|
||||
rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1"
|
||||
resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3"
|
||||
resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1"
|
||||
schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1"
|
||||
schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1"
|
||||
@@ -104,7 +103,7 @@ type Interface interface {
|
||||
CertificatesV1() certificatesv1.CertificatesV1Interface
|
||||
CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface
|
||||
CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1alpha1Interface
|
||||
CoordinationV1alpha2() coordinationv1alpha2.CoordinationV1alpha2Interface
|
||||
CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface
|
||||
CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface
|
||||
CoordinationV1() coordinationv1.CoordinationV1Interface
|
||||
CoreV1() corev1.CoreV1Interface
|
||||
@@ -128,7 +127,6 @@ type Interface interface {
|
||||
RbacV1() rbacv1.RbacV1Interface
|
||||
RbacV1beta1() rbacv1beta1.RbacV1beta1Interface
|
||||
RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface
|
||||
ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface
|
||||
ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface
|
||||
SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface
|
||||
SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface
|
||||
@@ -163,7 +161,7 @@ type Clientset struct {
|
||||
certificatesV1 *certificatesv1.CertificatesV1Client
|
||||
certificatesV1beta1 *certificatesv1beta1.CertificatesV1beta1Client
|
||||
certificatesV1alpha1 *certificatesv1alpha1.CertificatesV1alpha1Client
|
||||
coordinationV1alpha2 *coordinationv1alpha2.CoordinationV1alpha2Client
|
||||
coordinationV1alpha1 *coordinationv1alpha1.CoordinationV1alpha1Client
|
||||
coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client
|
||||
coordinationV1 *coordinationv1.CoordinationV1Client
|
||||
coreV1 *corev1.CoreV1Client
|
||||
@@ -187,7 +185,6 @@ type Clientset struct {
|
||||
rbacV1 *rbacv1.RbacV1Client
|
||||
rbacV1beta1 *rbacv1beta1.RbacV1beta1Client
|
||||
rbacV1alpha1 *rbacv1alpha1.RbacV1alpha1Client
|
||||
resourceV1beta1 *resourcev1beta1.ResourceV1beta1Client
|
||||
resourceV1alpha3 *resourcev1alpha3.ResourceV1alpha3Client
|
||||
schedulingV1alpha1 *schedulingv1alpha1.SchedulingV1alpha1Client
|
||||
schedulingV1beta1 *schedulingv1beta1.SchedulingV1beta1Client
|
||||
@@ -303,9 +300,9 @@ func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1al
|
||||
return c.certificatesV1alpha1
|
||||
}
|
||||
|
||||
// CoordinationV1alpha2 retrieves the CoordinationV1alpha2Client
|
||||
func (c *Clientset) CoordinationV1alpha2() coordinationv1alpha2.CoordinationV1alpha2Interface {
|
||||
return c.coordinationV1alpha2
|
||||
// CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client
|
||||
func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface {
|
||||
return c.coordinationV1alpha1
|
||||
}
|
||||
|
||||
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
|
||||
@@ -423,11 +420,6 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface {
|
||||
return c.rbacV1alpha1
|
||||
}
|
||||
|
||||
// ResourceV1beta1 retrieves the ResourceV1beta1Client
|
||||
func (c *Clientset) ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface {
|
||||
return c.resourceV1beta1
|
||||
}
|
||||
|
||||
// ResourceV1alpha3 retrieves the ResourceV1alpha3Client
|
||||
func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface {
|
||||
return c.resourceV1alpha3
|
||||
@@ -596,7 +588,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.coordinationV1alpha2, err = coordinationv1alpha2.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
cs.coordinationV1alpha1, err = coordinationv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -692,10 +684,6 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.resourceV1beta1, err = resourcev1beta1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.resourceV1alpha3, err = resourcev1alpha3.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -770,7 +758,7 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.certificatesV1 = certificatesv1.New(c)
|
||||
cs.certificatesV1beta1 = certificatesv1beta1.New(c)
|
||||
cs.certificatesV1alpha1 = certificatesv1alpha1.New(c)
|
||||
cs.coordinationV1alpha2 = coordinationv1alpha2.New(c)
|
||||
cs.coordinationV1alpha1 = coordinationv1alpha1.New(c)
|
||||
cs.coordinationV1beta1 = coordinationv1beta1.New(c)
|
||||
cs.coordinationV1 = coordinationv1.New(c)
|
||||
cs.coreV1 = corev1.New(c)
|
||||
@@ -794,7 +782,6 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.rbacV1 = rbacv1.New(c)
|
||||
cs.rbacV1beta1 = rbacv1beta1.New(c)
|
||||
cs.rbacV1alpha1 = rbacv1alpha1.New(c)
|
||||
cs.resourceV1beta1 = resourcev1beta1.New(c)
|
||||
cs.resourceV1alpha3 = resourcev1alpha3.New(c)
|
||||
cs.schedulingV1alpha1 = schedulingv1alpha1.New(c)
|
||||
cs.schedulingV1beta1 = schedulingv1beta1.New(c)
|
||||
|
||||
@@ -69,8 +69,8 @@ import (
|
||||
fakecertificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1/fake"
|
||||
coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
|
||||
fakecoordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1/fake"
|
||||
coordinationv1alpha2 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha2"
|
||||
fakecoordinationv1alpha2 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha2/fake"
|
||||
coordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1"
|
||||
fakecoordinationv1alpha1 "k8s.io/client-go/kubernetes/typed/coordination/v1alpha1/fake"
|
||||
coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1"
|
||||
fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake"
|
||||
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
@@ -117,8 +117,6 @@ import (
|
||||
fakerbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1/fake"
|
||||
resourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3"
|
||||
fakeresourcev1alpha3 "k8s.io/client-go/kubernetes/typed/resource/v1alpha3/fake"
|
||||
resourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1"
|
||||
fakeresourcev1beta1 "k8s.io/client-go/kubernetes/typed/resource/v1beta1/fake"
|
||||
schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1"
|
||||
fakeschedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1/fake"
|
||||
schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1"
|
||||
@@ -327,9 +325,9 @@ func (c *Clientset) CertificatesV1alpha1() certificatesv1alpha1.CertificatesV1al
|
||||
return &fakecertificatesv1alpha1.FakeCertificatesV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// CoordinationV1alpha2 retrieves the CoordinationV1alpha2Client
|
||||
func (c *Clientset) CoordinationV1alpha2() coordinationv1alpha2.CoordinationV1alpha2Interface {
|
||||
return &fakecoordinationv1alpha2.FakeCoordinationV1alpha2{Fake: &c.Fake}
|
||||
// CoordinationV1alpha1 retrieves the CoordinationV1alpha1Client
|
||||
func (c *Clientset) CoordinationV1alpha1() coordinationv1alpha1.CoordinationV1alpha1Interface {
|
||||
return &fakecoordinationv1alpha1.FakeCoordinationV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// CoordinationV1beta1 retrieves the CoordinationV1beta1Client
|
||||
@@ -447,11 +445,6 @@ func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface {
|
||||
return &fakerbacv1alpha1.FakeRbacV1alpha1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// ResourceV1beta1 retrieves the ResourceV1beta1Client
|
||||
func (c *Clientset) ResourceV1beta1() resourcev1beta1.ResourceV1beta1Interface {
|
||||
return &fakeresourcev1beta1.FakeResourceV1beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// ResourceV1alpha3 retrieves the ResourceV1alpha3Client
|
||||
func (c *Clientset) ResourceV1alpha3() resourcev1alpha3.ResourceV1alpha3Interface {
|
||||
return &fakeresourcev1alpha3.FakeResourceV1alpha3{Fake: &c.Fake}
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1"
|
||||
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
coordinationv1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
@@ -65,7 +65,6 @@ import (
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
@@ -105,7 +104,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
certificatesv1.AddToScheme,
|
||||
certificatesv1beta1.AddToScheme,
|
||||
certificatesv1alpha1.AddToScheme,
|
||||
coordinationv1alpha2.AddToScheme,
|
||||
coordinationv1alpha1.AddToScheme,
|
||||
coordinationv1beta1.AddToScheme,
|
||||
coordinationv1.AddToScheme,
|
||||
corev1.AddToScheme,
|
||||
@@ -129,7 +128,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
rbacv1.AddToScheme,
|
||||
rbacv1beta1.AddToScheme,
|
||||
rbacv1alpha1.AddToScheme,
|
||||
resourcev1beta1.AddToScheme,
|
||||
resourcev1alpha3.AddToScheme,
|
||||
schedulingv1alpha1.AddToScheme,
|
||||
schedulingv1beta1.AddToScheme,
|
||||
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
certificatesv1alpha1 "k8s.io/api/certificates/v1alpha1"
|
||||
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
|
||||
coordinationv1 "k8s.io/api/coordination/v1"
|
||||
coordinationv1alpha2 "k8s.io/api/coordination/v1alpha2"
|
||||
coordinationv1alpha1 "k8s.io/api/coordination/v1alpha1"
|
||||
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
@@ -65,7 +65,6 @@ import (
|
||||
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
|
||||
rbacv1beta1 "k8s.io/api/rbac/v1beta1"
|
||||
resourcev1alpha3 "k8s.io/api/resource/v1alpha3"
|
||||
resourcev1beta1 "k8s.io/api/resource/v1beta1"
|
||||
schedulingv1 "k8s.io/api/scheduling/v1"
|
||||
schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1"
|
||||
schedulingv1beta1 "k8s.io/api/scheduling/v1beta1"
|
||||
@@ -105,7 +104,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
certificatesv1.AddToScheme,
|
||||
certificatesv1beta1.AddToScheme,
|
||||
certificatesv1alpha1.AddToScheme,
|
||||
coordinationv1alpha2.AddToScheme,
|
||||
coordinationv1alpha1.AddToScheme,
|
||||
coordinationv1beta1.AddToScheme,
|
||||
coordinationv1.AddToScheme,
|
||||
corev1.AddToScheme,
|
||||
@@ -129,7 +128,6 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
rbacv1.AddToScheme,
|
||||
rbacv1beta1.AddToScheme,
|
||||
rbacv1alpha1.AddToScheme,
|
||||
resourcev1beta1.AddToScheme,
|
||||
resourcev1alpha3.AddToScheme,
|
||||
schedulingv1alpha1.AddToScheme,
|
||||
schedulingv1beta1.AddToScheme,
|
||||
|
||||
@@ -29,19 +29,19 @@ type FakeAdmissionregistrationV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.MutatingWebhookConfigurationInterface {
|
||||
return newFakeMutatingWebhookConfigurations(c)
|
||||
return &FakeMutatingWebhookConfigurations{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicies() v1.ValidatingAdmissionPolicyInterface {
|
||||
return newFakeValidatingAdmissionPolicies(c)
|
||||
return &FakeValidatingAdmissionPolicies{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1) ValidatingAdmissionPolicyBindings() v1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return newFakeValidatingAdmissionPolicyBindings(c)
|
||||
return &FakeValidatingAdmissionPolicyBindings{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface {
|
||||
return newFakeValidatingWebhookConfigurations(c)
|
||||
return &FakeValidatingWebhookConfigurations{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||
type fakeMutatingWebhookConfigurations struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration]
|
||||
// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||
type FakeMutatingWebhookConfigurations struct {
|
||||
Fake *FakeAdmissionregistrationV1
|
||||
}
|
||||
|
||||
func newFakeMutatingWebhookConfigurations(fake *FakeAdmissionregistrationV1) typedadmissionregistrationv1.MutatingWebhookConfigurationInterface {
|
||||
return &fakeMutatingWebhookConfigurations{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.MutatingWebhookConfiguration, *v1.MutatingWebhookConfigurationList, *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"),
|
||||
v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"),
|
||||
func() *v1.MutatingWebhookConfiguration { return &v1.MutatingWebhookConfiguration{} },
|
||||
func() *v1.MutatingWebhookConfigurationList { return &v1.MutatingWebhookConfigurationList{} },
|
||||
func(dst, src *v1.MutatingWebhookConfigurationList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.MutatingWebhookConfigurationList) []*v1.MutatingWebhookConfiguration {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1.MutatingWebhookConfigurationList, items []*v1.MutatingWebhookConfiguration) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var mutatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations")
|
||||
|
||||
var mutatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration")
|
||||
|
||||
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
|
||||
func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
|
||||
emptyResult := &v1.MutatingWebhookConfigurationList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1.MutatingWebhookConfigurationList).ListMeta}
|
||||
for _, item := range obj.(*v1.MutatingWebhookConfigurationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
|
||||
func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1.MutatingWebhookConfiguration{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.MutatingWebhookConfigurationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
|
||||
func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
|
||||
func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||
if mutatingWebhookConfiguration == nil {
|
||||
return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(mutatingWebhookConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := mutatingWebhookConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
@@ -19,35 +19,168 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type fakeValidatingAdmissionPolicies struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type FakeValidatingAdmissionPolicies struct {
|
||||
Fake *FakeAdmissionregistrationV1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicies(fake *FakeAdmissionregistrationV1) typedadmissionregistrationv1.ValidatingAdmissionPolicyInterface {
|
||||
return &fakeValidatingAdmissionPolicies{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.ValidatingAdmissionPolicy, *v1.ValidatingAdmissionPolicyList, *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"),
|
||||
v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"),
|
||||
func() *v1.ValidatingAdmissionPolicy { return &v1.ValidatingAdmissionPolicy{} },
|
||||
func() *v1.ValidatingAdmissionPolicyList { return &v1.ValidatingAdmissionPolicyList{} },
|
||||
func(dst, src *v1.ValidatingAdmissionPolicyList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.ValidatingAdmissionPolicyList) []*v1.ValidatingAdmissionPolicy {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1.ValidatingAdmissionPolicyList, items []*v1.ValidatingAdmissionPolicy) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpoliciesResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicies")
|
||||
|
||||
var validatingadmissionpoliciesKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyList, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyList).ListMeta}
|
||||
for _, item := range obj.(*v1.ValidatingAdmissionPolicyList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
|
||||
func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1.ValidatingAdmissionPolicy, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1.ValidatingAdmissionPolicy{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1.ValidatingAdmissionPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
@@ -19,35 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type fakeValidatingAdmissionPolicyBindings struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type FakeValidatingAdmissionPolicyBindings struct {
|
||||
Fake *FakeAdmissionregistrationV1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicyBindings(fake *FakeAdmissionregistrationV1) typedadmissionregistrationv1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return &fakeValidatingAdmissionPolicyBindings{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.ValidatingAdmissionPolicyBinding, *v1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"),
|
||||
v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"),
|
||||
func() *v1.ValidatingAdmissionPolicyBinding { return &v1.ValidatingAdmissionPolicyBinding{} },
|
||||
func() *v1.ValidatingAdmissionPolicyBindingList { return &v1.ValidatingAdmissionPolicyBindingList{} },
|
||||
func(dst, src *v1.ValidatingAdmissionPolicyBindingList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.ValidatingAdmissionPolicyBindingList) []*v1.ValidatingAdmissionPolicyBinding {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1.ValidatingAdmissionPolicyBindingList, items []*v1.ValidatingAdmissionPolicyBinding) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpolicybindingsResource = v1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings")
|
||||
|
||||
var validatingadmissionpolicybindingsKind = v1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingAdmissionPolicyBindingList, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBindingList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1.ValidatingAdmissionPolicyBindingList).ListMeta}
|
||||
for _, item := range obj.(*v1.ValidatingAdmissionPolicyBindingList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.CreateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1.ValidatingAdmissionPolicyBinding, opts metav1.UpdateOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1.ValidatingAdmissionPolicyBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.ValidatingAdmissionPolicyBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
if validatingAdmissionPolicyBinding == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicyBinding)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicyBinding.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
@@ -19,35 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/admissionregistration/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||
type fakeValidatingWebhookConfigurations struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration]
|
||||
// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||
type FakeValidatingWebhookConfigurations struct {
|
||||
Fake *FakeAdmissionregistrationV1
|
||||
}
|
||||
|
||||
func newFakeValidatingWebhookConfigurations(fake *FakeAdmissionregistrationV1) typedadmissionregistrationv1.ValidatingWebhookConfigurationInterface {
|
||||
return &fakeValidatingWebhookConfigurations{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.ValidatingWebhookConfiguration, *v1.ValidatingWebhookConfigurationList, *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"),
|
||||
v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"),
|
||||
func() *v1.ValidatingWebhookConfiguration { return &v1.ValidatingWebhookConfiguration{} },
|
||||
func() *v1.ValidatingWebhookConfigurationList { return &v1.ValidatingWebhookConfigurationList{} },
|
||||
func(dst, src *v1.ValidatingWebhookConfigurationList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.ValidatingWebhookConfigurationList) []*v1.ValidatingWebhookConfiguration {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1.ValidatingWebhookConfigurationList, items []*v1.ValidatingWebhookConfiguration) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingwebhookconfigurationsResource = v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations")
|
||||
|
||||
var validatingwebhookconfigurationsKind = v1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration")
|
||||
|
||||
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
|
||||
func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
|
||||
emptyResult := &v1.ValidatingWebhookConfigurationList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1.ValidatingWebhookConfigurationList).ListMeta}
|
||||
for _, item := range obj.(*v1.ValidatingWebhookConfigurationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
|
||||
func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1.ValidatingWebhookConfiguration{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.ValidatingWebhookConfigurationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
|
||||
func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
|
||||
func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||
if validatingWebhookConfiguration == nil {
|
||||
return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingWebhookConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingWebhookConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
@@ -29,19 +29,19 @@ type FakeAdmissionregistrationV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1alpha1) MutatingAdmissionPolicies() v1alpha1.MutatingAdmissionPolicyInterface {
|
||||
return newFakeMutatingAdmissionPolicies(c)
|
||||
return &FakeMutatingAdmissionPolicies{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1alpha1) MutatingAdmissionPolicyBindings() v1alpha1.MutatingAdmissionPolicyBindingInterface {
|
||||
return newFakeMutatingAdmissionPolicyBindings(c)
|
||||
return &FakeMutatingAdmissionPolicyBindings{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicies() v1alpha1.ValidatingAdmissionPolicyInterface {
|
||||
return newFakeValidatingAdmissionPolicies(c)
|
||||
return &FakeValidatingAdmissionPolicies{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1alpha1) ValidatingAdmissionPolicyBindings() v1alpha1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return newFakeValidatingAdmissionPolicyBindings(c)
|
||||
return &FakeValidatingAdmissionPolicyBindings{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeMutatingAdmissionPolicies implements MutatingAdmissionPolicyInterface
|
||||
type fakeMutatingAdmissionPolicies struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha1.MutatingAdmissionPolicy, *v1alpha1.MutatingAdmissionPolicyList, *admissionregistrationv1alpha1.MutatingAdmissionPolicyApplyConfiguration]
|
||||
// FakeMutatingAdmissionPolicies implements MutatingAdmissionPolicyInterface
|
||||
type FakeMutatingAdmissionPolicies struct {
|
||||
Fake *FakeAdmissionregistrationV1alpha1
|
||||
}
|
||||
|
||||
func newFakeMutatingAdmissionPolicies(fake *FakeAdmissionregistrationV1alpha1) typedadmissionregistrationv1alpha1.MutatingAdmissionPolicyInterface {
|
||||
return &fakeMutatingAdmissionPolicies{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha1.MutatingAdmissionPolicy, *v1alpha1.MutatingAdmissionPolicyList, *admissionregistrationv1alpha1.MutatingAdmissionPolicyApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("mutatingadmissionpolicies"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicy"),
|
||||
func() *v1alpha1.MutatingAdmissionPolicy { return &v1alpha1.MutatingAdmissionPolicy{} },
|
||||
func() *v1alpha1.MutatingAdmissionPolicyList { return &v1alpha1.MutatingAdmissionPolicyList{} },
|
||||
func(dst, src *v1alpha1.MutatingAdmissionPolicyList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.MutatingAdmissionPolicyList) []*v1alpha1.MutatingAdmissionPolicy {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.MutatingAdmissionPolicyList, items []*v1alpha1.MutatingAdmissionPolicy) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var mutatingadmissionpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("mutatingadmissionpolicies")
|
||||
|
||||
var mutatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicy")
|
||||
|
||||
// Get takes name of the mutatingAdmissionPolicy, and returns the corresponding mutatingAdmissionPolicy object, and an error if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MutatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(mutatingadmissionpoliciesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MutatingAdmissionPolicies that match those selectors.
|
||||
func (c *FakeMutatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MutatingAdmissionPolicyList, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(mutatingadmissionpoliciesResource, mutatingadmissionpoliciesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.MutatingAdmissionPolicyList{ListMeta: obj.(*v1alpha1.MutatingAdmissionPolicyList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.MutatingAdmissionPolicyList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested mutatingAdmissionPolicies.
|
||||
func (c *FakeMutatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingadmissionpoliciesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a mutatingAdmissionPolicy and creates it. Returns the server's representation of the mutatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicies) Create(ctx context.Context, mutatingAdmissionPolicy *v1alpha1.MutatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.MutatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(mutatingadmissionpoliciesResource, mutatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a mutatingAdmissionPolicy and updates it. Returns the server's representation of the mutatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicies) Update(ctx context.Context, mutatingAdmissionPolicy *v1alpha1.MutatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.MutatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(mutatingadmissionpoliciesResource, mutatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the mutatingAdmissionPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMutatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(mutatingadmissionpoliciesResource, name, opts), &v1alpha1.MutatingAdmissionPolicy{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMutatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(mutatingadmissionpoliciesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.MutatingAdmissionPolicyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched mutatingAdmissionPolicy.
|
||||
func (c *FakeMutatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MutatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingAdmissionPolicy.
|
||||
func (c *FakeMutatingAdmissionPolicies) Apply(ctx context.Context, mutatingAdmissionPolicy *admissionregistrationv1alpha1.MutatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MutatingAdmissionPolicy, err error) {
|
||||
if mutatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("mutatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(mutatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := mutatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("mutatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
@@ -19,37 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeMutatingAdmissionPolicyBindings implements MutatingAdmissionPolicyBindingInterface
|
||||
type fakeMutatingAdmissionPolicyBindings struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha1.MutatingAdmissionPolicyBinding, *v1alpha1.MutatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingApplyConfiguration]
|
||||
// FakeMutatingAdmissionPolicyBindings implements MutatingAdmissionPolicyBindingInterface
|
||||
type FakeMutatingAdmissionPolicyBindings struct {
|
||||
Fake *FakeAdmissionregistrationV1alpha1
|
||||
}
|
||||
|
||||
func newFakeMutatingAdmissionPolicyBindings(fake *FakeAdmissionregistrationV1alpha1) typedadmissionregistrationv1alpha1.MutatingAdmissionPolicyBindingInterface {
|
||||
return &fakeMutatingAdmissionPolicyBindings{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha1.MutatingAdmissionPolicyBinding, *v1alpha1.MutatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("mutatingadmissionpolicybindings"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicyBinding"),
|
||||
func() *v1alpha1.MutatingAdmissionPolicyBinding { return &v1alpha1.MutatingAdmissionPolicyBinding{} },
|
||||
func() *v1alpha1.MutatingAdmissionPolicyBindingList {
|
||||
return &v1alpha1.MutatingAdmissionPolicyBindingList{}
|
||||
},
|
||||
func(dst, src *v1alpha1.MutatingAdmissionPolicyBindingList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.MutatingAdmissionPolicyBindingList) []*v1alpha1.MutatingAdmissionPolicyBinding {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.MutatingAdmissionPolicyBindingList, items []*v1alpha1.MutatingAdmissionPolicyBinding) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var mutatingadmissionpolicybindingsResource = v1alpha1.SchemeGroupVersion.WithResource("mutatingadmissionpolicybindings")
|
||||
|
||||
var mutatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind("MutatingAdmissionPolicyBinding")
|
||||
|
||||
// Get takes name of the mutatingAdmissionPolicyBinding, and returns the corresponding mutatingAdmissionPolicyBinding object, and an error if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.MutatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(mutatingadmissionpolicybindingsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MutatingAdmissionPolicyBindings that match those selectors.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.MutatingAdmissionPolicyBindingList, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBindingList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(mutatingadmissionpolicybindingsResource, mutatingadmissionpolicybindingsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.MutatingAdmissionPolicyBindingList{ListMeta: obj.(*v1alpha1.MutatingAdmissionPolicyBindingList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.MutatingAdmissionPolicyBindingList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested mutatingAdmissionPolicyBindings.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingadmissionpolicybindingsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a mutatingAdmissionPolicyBinding and creates it. Returns the server's representation of the mutatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Create(ctx context.Context, mutatingAdmissionPolicyBinding *v1alpha1.MutatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.MutatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(mutatingadmissionpolicybindingsResource, mutatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a mutatingAdmissionPolicyBinding and updates it. Returns the server's representation of the mutatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Update(ctx context.Context, mutatingAdmissionPolicyBinding *v1alpha1.MutatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.MutatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(mutatingadmissionpolicybindingsResource, mutatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the mutatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(mutatingadmissionpolicybindingsResource, name, opts), &v1alpha1.MutatingAdmissionPolicyBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(mutatingadmissionpolicybindingsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.MutatingAdmissionPolicyBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched mutatingAdmissionPolicyBinding.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.MutatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingAdmissionPolicyBinding.
|
||||
func (c *FakeMutatingAdmissionPolicyBindings) Apply(ctx context.Context, mutatingAdmissionPolicyBinding *admissionregistrationv1alpha1.MutatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.MutatingAdmissionPolicyBinding, err error) {
|
||||
if mutatingAdmissionPolicyBinding == nil {
|
||||
return nil, fmt.Errorf("mutatingAdmissionPolicyBinding provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(mutatingAdmissionPolicyBinding)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := mutatingAdmissionPolicyBinding.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("mutatingAdmissionPolicyBinding.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.MutatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.MutatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
@@ -19,35 +19,168 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type fakeValidatingAdmissionPolicies struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type FakeValidatingAdmissionPolicies struct {
|
||||
Fake *FakeAdmissionregistrationV1alpha1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicies(fake *FakeAdmissionregistrationV1alpha1) typedadmissionregistrationv1alpha1.ValidatingAdmissionPolicyInterface {
|
||||
return &fakeValidatingAdmissionPolicies{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicy, *v1alpha1.ValidatingAdmissionPolicyList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"),
|
||||
func() *v1alpha1.ValidatingAdmissionPolicy { return &v1alpha1.ValidatingAdmissionPolicy{} },
|
||||
func() *v1alpha1.ValidatingAdmissionPolicyList { return &v1alpha1.ValidatingAdmissionPolicyList{} },
|
||||
func(dst, src *v1alpha1.ValidatingAdmissionPolicyList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.ValidatingAdmissionPolicyList) []*v1alpha1.ValidatingAdmissionPolicy {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.ValidatingAdmissionPolicyList, items []*v1alpha1.ValidatingAdmissionPolicy) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicies")
|
||||
|
||||
var validatingadmissionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyList, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
|
||||
func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1alpha1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1alpha1.ValidatingAdmissionPolicy{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1alpha1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
@@ -19,37 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1alpha1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1alpha1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type fakeValidatingAdmissionPolicyBindings struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type FakeValidatingAdmissionPolicyBindings struct {
|
||||
Fake *FakeAdmissionregistrationV1alpha1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicyBindings(fake *FakeAdmissionregistrationV1alpha1) typedadmissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return &fakeValidatingAdmissionPolicyBindings{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha1.ValidatingAdmissionPolicyBinding, *v1alpha1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"),
|
||||
func() *v1alpha1.ValidatingAdmissionPolicyBinding { return &v1alpha1.ValidatingAdmissionPolicyBinding{} },
|
||||
func() *v1alpha1.ValidatingAdmissionPolicyBindingList {
|
||||
return &v1alpha1.ValidatingAdmissionPolicyBindingList{}
|
||||
},
|
||||
func(dst, src *v1alpha1.ValidatingAdmissionPolicyBindingList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.ValidatingAdmissionPolicyBindingList) []*v1alpha1.ValidatingAdmissionPolicyBinding {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.ValidatingAdmissionPolicyBindingList, items []*v1alpha1.ValidatingAdmissionPolicyBinding) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpolicybindingsResource = v1alpha1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings")
|
||||
|
||||
var validatingadmissionpolicybindingsKind = v1alpha1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ValidatingAdmissionPolicyBindingList, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBindingList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.ValidatingAdmissionPolicyBindingList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1alpha1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1alpha1.ValidatingAdmissionPolicyBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.ValidatingAdmissionPolicyBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1alpha1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
if validatingAdmissionPolicyBinding == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicyBinding)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicyBinding.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
@@ -29,19 +29,19 @@ type FakeAdmissionregistrationV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1beta1) MutatingWebhookConfigurations() v1beta1.MutatingWebhookConfigurationInterface {
|
||||
return newFakeMutatingWebhookConfigurations(c)
|
||||
return &FakeMutatingWebhookConfigurations{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicies() v1beta1.ValidatingAdmissionPolicyInterface {
|
||||
return newFakeValidatingAdmissionPolicies(c)
|
||||
return &FakeValidatingAdmissionPolicies{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1beta1) ValidatingAdmissionPolicyBindings() v1beta1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return newFakeValidatingAdmissionPolicyBindings(c)
|
||||
return &FakeValidatingAdmissionPolicyBindings{c}
|
||||
}
|
||||
|
||||
func (c *FakeAdmissionregistrationV1beta1) ValidatingWebhookConfigurations() v1beta1.ValidatingWebhookConfigurationInterface {
|
||||
return newFakeValidatingWebhookConfigurations(c)
|
||||
return &FakeValidatingWebhookConfigurations{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||
type fakeMutatingWebhookConfigurations struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration]
|
||||
// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||
type FakeMutatingWebhookConfigurations struct {
|
||||
Fake *FakeAdmissionregistrationV1beta1
|
||||
}
|
||||
|
||||
func newFakeMutatingWebhookConfigurations(fake *FakeAdmissionregistrationV1beta1) typedadmissionregistrationv1beta1.MutatingWebhookConfigurationInterface {
|
||||
return &fakeMutatingWebhookConfigurations{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.MutatingWebhookConfiguration, *v1beta1.MutatingWebhookConfigurationList, *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration"),
|
||||
func() *v1beta1.MutatingWebhookConfiguration { return &v1beta1.MutatingWebhookConfiguration{} },
|
||||
func() *v1beta1.MutatingWebhookConfigurationList { return &v1beta1.MutatingWebhookConfigurationList{} },
|
||||
func(dst, src *v1beta1.MutatingWebhookConfigurationList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.MutatingWebhookConfigurationList) []*v1beta1.MutatingWebhookConfiguration {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.MutatingWebhookConfigurationList, items []*v1beta1.MutatingWebhookConfiguration) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var mutatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations")
|
||||
|
||||
var mutatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("MutatingWebhookConfiguration")
|
||||
|
||||
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(mutatingwebhookconfigurationsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
|
||||
func (c *FakeMutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) {
|
||||
emptyResult := &v1beta1.MutatingWebhookConfigurationList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.MutatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.MutatingWebhookConfigurationList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.MutatingWebhookConfigurationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
|
||||
func (c *FakeMutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(mutatingwebhookconfigurationsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeMutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(mutatingwebhookconfigurationsResource, name, opts), &v1beta1.MutatingWebhookConfiguration{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(mutatingwebhookconfigurationsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.MutatingWebhookConfigurationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
|
||||
func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
|
||||
func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
|
||||
if mutatingWebhookConfiguration == nil {
|
||||
return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(mutatingWebhookConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := mutatingWebhookConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.MutatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.MutatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
@@ -19,35 +19,168 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type fakeValidatingAdmissionPolicies struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicies implements ValidatingAdmissionPolicyInterface
|
||||
type FakeValidatingAdmissionPolicies struct {
|
||||
Fake *FakeAdmissionregistrationV1beta1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicies(fake *FakeAdmissionregistrationV1beta1) typedadmissionregistrationv1beta1.ValidatingAdmissionPolicyInterface {
|
||||
return &fakeValidatingAdmissionPolicies{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicy, *v1beta1.ValidatingAdmissionPolicyList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy"),
|
||||
func() *v1beta1.ValidatingAdmissionPolicy { return &v1beta1.ValidatingAdmissionPolicy{} },
|
||||
func() *v1beta1.ValidatingAdmissionPolicyList { return &v1beta1.ValidatingAdmissionPolicyList{} },
|
||||
func(dst, src *v1beta1.ValidatingAdmissionPolicyList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.ValidatingAdmissionPolicyList) []*v1beta1.ValidatingAdmissionPolicy {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.ValidatingAdmissionPolicyList, items []*v1beta1.ValidatingAdmissionPolicy) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpoliciesResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicies")
|
||||
|
||||
var validatingadmissionpoliciesKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicy")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicy, and returns the corresponding validatingAdmissionPolicy object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpoliciesResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicies that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyList, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpoliciesResource, validatingadmissionpoliciesKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.ValidatingAdmissionPolicyList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicies.
|
||||
func (c *FakeValidatingAdmissionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpoliciesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicy and creates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Create(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicy and updates it. Returns the server's representation of the validatingAdmissionPolicy, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicies) Update(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpoliciesResource, validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) UpdateStatus(ctx context.Context, validatingAdmissionPolicy *v1beta1.ValidatingAdmissionPolicy, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(validatingadmissionpoliciesResource, "status", validatingAdmissionPolicy, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicy and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpoliciesResource, name, opts), &v1beta1.ValidatingAdmissionPolicy{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpoliciesResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicy.
|
||||
func (c *FakeValidatingAdmissionPolicies) Apply(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeValidatingAdmissionPolicies) ApplyStatus(ctx context.Context, validatingAdmissionPolicy *admissionregistrationv1beta1.ValidatingAdmissionPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicy, err error) {
|
||||
if validatingAdmissionPolicy == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicy.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicy.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicy{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpoliciesResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicy), err
|
||||
}
|
||||
|
||||
@@ -19,37 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type fakeValidatingAdmissionPolicyBindings struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration]
|
||||
// FakeValidatingAdmissionPolicyBindings implements ValidatingAdmissionPolicyBindingInterface
|
||||
type FakeValidatingAdmissionPolicyBindings struct {
|
||||
Fake *FakeAdmissionregistrationV1beta1
|
||||
}
|
||||
|
||||
func newFakeValidatingAdmissionPolicyBindings(fake *FakeAdmissionregistrationV1beta1) typedadmissionregistrationv1beta1.ValidatingAdmissionPolicyBindingInterface {
|
||||
return &fakeValidatingAdmissionPolicyBindings{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.ValidatingAdmissionPolicyBinding, *v1beta1.ValidatingAdmissionPolicyBindingList, *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding"),
|
||||
func() *v1beta1.ValidatingAdmissionPolicyBinding { return &v1beta1.ValidatingAdmissionPolicyBinding{} },
|
||||
func() *v1beta1.ValidatingAdmissionPolicyBindingList {
|
||||
return &v1beta1.ValidatingAdmissionPolicyBindingList{}
|
||||
},
|
||||
func(dst, src *v1beta1.ValidatingAdmissionPolicyBindingList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.ValidatingAdmissionPolicyBindingList) []*v1beta1.ValidatingAdmissionPolicyBinding {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.ValidatingAdmissionPolicyBindingList, items []*v1beta1.ValidatingAdmissionPolicyBinding) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingadmissionpolicybindingsResource = v1beta1.SchemeGroupVersion.WithResource("validatingadmissionpolicybindings")
|
||||
|
||||
var validatingadmissionpolicybindingsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingAdmissionPolicyBinding")
|
||||
|
||||
// Get takes name of the validatingAdmissionPolicyBinding, and returns the corresponding validatingAdmissionPolicyBinding object, and an error if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingadmissionpolicybindingsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingAdmissionPolicyBindings that match those selectors.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingAdmissionPolicyBindingList, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBindingList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingadmissionpolicybindingsResource, validatingadmissionpolicybindingsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.ValidatingAdmissionPolicyBindingList{ListMeta: obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.ValidatingAdmissionPolicyBindingList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingAdmissionPolicyBindings.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingadmissionpolicybindingsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingAdmissionPolicyBinding and creates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Create(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.CreateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingAdmissionPolicyBinding and updates it. Returns the server's representation of the validatingAdmissionPolicyBinding, and an error, if there is any.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Update(ctx context.Context, validatingAdmissionPolicyBinding *v1beta1.ValidatingAdmissionPolicyBinding, opts v1.UpdateOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingadmissionpolicybindingsResource, validatingAdmissionPolicyBinding, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingAdmissionPolicyBinding and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingadmissionpolicybindingsResource, name, opts), &v1beta1.ValidatingAdmissionPolicyBinding{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingadmissionpolicybindingsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.ValidatingAdmissionPolicyBindingList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingAdmissionPolicyBinding.
|
||||
func (c *FakeValidatingAdmissionPolicyBindings) Apply(ctx context.Context, validatingAdmissionPolicyBinding *admissionregistrationv1beta1.ValidatingAdmissionPolicyBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingAdmissionPolicyBinding, err error) {
|
||||
if validatingAdmissionPolicyBinding == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingAdmissionPolicyBinding)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingAdmissionPolicyBinding.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingAdmissionPolicyBinding.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.ValidatingAdmissionPolicyBinding{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingadmissionpolicybindingsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingAdmissionPolicyBinding), err
|
||||
}
|
||||
|
||||
@@ -19,37 +19,133 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||
type fakeValidatingWebhookConfigurations struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration]
|
||||
// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||
type FakeValidatingWebhookConfigurations struct {
|
||||
Fake *FakeAdmissionregistrationV1beta1
|
||||
}
|
||||
|
||||
func newFakeValidatingWebhookConfigurations(fake *FakeAdmissionregistrationV1beta1) typedadmissionregistrationv1beta1.ValidatingWebhookConfigurationInterface {
|
||||
return &fakeValidatingWebhookConfigurations{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.ValidatingWebhookConfiguration, *v1beta1.ValidatingWebhookConfigurationList, *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration"),
|
||||
func() *v1beta1.ValidatingWebhookConfiguration { return &v1beta1.ValidatingWebhookConfiguration{} },
|
||||
func() *v1beta1.ValidatingWebhookConfigurationList {
|
||||
return &v1beta1.ValidatingWebhookConfigurationList{}
|
||||
},
|
||||
func(dst, src *v1beta1.ValidatingWebhookConfigurationList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.ValidatingWebhookConfigurationList) []*v1beta1.ValidatingWebhookConfiguration {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.ValidatingWebhookConfigurationList, items []*v1beta1.ValidatingWebhookConfiguration) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var validatingwebhookconfigurationsResource = v1beta1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations")
|
||||
|
||||
var validatingwebhookconfigurationsKind = v1beta1.SchemeGroupVersion.WithKind("ValidatingWebhookConfiguration")
|
||||
|
||||
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(validatingwebhookconfigurationsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
|
||||
func (c *FakeValidatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfigurationList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.ValidatingWebhookConfigurationList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.ValidatingWebhookConfigurationList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
|
||||
func (c *FakeValidatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(validatingwebhookconfigurationsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||
func (c *FakeValidatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(validatingwebhookconfigurationsResource, validatingWebhookConfiguration, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeValidatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(validatingwebhookconfigurationsResource, name, opts), &v1beta1.ValidatingWebhookConfiguration{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(validatingwebhookconfigurationsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
|
||||
func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
|
||||
func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
|
||||
if validatingWebhookConfiguration == nil {
|
||||
return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(validatingWebhookConfiguration)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := validatingWebhookConfiguration.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.ValidatingWebhookConfiguration{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeInternalV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeInternalV1alpha1) StorageVersions() v1alpha1.StorageVersionInterface {
|
||||
return newFakeStorageVersions(c)
|
||||
return &FakeStorageVersions{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,168 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedapiserverinternalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeStorageVersions implements StorageVersionInterface
|
||||
type fakeStorageVersions struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration]
|
||||
// FakeStorageVersions implements StorageVersionInterface
|
||||
type FakeStorageVersions struct {
|
||||
Fake *FakeInternalV1alpha1
|
||||
}
|
||||
|
||||
func newFakeStorageVersions(fake *FakeInternalV1alpha1) typedapiserverinternalv1alpha1.StorageVersionInterface {
|
||||
return &fakeStorageVersions{
|
||||
gentype.NewFakeClientWithListAndApply[*v1alpha1.StorageVersion, *v1alpha1.StorageVersionList, *apiserverinternalv1alpha1.StorageVersionApplyConfiguration](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("storageversions"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("StorageVersion"),
|
||||
func() *v1alpha1.StorageVersion { return &v1alpha1.StorageVersion{} },
|
||||
func() *v1alpha1.StorageVersionList { return &v1alpha1.StorageVersionList{} },
|
||||
func(dst, src *v1alpha1.StorageVersionList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1alpha1.StorageVersionList) []*v1alpha1.StorageVersion {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1alpha1.StorageVersionList, items []*v1alpha1.StorageVersion) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var storageversionsResource = v1alpha1.SchemeGroupVersion.WithResource("storageversions")
|
||||
|
||||
var storageversionsKind = v1alpha1.SchemeGroupVersion.WithKind("StorageVersion")
|
||||
|
||||
// Get takes name of the storageVersion, and returns the corresponding storageVersion object, and an error if there is any.
|
||||
func (c *FakeStorageVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetActionWithOptions(storageversionsResource, name, options), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of StorageVersions that match those selectors.
|
||||
func (c *FakeStorageVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.StorageVersionList, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersionList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListActionWithOptions(storageversionsResource, storageversionsKind, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1alpha1.StorageVersionList{ListMeta: obj.(*v1alpha1.StorageVersionList).ListMeta}
|
||||
for _, item := range obj.(*v1alpha1.StorageVersionList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested storageVersions.
|
||||
func (c *FakeStorageVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchActionWithOptions(storageversionsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a storageVersion and creates it. Returns the server's representation of the storageVersion, and an error, if there is any.
|
||||
func (c *FakeStorageVersions) Create(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.CreateOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a storageVersion and updates it. Returns the server's representation of the storageVersion, and an error, if there is any.
|
||||
func (c *FakeStorageVersions) Update(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateActionWithOptions(storageversionsResource, storageVersion, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeStorageVersions) UpdateStatus(ctx context.Context, storageVersion *v1alpha1.StorageVersion, opts v1.UpdateOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceActionWithOptions(storageversionsResource, "status", storageVersion, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// Delete takes name of the storageVersion and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStorageVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteActionWithOptions(storageversionsResource, name, opts), &v1alpha1.StorageVersion{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeStorageVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionActionWithOptions(storageversionsResource, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1alpha1.StorageVersionList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched storageVersion.
|
||||
func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error) {
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, name, pt, data, opts, subresources...), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion.
|
||||
func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
if storageVersion == nil {
|
||||
return nil, fmt.Errorf("storageVersion provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(storageVersion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := storageVersion.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) {
|
||||
if storageVersion == nil {
|
||||
return nil, fmt.Errorf("storageVersion provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(storageVersion)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := storageVersion.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1alpha1.StorageVersion{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceActionWithOptions(storageversionsResource, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.StorageVersion), err
|
||||
}
|
||||
|
||||
@@ -29,23 +29,23 @@ type FakeAppsV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1) ControllerRevisions(namespace string) v1.ControllerRevisionInterface {
|
||||
return newFakeControllerRevisions(c, namespace)
|
||||
return &FakeControllerRevisions{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1) DaemonSets(namespace string) v1.DaemonSetInterface {
|
||||
return newFakeDaemonSets(c, namespace)
|
||||
return &FakeDaemonSets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1) Deployments(namespace string) v1.DeploymentInterface {
|
||||
return newFakeDeployments(c, namespace)
|
||||
return &FakeDeployments{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1) ReplicaSets(namespace string) v1.ReplicaSetInterface {
|
||||
return newFakeReplicaSets(c, namespace)
|
||||
return &FakeReplicaSets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1) StatefulSets(namespace string) v1.StatefulSetInterface {
|
||||
return newFakeStatefulSets(c, namespace)
|
||||
return &FakeStatefulSets{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,142 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeControllerRevisions implements ControllerRevisionInterface
|
||||
type fakeControllerRevisions struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration]
|
||||
// FakeControllerRevisions implements ControllerRevisionInterface
|
||||
type FakeControllerRevisions struct {
|
||||
Fake *FakeAppsV1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeControllerRevisions(fake *FakeAppsV1, namespace string) typedappsv1.ControllerRevisionInterface {
|
||||
return &fakeControllerRevisions{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.ControllerRevision, *v1.ControllerRevisionList, *appsv1.ControllerRevisionApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("controllerrevisions"),
|
||||
v1.SchemeGroupVersion.WithKind("ControllerRevision"),
|
||||
func() *v1.ControllerRevision { return &v1.ControllerRevision{} },
|
||||
func() *v1.ControllerRevisionList { return &v1.ControllerRevisionList{} },
|
||||
func(dst, src *v1.ControllerRevisionList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.ControllerRevisionList) []*v1.ControllerRevision {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1.ControllerRevisionList, items []*v1.ControllerRevision) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var controllerrevisionsResource = v1.SchemeGroupVersion.WithResource("controllerrevisions")
|
||||
|
||||
var controllerrevisionsKind = v1.SchemeGroupVersion.WithKind("ControllerRevision")
|
||||
|
||||
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
|
||||
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) {
|
||||
emptyResult := &v1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
|
||||
func (c *FakeControllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) {
|
||||
emptyResult := &v1.ControllerRevisionList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.ControllerRevisionList{ListMeta: obj.(*v1.ControllerRevisionList).ListMeta}
|
||||
for _, item := range obj.(*v1.ControllerRevisionList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested controllerRevisions.
|
||||
func (c *FakeControllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) {
|
||||
emptyResult := &v1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) {
|
||||
emptyResult := &v1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1.ControllerRevision{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.ControllerRevisionList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched controllerRevision.
|
||||
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) {
|
||||
emptyResult := &v1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
|
||||
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error) {
|
||||
if controllerRevision == nil {
|
||||
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(controllerRevision)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := controllerRevision.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ControllerRevision), err
|
||||
}
|
||||
|
||||
@@ -19,31 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeDaemonSets implements DaemonSetInterface
|
||||
type fakeDaemonSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration]
|
||||
// FakeDaemonSets implements DaemonSetInterface
|
||||
type FakeDaemonSets struct {
|
||||
Fake *FakeAppsV1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeDaemonSets(fake *FakeAppsV1, namespace string) typedappsv1.DaemonSetInterface {
|
||||
return &fakeDaemonSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.DaemonSet, *v1.DaemonSetList, *appsv1.DaemonSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("daemonsets"),
|
||||
v1.SchemeGroupVersion.WithKind("DaemonSet"),
|
||||
func() *v1.DaemonSet { return &v1.DaemonSet{} },
|
||||
func() *v1.DaemonSetList { return &v1.DaemonSetList{} },
|
||||
func(dst, src *v1.DaemonSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.DaemonSetList) []*v1.DaemonSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.DaemonSetList, items []*v1.DaemonSet) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
var daemonsetsResource = v1.SchemeGroupVersion.WithResource("daemonsets")
|
||||
|
||||
var daemonsetsKind = v1.SchemeGroupVersion.WithKind("DaemonSet")
|
||||
|
||||
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
|
||||
func (c *FakeDaemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) {
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
|
||||
func (c *FakeDaemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) {
|
||||
emptyResult := &v1.DaemonSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.DaemonSetList{ListMeta: obj.(*v1.DaemonSetList).ListMeta}
|
||||
for _, item := range obj.(*v1.DaemonSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested daemonSets.
|
||||
func (c *FakeDaemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) {
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) {
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) {
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1.DaemonSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.DaemonSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched daemonSet.
|
||||
func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) {
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
|
||||
func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.DaemonSet), err
|
||||
}
|
||||
|
||||
@@ -26,42 +26,183 @@ import (
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
|
||||
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeDeployments implements DeploymentInterface
|
||||
type fakeDeployments struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration]
|
||||
// FakeDeployments implements DeploymentInterface
|
||||
type FakeDeployments struct {
|
||||
Fake *FakeAppsV1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeDeployments(fake *FakeAppsV1, namespace string) typedappsv1.DeploymentInterface {
|
||||
return &fakeDeployments{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.Deployment, *v1.DeploymentList, *appsv1.DeploymentApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("deployments"),
|
||||
v1.SchemeGroupVersion.WithKind("Deployment"),
|
||||
func() *v1.Deployment { return &v1.Deployment{} },
|
||||
func() *v1.DeploymentList { return &v1.DeploymentList{} },
|
||||
func(dst, src *v1.DeploymentList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.DeploymentList) []*v1.Deployment { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.DeploymentList, items []*v1.Deployment) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
var deploymentsResource = v1.SchemeGroupVersion.WithResource("deployments")
|
||||
|
||||
var deploymentsKind = v1.SchemeGroupVersion.WithKind("Deployment")
|
||||
|
||||
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
|
||||
func (c *FakeDeployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) {
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
|
||||
func (c *FakeDeployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) {
|
||||
emptyResult := &v1.DeploymentList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.DeploymentList{ListMeta: obj.(*v1.DeploymentList).ListMeta}
|
||||
for _, item := range obj.(*v1.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deployments.
|
||||
func (c *FakeDeployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) {
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) {
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) {
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1.Deployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.DeploymentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) {
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
|
||||
func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Deployment), err
|
||||
}
|
||||
|
||||
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
|
||||
func (c *fakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(c.Resource(), c.Namespace(), "scale", deploymentName, options), emptyResult)
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(deploymentsResource, c.ns, "scale", deploymentName, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -70,10 +211,10 @@ func (c *fakeDeployments) GetScale(ctx context.Context, deploymentName string, o
|
||||
}
|
||||
|
||||
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
|
||||
func (c *fakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeDeployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "scale", c.Namespace(), scale, opts), &autoscalingv1.Scale{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{})
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -83,7 +224,7 @@ func (c *fakeDeployments) UpdateScale(ctx context.Context, deploymentName string
|
||||
|
||||
// ApplyScale takes top resource name and the apply declarative configuration for scale,
|
||||
// applies it and returns the applied scale, and an error, if there is any.
|
||||
func (c *fakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeDeployments) ApplyScale(ctx context.Context, deploymentName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
if scale == nil {
|
||||
return nil, fmt.Errorf("scale provided to ApplyScale must not be nil")
|
||||
}
|
||||
@@ -93,7 +234,7 @@ func (c *fakeDeployments) ApplyScale(ctx context.Context, deploymentName string,
|
||||
}
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(c.Resource(), c.Namespace(), deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, deploymentName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
|
||||
@@ -26,42 +26,183 @@ import (
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
|
||||
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeReplicaSets implements ReplicaSetInterface
|
||||
type fakeReplicaSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration]
|
||||
// FakeReplicaSets implements ReplicaSetInterface
|
||||
type FakeReplicaSets struct {
|
||||
Fake *FakeAppsV1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeReplicaSets(fake *FakeAppsV1, namespace string) typedappsv1.ReplicaSetInterface {
|
||||
return &fakeReplicaSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.ReplicaSet, *v1.ReplicaSetList, *appsv1.ReplicaSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("replicasets"),
|
||||
v1.SchemeGroupVersion.WithKind("ReplicaSet"),
|
||||
func() *v1.ReplicaSet { return &v1.ReplicaSet{} },
|
||||
func() *v1.ReplicaSetList { return &v1.ReplicaSetList{} },
|
||||
func(dst, src *v1.ReplicaSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.ReplicaSetList) []*v1.ReplicaSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.ReplicaSetList, items []*v1.ReplicaSet) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
var replicasetsResource = v1.SchemeGroupVersion.WithResource("replicasets")
|
||||
|
||||
var replicasetsKind = v1.SchemeGroupVersion.WithKind("ReplicaSet")
|
||||
|
||||
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
|
||||
func (c *FakeReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) {
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
|
||||
func (c *FakeReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) {
|
||||
emptyResult := &v1.ReplicaSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.ReplicaSetList{ListMeta: obj.(*v1.ReplicaSetList).ListMeta}
|
||||
for _, item := range obj.(*v1.ReplicaSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested replicaSets.
|
||||
func (c *FakeReplicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) {
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) {
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) {
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1.ReplicaSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.ReplicaSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched replicaSet.
|
||||
func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) {
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
|
||||
func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) {
|
||||
if replicaSet == nil {
|
||||
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(replicaSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := replicaSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error) {
|
||||
if replicaSet == nil {
|
||||
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(replicaSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := replicaSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.ReplicaSet), err
|
||||
}
|
||||
|
||||
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
|
||||
func (c *fakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(c.Resource(), c.Namespace(), "scale", replicaSetName, options), emptyResult)
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(replicasetsResource, c.ns, "scale", replicaSetName, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -70,10 +211,10 @@ func (c *fakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, o
|
||||
}
|
||||
|
||||
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
|
||||
func (c *fakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "scale", c.Namespace(), scale, opts), &autoscalingv1.Scale{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{})
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -83,7 +224,7 @@ func (c *fakeReplicaSets) UpdateScale(ctx context.Context, replicaSetName string
|
||||
|
||||
// ApplyScale takes top resource name and the apply declarative configuration for scale,
|
||||
// applies it and returns the applied scale, and an error, if there is any.
|
||||
func (c *fakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
if scale == nil {
|
||||
return nil, fmt.Errorf("scale provided to ApplyScale must not be nil")
|
||||
}
|
||||
@@ -93,7 +234,7 @@ func (c *fakeReplicaSets) ApplyScale(ctx context.Context, replicaSetName string,
|
||||
}
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(c.Resource(), c.Namespace(), replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, replicaSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
|
||||
@@ -26,42 +26,183 @@ import (
|
||||
v1 "k8s.io/api/apps/v1"
|
||||
autoscalingv1 "k8s.io/api/autoscaling/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
|
||||
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeStatefulSets implements StatefulSetInterface
|
||||
type fakeStatefulSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration]
|
||||
// FakeStatefulSets implements StatefulSetInterface
|
||||
type FakeStatefulSets struct {
|
||||
Fake *FakeAppsV1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeStatefulSets(fake *FakeAppsV1, namespace string) typedappsv1.StatefulSetInterface {
|
||||
return &fakeStatefulSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1.StatefulSet, *v1.StatefulSetList, *appsv1.StatefulSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1.SchemeGroupVersion.WithResource("statefulsets"),
|
||||
v1.SchemeGroupVersion.WithKind("StatefulSet"),
|
||||
func() *v1.StatefulSet { return &v1.StatefulSet{} },
|
||||
func() *v1.StatefulSetList { return &v1.StatefulSetList{} },
|
||||
func(dst, src *v1.StatefulSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1.StatefulSetList) []*v1.StatefulSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1.StatefulSetList, items []*v1.StatefulSet) { list.Items = gentype.FromPointerSlice(items) },
|
||||
),
|
||||
fake,
|
||||
var statefulsetsResource = v1.SchemeGroupVersion.WithResource("statefulsets")
|
||||
|
||||
var statefulsetsKind = v1.SchemeGroupVersion.WithKind("StatefulSet")
|
||||
|
||||
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
|
||||
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) {
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
|
||||
func (c *FakeStatefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) {
|
||||
emptyResult := &v1.StatefulSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1.StatefulSetList{ListMeta: obj.(*v1.StatefulSetList).ListMeta}
|
||||
for _, item := range obj.(*v1.StatefulSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested statefulSets.
|
||||
func (c *FakeStatefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) {
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) {
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) {
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1.StatefulSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.StatefulSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched statefulSet.
|
||||
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) {
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
|
||||
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.StatefulSet), err
|
||||
}
|
||||
|
||||
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
|
||||
func (c *fakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(c.Resource(), c.Namespace(), "scale", statefulSetName, options), emptyResult)
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -70,10 +211,10 @@ func (c *fakeStatefulSets) GetScale(ctx context.Context, statefulSetName string,
|
||||
}
|
||||
|
||||
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
|
||||
func (c *fakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) {
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "scale", c.Namespace(), scale, opts), &autoscalingv1.Scale{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &autoscalingv1.Scale{})
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -83,7 +224,7 @@ func (c *fakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName stri
|
||||
|
||||
// ApplyScale takes top resource name and the apply declarative configuration for scale,
|
||||
// applies it and returns the applied scale, and an error, if there is any.
|
||||
func (c *fakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts metav1.ApplyOptions) (result *autoscalingv1.Scale, err error) {
|
||||
if scale == nil {
|
||||
return nil, fmt.Errorf("scale provided to ApplyScale must not be nil")
|
||||
}
|
||||
@@ -93,7 +234,7 @@ func (c *fakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin
|
||||
}
|
||||
emptyResult := &autoscalingv1.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(c.Resource(), c.Namespace(), statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
|
||||
@@ -29,15 +29,15 @@ type FakeAppsV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta1) ControllerRevisions(namespace string) v1beta1.ControllerRevisionInterface {
|
||||
return newFakeControllerRevisions(c, namespace)
|
||||
return &FakeControllerRevisions{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta1) Deployments(namespace string) v1beta1.DeploymentInterface {
|
||||
return newFakeDeployments(c, namespace)
|
||||
return &FakeDeployments{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta1) StatefulSets(namespace string) v1beta1.StatefulSetInterface {
|
||||
return newFakeStatefulSets(c, namespace)
|
||||
return &FakeStatefulSets{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,142 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/apps/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeControllerRevisions implements ControllerRevisionInterface
|
||||
type fakeControllerRevisions struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration]
|
||||
// FakeControllerRevisions implements ControllerRevisionInterface
|
||||
type FakeControllerRevisions struct {
|
||||
Fake *FakeAppsV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeControllerRevisions(fake *FakeAppsV1beta1, namespace string) typedappsv1beta1.ControllerRevisionInterface {
|
||||
return &fakeControllerRevisions{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.ControllerRevision, *v1beta1.ControllerRevisionList, *appsv1beta1.ControllerRevisionApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("controllerrevisions"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("ControllerRevision"),
|
||||
func() *v1beta1.ControllerRevision { return &v1beta1.ControllerRevision{} },
|
||||
func() *v1beta1.ControllerRevisionList { return &v1beta1.ControllerRevisionList{} },
|
||||
func(dst, src *v1beta1.ControllerRevisionList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.ControllerRevisionList) []*v1beta1.ControllerRevision {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta1.ControllerRevisionList, items []*v1beta1.ControllerRevision) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var controllerrevisionsResource = v1beta1.SchemeGroupVersion.WithResource("controllerrevisions")
|
||||
|
||||
var controllerrevisionsKind = v1beta1.SchemeGroupVersion.WithKind("ControllerRevision")
|
||||
|
||||
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
|
||||
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
|
||||
func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) {
|
||||
emptyResult := &v1beta1.ControllerRevisionList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.ControllerRevisionList{ListMeta: obj.(*v1beta1.ControllerRevisionList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.ControllerRevisionList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested controllerRevisions.
|
||||
func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta1.ControllerRevision{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.ControllerRevisionList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched controllerRevision.
|
||||
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
|
||||
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) {
|
||||
if controllerRevision == nil {
|
||||
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(controllerRevision)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := controllerRevision.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.ControllerRevision), err
|
||||
}
|
||||
|
||||
@@ -19,33 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/apps/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeDeployments implements DeploymentInterface
|
||||
type fakeDeployments struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration]
|
||||
// FakeDeployments implements DeploymentInterface
|
||||
type FakeDeployments struct {
|
||||
Fake *FakeAppsV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeDeployments(fake *FakeAppsV1beta1, namespace string) typedappsv1beta1.DeploymentInterface {
|
||||
return &fakeDeployments{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.Deployment, *v1beta1.DeploymentList, *appsv1beta1.DeploymentApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("deployments"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("Deployment"),
|
||||
func() *v1beta1.Deployment { return &v1beta1.Deployment{} },
|
||||
func() *v1beta1.DeploymentList { return &v1beta1.DeploymentList{} },
|
||||
func(dst, src *v1beta1.DeploymentList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.DeploymentList) []*v1beta1.Deployment { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.DeploymentList, items []*v1beta1.Deployment) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var deploymentsResource = v1beta1.SchemeGroupVersion.WithResource("deployments")
|
||||
|
||||
var deploymentsKind = v1beta1.SchemeGroupVersion.WithKind("Deployment")
|
||||
|
||||
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
|
||||
func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) {
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
|
||||
func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
|
||||
emptyResult := &v1beta1.DeploymentList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.DeploymentList{ListMeta: obj.(*v1beta1.DeploymentList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deployments.
|
||||
func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) {
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) {
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) {
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta1.Deployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) {
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
|
||||
func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.Deployment), err
|
||||
}
|
||||
|
||||
@@ -19,33 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/apps/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeStatefulSets implements StatefulSetInterface
|
||||
type fakeStatefulSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration]
|
||||
// FakeStatefulSets implements StatefulSetInterface
|
||||
type FakeStatefulSets struct {
|
||||
Fake *FakeAppsV1beta1
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeStatefulSets(fake *FakeAppsV1beta1, namespace string) typedappsv1beta1.StatefulSetInterface {
|
||||
return &fakeStatefulSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta1.StatefulSet, *v1beta1.StatefulSetList, *appsv1beta1.StatefulSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta1.SchemeGroupVersion.WithResource("statefulsets"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("StatefulSet"),
|
||||
func() *v1beta1.StatefulSet { return &v1beta1.StatefulSet{} },
|
||||
func() *v1beta1.StatefulSetList { return &v1beta1.StatefulSetList{} },
|
||||
func(dst, src *v1beta1.StatefulSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta1.StatefulSetList) []*v1beta1.StatefulSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta1.StatefulSetList, items []*v1beta1.StatefulSet) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var statefulsetsResource = v1beta1.SchemeGroupVersion.WithResource("statefulsets")
|
||||
|
||||
var statefulsetsKind = v1beta1.SchemeGroupVersion.WithKind("StatefulSet")
|
||||
|
||||
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
|
||||
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
|
||||
func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) {
|
||||
emptyResult := &v1beta1.StatefulSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta1.StatefulSetList{ListMeta: obj.(*v1beta1.StatefulSetList).ListMeta}
|
||||
for _, item := range obj.(*v1beta1.StatefulSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested statefulSets.
|
||||
func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta1.StatefulSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta1.StatefulSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched statefulSet.
|
||||
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) {
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
|
||||
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta1.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.StatefulSet), err
|
||||
}
|
||||
|
||||
@@ -29,23 +29,23 @@ type FakeAppsV1beta2 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta2) ControllerRevisions(namespace string) v1beta2.ControllerRevisionInterface {
|
||||
return newFakeControllerRevisions(c, namespace)
|
||||
return &FakeControllerRevisions{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta2) DaemonSets(namespace string) v1beta2.DaemonSetInterface {
|
||||
return newFakeDaemonSets(c, namespace)
|
||||
return &FakeDaemonSets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta2) Deployments(namespace string) v1beta2.DeploymentInterface {
|
||||
return newFakeDeployments(c, namespace)
|
||||
return &FakeDeployments{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta2) ReplicaSets(namespace string) v1beta2.ReplicaSetInterface {
|
||||
return newFakeReplicaSets(c, namespace)
|
||||
return &FakeReplicaSets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeAppsV1beta2) StatefulSets(namespace string) v1beta2.StatefulSetInterface {
|
||||
return newFakeStatefulSets(c, namespace)
|
||||
return &FakeStatefulSets{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,35 +19,142 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeControllerRevisions implements ControllerRevisionInterface
|
||||
type fakeControllerRevisions struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration]
|
||||
// FakeControllerRevisions implements ControllerRevisionInterface
|
||||
type FakeControllerRevisions struct {
|
||||
Fake *FakeAppsV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeControllerRevisions(fake *FakeAppsV1beta2, namespace string) typedappsv1beta2.ControllerRevisionInterface {
|
||||
return &fakeControllerRevisions{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta2.ControllerRevision, *v1beta2.ControllerRevisionList, *appsv1beta2.ControllerRevisionApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("controllerrevisions"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("ControllerRevision"),
|
||||
func() *v1beta2.ControllerRevision { return &v1beta2.ControllerRevision{} },
|
||||
func() *v1beta2.ControllerRevisionList { return &v1beta2.ControllerRevisionList{} },
|
||||
func(dst, src *v1beta2.ControllerRevisionList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.ControllerRevisionList) []*v1beta2.ControllerRevision {
|
||||
return gentype.ToPointerSlice(list.Items)
|
||||
},
|
||||
func(list *v1beta2.ControllerRevisionList, items []*v1beta2.ControllerRevision) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var controllerrevisionsResource = v1beta2.SchemeGroupVersion.WithResource("controllerrevisions")
|
||||
|
||||
var controllerrevisionsKind = v1beta2.SchemeGroupVersion.WithKind("ControllerRevision")
|
||||
|
||||
// Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
|
||||
func (c *FakeControllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta2.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(controllerrevisionsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ControllerRevision), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
|
||||
func (c *FakeControllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
|
||||
emptyResult := &v1beta2.ControllerRevisionList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.ControllerRevisionList{ListMeta: obj.(*v1beta2.ControllerRevisionList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.ControllerRevisionList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested controllerRevisions.
|
||||
func (c *FakeControllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(controllerrevisionsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta2.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
|
||||
func (c *FakeControllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta2.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(controllerrevisionsResource, c.ns, controllerRevision, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeControllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(controllerrevisionsResource, c.ns, name, opts), &v1beta2.ControllerRevision{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeControllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(controllerrevisionsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched controllerRevision.
|
||||
func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) {
|
||||
emptyResult := &v1beta2.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ControllerRevision), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
|
||||
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) {
|
||||
if controllerRevision == nil {
|
||||
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(controllerRevision)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := controllerRevision.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.ControllerRevision{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ControllerRevision), err
|
||||
}
|
||||
|
||||
@@ -19,33 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeDaemonSets implements DaemonSetInterface
|
||||
type fakeDaemonSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration]
|
||||
// FakeDaemonSets implements DaemonSetInterface
|
||||
type FakeDaemonSets struct {
|
||||
Fake *FakeAppsV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeDaemonSets(fake *FakeAppsV1beta2, namespace string) typedappsv1beta2.DaemonSetInterface {
|
||||
return &fakeDaemonSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta2.DaemonSet, *v1beta2.DaemonSetList, *appsv1beta2.DaemonSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("daemonsets"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("DaemonSet"),
|
||||
func() *v1beta2.DaemonSet { return &v1beta2.DaemonSet{} },
|
||||
func() *v1beta2.DaemonSetList { return &v1beta2.DaemonSetList{} },
|
||||
func(dst, src *v1beta2.DaemonSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.DaemonSetList) []*v1beta2.DaemonSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta2.DaemonSetList, items []*v1beta2.DaemonSet) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var daemonsetsResource = v1beta2.SchemeGroupVersion.WithResource("daemonsets")
|
||||
|
||||
var daemonsetsKind = v1beta2.SchemeGroupVersion.WithKind("DaemonSet")
|
||||
|
||||
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
|
||||
func (c *FakeDaemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(daemonsetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
|
||||
func (c *FakeDaemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) {
|
||||
emptyResult := &v1beta2.DaemonSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(daemonsetsResource, daemonsetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.DaemonSetList{ListMeta: obj.(*v1beta2.DaemonSetList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.DaemonSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested daemonSets.
|
||||
func (c *FakeDaemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(daemonsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *FakeDaemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *FakeDaemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(daemonsetsResource, c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDaemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(daemonsetsResource, "status", c.ns, daemonSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDaemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(daemonsetsResource, c.ns, name, opts), &v1beta2.DaemonSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDaemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(daemonsetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.DaemonSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched daemonSet.
|
||||
func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) {
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
|
||||
func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.DaemonSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.DaemonSet), err
|
||||
}
|
||||
|
||||
@@ -19,33 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeDeployments implements DeploymentInterface
|
||||
type fakeDeployments struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration]
|
||||
// FakeDeployments implements DeploymentInterface
|
||||
type FakeDeployments struct {
|
||||
Fake *FakeAppsV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeDeployments(fake *FakeAppsV1beta2, namespace string) typedappsv1beta2.DeploymentInterface {
|
||||
return &fakeDeployments{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta2.Deployment, *v1beta2.DeploymentList, *appsv1beta2.DeploymentApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("deployments"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("Deployment"),
|
||||
func() *v1beta2.Deployment { return &v1beta2.Deployment{} },
|
||||
func() *v1beta2.DeploymentList { return &v1beta2.DeploymentList{} },
|
||||
func(dst, src *v1beta2.DeploymentList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.DeploymentList) []*v1beta2.Deployment { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta2.DeploymentList, items []*v1beta2.Deployment) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var deploymentsResource = v1beta2.SchemeGroupVersion.WithResource("deployments")
|
||||
|
||||
var deploymentsKind = v1beta2.SchemeGroupVersion.WithKind("Deployment")
|
||||
|
||||
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
|
||||
func (c *FakeDeployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) {
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(deploymentsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
|
||||
func (c *FakeDeployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) {
|
||||
emptyResult := &v1beta2.DeploymentList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(deploymentsResource, deploymentsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.DeploymentList{ListMeta: obj.(*v1beta2.DeploymentList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deployments.
|
||||
func (c *FakeDeployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(deploymentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) {
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *FakeDeployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) {
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(deploymentsResource, c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeDeployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) {
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(deploymentsResource, "status", c.ns, deployment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeDeployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(deploymentsResource, c.ns, name, opts), &v1beta2.Deployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeDeployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(deploymentsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.DeploymentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) {
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
|
||||
func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) {
|
||||
if deployment == nil {
|
||||
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(deployment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := deployment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.Deployment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.Deployment), err
|
||||
}
|
||||
|
||||
@@ -19,33 +19,179 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
json "encoding/json"
|
||||
fmt "fmt"
|
||||
|
||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeReplicaSets implements ReplicaSetInterface
|
||||
type fakeReplicaSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration]
|
||||
// FakeReplicaSets implements ReplicaSetInterface
|
||||
type FakeReplicaSets struct {
|
||||
Fake *FakeAppsV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeReplicaSets(fake *FakeAppsV1beta2, namespace string) typedappsv1beta2.ReplicaSetInterface {
|
||||
return &fakeReplicaSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta2.ReplicaSet, *v1beta2.ReplicaSetList, *appsv1beta2.ReplicaSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("replicasets"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("ReplicaSet"),
|
||||
func() *v1beta2.ReplicaSet { return &v1beta2.ReplicaSet{} },
|
||||
func() *v1beta2.ReplicaSetList { return &v1beta2.ReplicaSetList{} },
|
||||
func(dst, src *v1beta2.ReplicaSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.ReplicaSetList) []*v1beta2.ReplicaSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta2.ReplicaSetList, items []*v1beta2.ReplicaSet) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var replicasetsResource = v1beta2.SchemeGroupVersion.WithResource("replicasets")
|
||||
|
||||
var replicasetsKind = v1beta2.SchemeGroupVersion.WithKind("ReplicaSet")
|
||||
|
||||
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
|
||||
func (c *FakeReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(replicasetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
|
||||
func (c *FakeReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(replicasetsResource, replicasetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.ReplicaSetList{ListMeta: obj.(*v1beta2.ReplicaSetList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.ReplicaSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested replicaSets.
|
||||
func (c *FakeReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(replicasetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *FakeReplicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *FakeReplicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(replicasetsResource, c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeReplicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(replicasetsResource, "status", c.ns, replicaSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(replicasetsResource, c.ns, name, opts), &v1beta2.ReplicaSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(replicasetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.ReplicaSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched replicaSet.
|
||||
func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) {
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
|
||||
func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
if replicaSet == nil {
|
||||
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(replicaSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := replicaSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) {
|
||||
if replicaSet == nil {
|
||||
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(replicaSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := replicaSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.ReplicaSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.ReplicaSet), err
|
||||
}
|
||||
|
||||
@@ -25,43 +25,182 @@ import (
|
||||
|
||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
typedappsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeStatefulSets implements StatefulSetInterface
|
||||
type fakeStatefulSets struct {
|
||||
*gentype.FakeClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration]
|
||||
// FakeStatefulSets implements StatefulSetInterface
|
||||
type FakeStatefulSets struct {
|
||||
Fake *FakeAppsV1beta2
|
||||
ns string
|
||||
}
|
||||
|
||||
func newFakeStatefulSets(fake *FakeAppsV1beta2, namespace string) typedappsv1beta2.StatefulSetInterface {
|
||||
return &fakeStatefulSets{
|
||||
gentype.NewFakeClientWithListAndApply[*v1beta2.StatefulSet, *v1beta2.StatefulSetList, *appsv1beta2.StatefulSetApplyConfiguration](
|
||||
fake.Fake,
|
||||
namespace,
|
||||
v1beta2.SchemeGroupVersion.WithResource("statefulsets"),
|
||||
v1beta2.SchemeGroupVersion.WithKind("StatefulSet"),
|
||||
func() *v1beta2.StatefulSet { return &v1beta2.StatefulSet{} },
|
||||
func() *v1beta2.StatefulSetList { return &v1beta2.StatefulSetList{} },
|
||||
func(dst, src *v1beta2.StatefulSetList) { dst.ListMeta = src.ListMeta },
|
||||
func(list *v1beta2.StatefulSetList) []*v1beta2.StatefulSet { return gentype.ToPointerSlice(list.Items) },
|
||||
func(list *v1beta2.StatefulSetList, items []*v1beta2.StatefulSet) {
|
||||
list.Items = gentype.FromPointerSlice(items)
|
||||
},
|
||||
),
|
||||
fake,
|
||||
var statefulsetsResource = v1beta2.SchemeGroupVersion.WithResource("statefulsets")
|
||||
|
||||
var statefulsetsKind = v1beta2.SchemeGroupVersion.WithKind("StatefulSet")
|
||||
|
||||
// Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any.
|
||||
func (c *FakeStatefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetActionWithOptions(statefulsetsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of StatefulSets that match those selectors.
|
||||
func (c *FakeStatefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) {
|
||||
emptyResult := &v1beta2.StatefulSetList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListActionWithOptions(statefulsetsResource, statefulsetsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v1beta2.StatefulSetList{ListMeta: obj.(*v1beta2.StatefulSetList).ListMeta}
|
||||
for _, item := range obj.(*v1beta2.StatefulSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested statefulSets.
|
||||
func (c *FakeStatefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(statefulsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any.
|
||||
func (c *FakeStatefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateActionWithOptions(statefulsetsResource, c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeStatefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "status", c.ns, statefulSet, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// Delete takes name of the statefulSet and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeStatefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteActionWithOptions(statefulsetsResource, c.ns, name, opts), &v1beta2.StatefulSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeStatefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionActionWithOptions(statefulsetsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1beta2.StatefulSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched statefulSet.
|
||||
func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) {
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
|
||||
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) {
|
||||
if statefulSet == nil {
|
||||
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
|
||||
}
|
||||
data, err := json.Marshal(statefulSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := statefulSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1beta2.StatefulSet{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta2.StatefulSet), err
|
||||
}
|
||||
|
||||
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
|
||||
func (c *fakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
|
||||
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
|
||||
emptyResult := &v1beta2.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(c.Resource(), c.Namespace(), "scale", statefulSetName, options), emptyResult)
|
||||
Invokes(testing.NewGetSubresourceActionWithOptions(statefulsetsResource, c.ns, "scale", statefulSetName, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -70,10 +209,10 @@ func (c *fakeStatefulSets) GetScale(ctx context.Context, statefulSetName string,
|
||||
}
|
||||
|
||||
// UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
|
||||
func (c *fakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) {
|
||||
func (c *FakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) {
|
||||
emptyResult := &v1beta2.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(c.Resource(), "scale", c.Namespace(), scale, opts), &v1beta2.Scale{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(statefulsetsResource, "scale", c.ns, scale, opts), &v1beta2.Scale{})
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
@@ -83,7 +222,7 @@ func (c *fakeStatefulSets) UpdateScale(ctx context.Context, statefulSetName stri
|
||||
|
||||
// ApplyScale takes top resource name and the apply declarative configuration for scale,
|
||||
// applies it and returns the applied scale, and an error, if there is any.
|
||||
func (c *fakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) {
|
||||
func (c *FakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Scale, err error) {
|
||||
if scale == nil {
|
||||
return nil, fmt.Errorf("scale provided to ApplyScale must not be nil")
|
||||
}
|
||||
@@ -93,7 +232,7 @@ func (c *fakeStatefulSets) ApplyScale(ctx context.Context, statefulSetName strin
|
||||
}
|
||||
emptyResult := &v1beta2.Scale{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(c.Resource(), c.Namespace(), statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(statefulsetsResource, c.ns, statefulSetName, types.ApplyPatchType, data, opts.ToPatchOptions(), "scale"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
|
||||
@@ -29,11 +29,11 @@ type FakeAuthenticationV1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAuthenticationV1) SelfSubjectReviews() v1.SelfSubjectReviewInterface {
|
||||
return newFakeSelfSubjectReviews(c)
|
||||
return &FakeSelfSubjectReviews{c}
|
||||
}
|
||||
|
||||
func (c *FakeAuthenticationV1) TokenReviews() v1.TokenReviewInterface {
|
||||
return newFakeTokenReviews(c)
|
||||
return &FakeTokenReviews{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,26 +19,29 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
v1 "k8s.io/api/authentication/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type fakeSelfSubjectReviews struct {
|
||||
*gentype.FakeClient[*v1.SelfSubjectReview]
|
||||
// FakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type FakeSelfSubjectReviews struct {
|
||||
Fake *FakeAuthenticationV1
|
||||
}
|
||||
|
||||
func newFakeSelfSubjectReviews(fake *FakeAuthenticationV1) authenticationv1.SelfSubjectReviewInterface {
|
||||
return &fakeSelfSubjectReviews{
|
||||
gentype.NewFakeClient[*v1.SelfSubjectReview](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("selfsubjectreviews"),
|
||||
v1.SchemeGroupVersion.WithKind("SelfSubjectReview"),
|
||||
func() *v1.SelfSubjectReview { return &v1.SelfSubjectReview{} },
|
||||
),
|
||||
fake,
|
||||
var selfsubjectreviewsResource = v1.SchemeGroupVersion.WithResource("selfsubjectreviews")
|
||||
|
||||
var selfsubjectreviewsKind = v1.SchemeGroupVersion.WithKind("SelfSubjectReview")
|
||||
|
||||
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
|
||||
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1.SelfSubjectReview, opts metav1.CreateOptions) (result *v1.SelfSubjectReview, err error) {
|
||||
emptyResult := &v1.SelfSubjectReview{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.SelfSubjectReview), err
|
||||
}
|
||||
|
||||
@@ -19,26 +19,29 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
v1 "k8s.io/api/authentication/v1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeTokenReviews implements TokenReviewInterface
|
||||
type fakeTokenReviews struct {
|
||||
*gentype.FakeClient[*v1.TokenReview]
|
||||
// FakeTokenReviews implements TokenReviewInterface
|
||||
type FakeTokenReviews struct {
|
||||
Fake *FakeAuthenticationV1
|
||||
}
|
||||
|
||||
func newFakeTokenReviews(fake *FakeAuthenticationV1) authenticationv1.TokenReviewInterface {
|
||||
return &fakeTokenReviews{
|
||||
gentype.NewFakeClient[*v1.TokenReview](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1.SchemeGroupVersion.WithResource("tokenreviews"),
|
||||
v1.SchemeGroupVersion.WithKind("TokenReview"),
|
||||
func() *v1.TokenReview { return &v1.TokenReview{} },
|
||||
),
|
||||
fake,
|
||||
var tokenreviewsResource = v1.SchemeGroupVersion.WithResource("tokenreviews")
|
||||
|
||||
var tokenreviewsKind = v1.SchemeGroupVersion.WithKind("TokenReview")
|
||||
|
||||
// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any.
|
||||
func (c *FakeTokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) {
|
||||
emptyResult := &v1.TokenReview{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(tokenreviewsResource, tokenReview, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TokenReview), err
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ type FakeAuthenticationV1alpha1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAuthenticationV1alpha1) SelfSubjectReviews() v1alpha1.SelfSubjectReviewInterface {
|
||||
return newFakeSelfSubjectReviews(c)
|
||||
return &FakeSelfSubjectReviews{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,26 +19,29 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
v1alpha1 "k8s.io/api/authentication/v1alpha1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
authenticationv1alpha1 "k8s.io/client-go/kubernetes/typed/authentication/v1alpha1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type fakeSelfSubjectReviews struct {
|
||||
*gentype.FakeClient[*v1alpha1.SelfSubjectReview]
|
||||
// FakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type FakeSelfSubjectReviews struct {
|
||||
Fake *FakeAuthenticationV1alpha1
|
||||
}
|
||||
|
||||
func newFakeSelfSubjectReviews(fake *FakeAuthenticationV1alpha1) authenticationv1alpha1.SelfSubjectReviewInterface {
|
||||
return &fakeSelfSubjectReviews{
|
||||
gentype.NewFakeClient[*v1alpha1.SelfSubjectReview](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1alpha1.SchemeGroupVersion.WithResource("selfsubjectreviews"),
|
||||
v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectReview"),
|
||||
func() *v1alpha1.SelfSubjectReview { return &v1alpha1.SelfSubjectReview{} },
|
||||
),
|
||||
fake,
|
||||
var selfsubjectreviewsResource = v1alpha1.SchemeGroupVersion.WithResource("selfsubjectreviews")
|
||||
|
||||
var selfsubjectreviewsKind = v1alpha1.SchemeGroupVersion.WithKind("SelfSubjectReview")
|
||||
|
||||
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
|
||||
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1alpha1.SelfSubjectReview, opts v1.CreateOptions) (result *v1alpha1.SelfSubjectReview, err error) {
|
||||
emptyResult := &v1alpha1.SelfSubjectReview{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1alpha1.SelfSubjectReview), err
|
||||
}
|
||||
|
||||
@@ -29,11 +29,11 @@ type FakeAuthenticationV1beta1 struct {
|
||||
}
|
||||
|
||||
func (c *FakeAuthenticationV1beta1) SelfSubjectReviews() v1beta1.SelfSubjectReviewInterface {
|
||||
return newFakeSelfSubjectReviews(c)
|
||||
return &FakeSelfSubjectReviews{c}
|
||||
}
|
||||
|
||||
func (c *FakeAuthenticationV1beta1) TokenReviews() v1beta1.TokenReviewInterface {
|
||||
return newFakeTokenReviews(c)
|
||||
return &FakeTokenReviews{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
|
||||
@@ -19,26 +19,29 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
||||
v1beta1 "k8s.io/api/authentication/v1beta1"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// fakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type fakeSelfSubjectReviews struct {
|
||||
*gentype.FakeClient[*v1beta1.SelfSubjectReview]
|
||||
// FakeSelfSubjectReviews implements SelfSubjectReviewInterface
|
||||
type FakeSelfSubjectReviews struct {
|
||||
Fake *FakeAuthenticationV1beta1
|
||||
}
|
||||
|
||||
func newFakeSelfSubjectReviews(fake *FakeAuthenticationV1beta1) authenticationv1beta1.SelfSubjectReviewInterface {
|
||||
return &fakeSelfSubjectReviews{
|
||||
gentype.NewFakeClient[*v1beta1.SelfSubjectReview](
|
||||
fake.Fake,
|
||||
"",
|
||||
v1beta1.SchemeGroupVersion.WithResource("selfsubjectreviews"),
|
||||
v1beta1.SchemeGroupVersion.WithKind("SelfSubjectReview"),
|
||||
func() *v1beta1.SelfSubjectReview { return &v1beta1.SelfSubjectReview{} },
|
||||
),
|
||||
fake,
|
||||
var selfsubjectreviewsResource = v1beta1.SchemeGroupVersion.WithResource("selfsubjectreviews")
|
||||
|
||||
var selfsubjectreviewsKind = v1beta1.SchemeGroupVersion.WithKind("SelfSubjectReview")
|
||||
|
||||
// Create takes the representation of a selfSubjectReview and creates it. Returns the server's representation of the selfSubjectReview, and an error, if there is any.
|
||||
func (c *FakeSelfSubjectReviews) Create(ctx context.Context, selfSubjectReview *v1beta1.SelfSubjectReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectReview, err error) {
|
||||
emptyResult := &v1beta1.SelfSubjectReview{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateActionWithOptions(selfsubjectreviewsResource, selfSubjectReview, opts), emptyResult)
|
||||
if obj == nil {
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1beta1.SelfSubjectReview), err
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user