CSIStorageCapacity: generated files for beta

Kubernetes-commit: 2b062a62812ab3f33df5bc8839f0201b9087aa93
This commit is contained in:
Patrick Ohly 2021-03-03 12:44:52 +01:00 committed by Kubernetes Publisher
parent 7fc57bbd48
commit 9f9bfd997e
13 changed files with 847 additions and 0 deletions

View File

@ -33,6 +33,7 @@ type CSIStorageCapacityApplyConfiguration struct {
NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"` NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"`
StorageClassName *string `json:"storageClassName,omitempty"` StorageClassName *string `json:"storageClassName,omitempty"`
Capacity *resource.Quantity `json:"capacity,omitempty"` Capacity *resource.Quantity `json:"capacity,omitempty"`
MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"`
} }
// CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with // CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with
@ -245,3 +246,11 @@ func (b *CSIStorageCapacityApplyConfiguration) WithCapacity(value resource.Quant
b.Capacity = &value b.Capacity = &value
return b return b
} }
// WithMaximumVolumeSize sets the MaximumVolumeSize 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 MaximumVolumeSize field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resource.Quantity) *CSIStorageCapacityApplyConfiguration {
b.MaximumVolumeSize = &value
return b
}

View File

@ -0,0 +1,256 @@
/*
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"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
v1 "k8s.io/client-go/applyconfigurations/meta/v1"
)
// CSIStorageCapacityApplyConfiguration represents an declarative configuration of the CSIStorageCapacity type for use
// with apply.
type CSIStorageCapacityApplyConfiguration struct {
v1.TypeMetaApplyConfiguration `json:",inline"`
*v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"`
NodeTopology *v1.LabelSelectorApplyConfiguration `json:"nodeTopology,omitempty"`
StorageClassName *string `json:"storageClassName,omitempty"`
Capacity *resource.Quantity `json:"capacity,omitempty"`
MaximumVolumeSize *resource.Quantity `json:"maximumVolumeSize,omitempty"`
}
// CSIStorageCapacity constructs an declarative configuration of the CSIStorageCapacity type for use with
// apply.
func CSIStorageCapacity(name, namespace string) *CSIStorageCapacityApplyConfiguration {
b := &CSIStorageCapacityApplyConfiguration{}
b.WithName(name)
b.WithNamespace(namespace)
b.WithKind("CSIStorageCapacity")
b.WithAPIVersion("storage.k8s.io/v1beta1")
return b
}
// 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 *CSIStorageCapacityApplyConfiguration) WithKind(value string) *CSIStorageCapacityApplyConfiguration {
b.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 *CSIStorageCapacityApplyConfiguration) WithAPIVersion(value string) *CSIStorageCapacityApplyConfiguration {
b.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 *CSIStorageCapacityApplyConfiguration) WithName(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithGenerateName(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithNamespace(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.Namespace = &value
return b
}
// WithSelfLink sets the SelfLink 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 SelfLink field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithSelfLink(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.SelfLink = &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 *CSIStorageCapacityApplyConfiguration) WithUID(value types.UID) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithResourceVersion(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithGeneration(value int64) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.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 *CSIStorageCapacityApplyConfiguration) WithLabels(entries map[string]string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Labels == nil && len(entries) > 0 {
b.Labels = make(map[string]string, len(entries))
}
for k, v := range entries {
b.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 *CSIStorageCapacityApplyConfiguration) WithAnnotations(entries map[string]string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
if b.Annotations == nil && len(entries) > 0 {
b.Annotations = make(map[string]string, len(entries))
}
for k, v := range entries {
b.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 *CSIStorageCapacityApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
if values[i] == nil {
panic("nil value passed to WithOwnerReferences")
}
b.OwnerReferences = append(b.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 *CSIStorageCapacityApplyConfiguration) WithFinalizers(values ...string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
for i := range values {
b.Finalizers = append(b.Finalizers, values[i])
}
return b
}
// WithClusterName sets the ClusterName 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 ClusterName field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithClusterName(value string) *CSIStorageCapacityApplyConfiguration {
b.ensureObjectMetaApplyConfigurationExists()
b.ClusterName = &value
return b
}
func (b *CSIStorageCapacityApplyConfiguration) ensureObjectMetaApplyConfigurationExists() {
if b.ObjectMetaApplyConfiguration == nil {
b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{}
}
}
// WithNodeTopology sets the NodeTopology 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 NodeTopology field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithNodeTopology(value *v1.LabelSelectorApplyConfiguration) *CSIStorageCapacityApplyConfiguration {
b.NodeTopology = value
return b
}
// WithStorageClassName sets the StorageClassName 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 StorageClassName field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithStorageClassName(value string) *CSIStorageCapacityApplyConfiguration {
b.StorageClassName = &value
return b
}
// WithCapacity sets the Capacity 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 Capacity field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithCapacity(value resource.Quantity) *CSIStorageCapacityApplyConfiguration {
b.Capacity = &value
return b
}
// WithMaximumVolumeSize sets the MaximumVolumeSize 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 MaximumVolumeSize field is set to the value of the last call.
func (b *CSIStorageCapacityApplyConfiguration) WithMaximumVolumeSize(value resource.Quantity) *CSIStorageCapacityApplyConfiguration {
b.MaximumVolumeSize = &value
return b
}

View File

@ -1273,6 +1273,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
return &applyconfigurationsstoragev1beta1.CSINodeDriverApplyConfiguration{} return &applyconfigurationsstoragev1beta1.CSINodeDriverApplyConfiguration{}
case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeSpec"): case storagev1beta1.SchemeGroupVersion.WithKind("CSINodeSpec"):
return &applyconfigurationsstoragev1beta1.CSINodeSpecApplyConfiguration{} return &applyconfigurationsstoragev1beta1.CSINodeSpecApplyConfiguration{}
case storagev1beta1.SchemeGroupVersion.WithKind("CSIStorageCapacity"):
return &applyconfigurationsstoragev1beta1.CSIStorageCapacityApplyConfiguration{}
case storagev1beta1.SchemeGroupVersion.WithKind("StorageClass"): case storagev1beta1.SchemeGroupVersion.WithKind("StorageClass"):
return &applyconfigurationsstoragev1beta1.StorageClassApplyConfiguration{} return &applyconfigurationsstoragev1beta1.StorageClassApplyConfiguration{}
case storagev1beta1.SchemeGroupVersion.WithKind("TokenRequest"): case storagev1beta1.SchemeGroupVersion.WithKind("TokenRequest"):

View File

@ -346,6 +346,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSIDrivers().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSIDrivers().Informer()}, nil
case storagev1beta1.SchemeGroupVersion.WithResource("csinodes"): case storagev1beta1.SchemeGroupVersion.WithResource("csinodes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSINodes().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSINodes().Informer()}, nil
case storagev1beta1.SchemeGroupVersion.WithResource("csistoragecapacities"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().CSIStorageCapacities().Informer()}, nil
case storagev1beta1.SchemeGroupVersion.WithResource("storageclasses"): case storagev1beta1.SchemeGroupVersion.WithResource("storageclasses"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1beta1().StorageClasses().Informer()}, nil
case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"): case storagev1beta1.SchemeGroupVersion.WithResource("volumeattachments"):

View File

@ -0,0 +1,90 @@
/*
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"
time "time"
storagev1beta1 "k8s.io/api/storage/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"
v1beta1 "k8s.io/client-go/listers/storage/v1beta1"
cache "k8s.io/client-go/tools/cache"
)
// CSIStorageCapacityInformer provides access to a shared informer and lister for
// CSIStorageCapacities.
type CSIStorageCapacityInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1beta1.CSIStorageCapacityLister
}
type cSIStorageCapacityInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity 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 NewCSIStorageCapacityInformer(client kubernetes.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredCSIStorageCapacityInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredCSIStorageCapacityInformer constructs a new informer for CSIStorageCapacity 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 NewFilteredCSIStorageCapacityInformer(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.StorageV1beta1().CSIStorageCapacities(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.StorageV1beta1().CSIStorageCapacities(namespace).Watch(context.TODO(), options)
},
},
&storagev1beta1.CSIStorageCapacity{},
resyncPeriod,
indexers,
)
}
func (f *cSIStorageCapacityInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredCSIStorageCapacityInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *cSIStorageCapacityInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&storagev1beta1.CSIStorageCapacity{}, f.defaultInformer)
}
func (f *cSIStorageCapacityInformer) Lister() v1beta1.CSIStorageCapacityLister {
return v1beta1.NewCSIStorageCapacityLister(f.Informer().GetIndexer())
}

View File

@ -28,6 +28,8 @@ type Interface interface {
CSIDrivers() CSIDriverInformer CSIDrivers() CSIDriverInformer
// CSINodes returns a CSINodeInformer. // CSINodes returns a CSINodeInformer.
CSINodes() CSINodeInformer CSINodes() CSINodeInformer
// CSIStorageCapacities returns a CSIStorageCapacityInformer.
CSIStorageCapacities() CSIStorageCapacityInformer
// StorageClasses returns a StorageClassInformer. // StorageClasses returns a StorageClassInformer.
StorageClasses() StorageClassInformer StorageClasses() StorageClassInformer
// VolumeAttachments returns a VolumeAttachmentInformer. // VolumeAttachments returns a VolumeAttachmentInformer.
@ -55,6 +57,11 @@ func (v *version) CSINodes() CSINodeInformer {
return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
} }
// CSIStorageCapacities returns a CSIStorageCapacityInformer.
func (v *version) CSIStorageCapacities() CSIStorageCapacityInformer {
return &cSIStorageCapacityInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// StorageClasses returns a StorageClassInformer. // StorageClasses returns a StorageClassInformer.
func (v *version) StorageClasses() StorageClassInformer { func (v *version) StorageClasses() StorageClassInformer {
return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} return &storageClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}

View File

@ -0,0 +1,208 @@
/*
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 client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/storage/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// CSIStorageCapacitiesGetter has a method to return a CSIStorageCapacityInterface.
// A group's client should implement this interface.
type CSIStorageCapacitiesGetter interface {
CSIStorageCapacities(namespace string) CSIStorageCapacityInterface
}
// CSIStorageCapacityInterface has methods to work with CSIStorageCapacity resources.
type CSIStorageCapacityInterface interface {
Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (*v1beta1.CSIStorageCapacity, error)
Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (*v1beta1.CSIStorageCapacity, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSIStorageCapacity, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIStorageCapacityList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error)
Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error)
CSIStorageCapacityExpansion
}
// cSIStorageCapacities implements CSIStorageCapacityInterface
type cSIStorageCapacities struct {
client rest.Interface
ns string
}
// newCSIStorageCapacities returns a CSIStorageCapacities
func newCSIStorageCapacities(c *StorageV1beta1Client, namespace string) *cSIStorageCapacities {
return &cSIStorageCapacities{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any.
func (c *cSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) {
result = &v1beta1.CSIStorageCapacity{}
err = c.client.Get().
Namespace(c.ns).
Resource("csistoragecapacities").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors.
func (c *cSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.CSIStorageCapacityList{}
err = c.client.Get().
Namespace(c.ns).
Resource("csistoragecapacities").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested cSIStorageCapacities.
func (c *cSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("csistoragecapacities").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any.
func (c *cSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) {
result = &v1beta1.CSIStorageCapacity{}
err = c.client.Post().
Namespace(c.ns).
Resource("csistoragecapacities").
VersionedParams(&opts, scheme.ParameterCodec).
Body(cSIStorageCapacity).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any.
func (c *cSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) {
result = &v1beta1.CSIStorageCapacity{}
err = c.client.Put().
Namespace(c.ns).
Resource("csistoragecapacities").
Name(cSIStorageCapacity.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(cSIStorageCapacity).
Do(ctx).
Into(result)
return
}
// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs.
func (c *cSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("csistoragecapacities").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *cSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("csistoragecapacities").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched cSIStorageCapacity.
func (c *cSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) {
result = &v1beta1.CSIStorageCapacity{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("csistoragecapacities").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity.
func (c *cSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) {
if cSIStorageCapacity == nil {
return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cSIStorageCapacity)
if err != nil {
return nil, err
}
name := cSIStorageCapacity.Name
if name == nil {
return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply")
}
result = &v1beta1.CSIStorageCapacity{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("csistoragecapacities").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -0,0 +1,155 @@
/*
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 client-gen. DO NOT EDIT.
package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/storage/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1beta1 "k8s.io/client-go/applyconfigurations/storage/v1beta1"
testing "k8s.io/client-go/testing"
)
// FakeCSIStorageCapacities implements CSIStorageCapacityInterface
type FakeCSIStorageCapacities struct {
Fake *FakeStorageV1beta1
ns string
}
var csistoragecapacitiesResource = schema.GroupVersionResource{Group: "storage.k8s.io", Version: "v1beta1", Resource: "csistoragecapacities"}
var csistoragecapacitiesKind = schema.GroupVersionKind{Group: "storage.k8s.io", Version: "v1beta1", Kind: "CSIStorageCapacity"}
// Get takes name of the cSIStorageCapacity, and returns the corresponding cSIStorageCapacity object, and an error if there is any.
func (c *FakeCSIStorageCapacities) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIStorageCapacity, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(csistoragecapacitiesResource, c.ns, name), &v1beta1.CSIStorageCapacity{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIStorageCapacity), err
}
// List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors.
func (c *FakeCSIStorageCapacities) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIStorageCapacityList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(csistoragecapacitiesResource, csistoragecapacitiesKind, c.ns, opts), &v1beta1.CSIStorageCapacityList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.CSIStorageCapacityList{ListMeta: obj.(*v1beta1.CSIStorageCapacityList).ListMeta}
for _, item := range obj.(*v1beta1.CSIStorageCapacityList).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 cSIStorageCapacities.
func (c *FakeCSIStorageCapacities) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(csistoragecapacitiesResource, c.ns, opts))
}
// Create takes the representation of a cSIStorageCapacity and creates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any.
func (c *FakeCSIStorageCapacities) Create(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.CreateOptions) (result *v1beta1.CSIStorageCapacity, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1beta1.CSIStorageCapacity{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIStorageCapacity), err
}
// Update takes the representation of a cSIStorageCapacity and updates it. Returns the server's representation of the cSIStorageCapacity, and an error, if there is any.
func (c *FakeCSIStorageCapacities) Update(ctx context.Context, cSIStorageCapacity *v1beta1.CSIStorageCapacity, opts v1.UpdateOptions) (result *v1beta1.CSIStorageCapacity, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(csistoragecapacitiesResource, c.ns, cSIStorageCapacity), &v1beta1.CSIStorageCapacity{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIStorageCapacity), err
}
// Delete takes name of the cSIStorageCapacity and deletes it. Returns an error if one occurs.
func (c *FakeCSIStorageCapacities) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(csistoragecapacitiesResource, c.ns, name), &v1beta1.CSIStorageCapacity{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeCSIStorageCapacities) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(csistoragecapacitiesResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v1beta1.CSIStorageCapacityList{})
return err
}
// Patch applies the patch and returns the patched cSIStorageCapacity.
func (c *FakeCSIStorageCapacities) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIStorageCapacity, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, name, pt, data, subresources...), &v1beta1.CSIStorageCapacity{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIStorageCapacity), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cSIStorageCapacity.
func (c *FakeCSIStorageCapacities) Apply(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CSIStorageCapacity, err error) {
if cSIStorageCapacity == nil {
return nil, fmt.Errorf("cSIStorageCapacity provided to Apply must not be nil")
}
data, err := json.Marshal(cSIStorageCapacity)
if err != nil {
return nil, err
}
name := cSIStorageCapacity.Name
if name == nil {
return nil, fmt.Errorf("cSIStorageCapacity.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(csistoragecapacitiesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CSIStorageCapacity{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CSIStorageCapacity), err
}

View File

@ -36,6 +36,10 @@ func (c *FakeStorageV1beta1) CSINodes() v1beta1.CSINodeInterface {
return &FakeCSINodes{c} return &FakeCSINodes{c}
} }
func (c *FakeStorageV1beta1) CSIStorageCapacities(namespace string) v1beta1.CSIStorageCapacityInterface {
return &FakeCSIStorageCapacities{c, namespace}
}
func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface { func (c *FakeStorageV1beta1) StorageClasses() v1beta1.StorageClassInterface {
return &FakeStorageClasses{c} return &FakeStorageClasses{c}
} }

View File

@ -22,6 +22,8 @@ type CSIDriverExpansion interface{}
type CSINodeExpansion interface{} type CSINodeExpansion interface{}
type CSIStorageCapacityExpansion interface{}
type StorageClassExpansion interface{} type StorageClassExpansion interface{}
type VolumeAttachmentExpansion interface{} type VolumeAttachmentExpansion interface{}

View File

@ -28,6 +28,7 @@ type StorageV1beta1Interface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
CSIDriversGetter CSIDriversGetter
CSINodesGetter CSINodesGetter
CSIStorageCapacitiesGetter
StorageClassesGetter StorageClassesGetter
VolumeAttachmentsGetter VolumeAttachmentsGetter
} }
@ -45,6 +46,10 @@ func (c *StorageV1beta1Client) CSINodes() CSINodeInterface {
return newCSINodes(c) return newCSINodes(c)
} }
func (c *StorageV1beta1Client) CSIStorageCapacities(namespace string) CSIStorageCapacityInterface {
return newCSIStorageCapacities(c, namespace)
}
func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface { func (c *StorageV1beta1Client) StorageClasses() StorageClassInterface {
return newStorageClasses(c) return newStorageClasses(c)
} }

View File

@ -0,0 +1,99 @@
/*
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 lister-gen. DO NOT EDIT.
package v1beta1
import (
v1beta1 "k8s.io/api/storage/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// CSIStorageCapacityLister helps list CSIStorageCapacities.
// All objects returned here must be treated as read-only.
type CSIStorageCapacityLister interface {
// List lists all CSIStorageCapacities in the indexer.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error)
// CSIStorageCapacities returns an object that can list and get CSIStorageCapacities.
CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister
CSIStorageCapacityListerExpansion
}
// cSIStorageCapacityLister implements the CSIStorageCapacityLister interface.
type cSIStorageCapacityLister struct {
indexer cache.Indexer
}
// NewCSIStorageCapacityLister returns a new CSIStorageCapacityLister.
func NewCSIStorageCapacityLister(indexer cache.Indexer) CSIStorageCapacityLister {
return &cSIStorageCapacityLister{indexer: indexer}
}
// List lists all CSIStorageCapacities in the indexer.
func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.CSIStorageCapacity))
})
return ret, err
}
// CSIStorageCapacities returns an object that can list and get CSIStorageCapacities.
func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) CSIStorageCapacityNamespaceLister {
return cSIStorageCapacityNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// CSIStorageCapacityNamespaceLister helps list and get CSIStorageCapacities.
// All objects returned here must be treated as read-only.
type CSIStorageCapacityNamespaceLister interface {
// List lists all CSIStorageCapacities in the indexer for a given namespace.
// Objects returned here must be treated as read-only.
List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error)
// Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name.
// Objects returned here must be treated as read-only.
Get(name string) (*v1beta1.CSIStorageCapacity, error)
CSIStorageCapacityNamespaceListerExpansion
}
// cSIStorageCapacityNamespaceLister implements the CSIStorageCapacityNamespaceLister
// interface.
type cSIStorageCapacityNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all CSIStorageCapacities in the indexer for a given namespace.
func (s cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.CSIStorageCapacity, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1beta1.CSIStorageCapacity))
})
return ret, err
}
// Get retrieves the CSIStorageCapacity from the indexer for a given namespace and name.
func (s cSIStorageCapacityNamespaceLister) Get(name string) (*v1beta1.CSIStorageCapacity, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1beta1.Resource("csistoragecapacity"), name)
}
return obj.(*v1beta1.CSIStorageCapacity), nil
}

View File

@ -26,6 +26,14 @@ type CSIDriverListerExpansion interface{}
// CSINodeLister. // CSINodeLister.
type CSINodeListerExpansion interface{} type CSINodeListerExpansion interface{}
// CSIStorageCapacityListerExpansion allows custom methods to be added to
// CSIStorageCapacityLister.
type CSIStorageCapacityListerExpansion interface{}
// CSIStorageCapacityNamespaceListerExpansion allows custom methods to be added to
// CSIStorageCapacityNamespaceLister.
type CSIStorageCapacityNamespaceListerExpansion interface{}
// StorageClassListerExpansion allows custom methods to be added to // StorageClassListerExpansion allows custom methods to be added to
// StorageClassLister. // StorageClassLister.
type StorageClassListerExpansion interface{} type StorageClassListerExpansion interface{}