rebase: update kubernetes to v1.21.2

Updated kubernetes packages to latest release.
resizefs package has been included into k8s.io/mount-utils
package. updated code to use the same.

Updates: #1968

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2021-06-25 10:29:51 +05:30
committed by mergify[bot]
parent 8ce5ae16c1
commit 1b23d78113
1115 changed files with 98825 additions and 12365 deletions

View File

@ -37,13 +37,12 @@ import (
autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2"
batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1"
batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1"
batchv2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1"
certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1"
certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1"
coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
discoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1"
eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1"
eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1"
@ -55,6 +54,7 @@ import (
nodev1 "k8s.io/client-go/kubernetes/typed/node/v1"
nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1"
nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1"
policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1"
policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1"
@ -86,13 +86,12 @@ type Interface interface {
AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface
BatchV1() batchv1.BatchV1Interface
BatchV1beta1() batchv1beta1.BatchV1beta1Interface
BatchV2alpha1() batchv2alpha1.BatchV2alpha1Interface
CertificatesV1() certificatesv1.CertificatesV1Interface
CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface
CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface
CoordinationV1() coordinationv1.CoordinationV1Interface
CoreV1() corev1.CoreV1Interface
DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface
DiscoveryV1() discoveryv1.DiscoveryV1Interface
DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface
EventsV1() eventsv1.EventsV1Interface
EventsV1beta1() eventsv1beta1.EventsV1beta1Interface
@ -104,6 +103,7 @@ type Interface interface {
NodeV1() nodev1.NodeV1Interface
NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface
NodeV1beta1() nodev1beta1.NodeV1beta1Interface
PolicyV1() policyv1.PolicyV1Interface
PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface
RbacV1() rbacv1.RbacV1Interface
RbacV1beta1() rbacv1beta1.RbacV1beta1Interface
@ -135,13 +135,12 @@ type Clientset struct {
autoscalingV2beta2 *autoscalingv2beta2.AutoscalingV2beta2Client
batchV1 *batchv1.BatchV1Client
batchV1beta1 *batchv1beta1.BatchV1beta1Client
batchV2alpha1 *batchv2alpha1.BatchV2alpha1Client
certificatesV1 *certificatesv1.CertificatesV1Client
certificatesV1beta1 *certificatesv1beta1.CertificatesV1beta1Client
coordinationV1beta1 *coordinationv1beta1.CoordinationV1beta1Client
coordinationV1 *coordinationv1.CoordinationV1Client
coreV1 *corev1.CoreV1Client
discoveryV1alpha1 *discoveryv1alpha1.DiscoveryV1alpha1Client
discoveryV1 *discoveryv1.DiscoveryV1Client
discoveryV1beta1 *discoveryv1beta1.DiscoveryV1beta1Client
eventsV1 *eventsv1.EventsV1Client
eventsV1beta1 *eventsv1beta1.EventsV1beta1Client
@ -153,6 +152,7 @@ type Clientset struct {
nodeV1 *nodev1.NodeV1Client
nodeV1alpha1 *nodev1alpha1.NodeV1alpha1Client
nodeV1beta1 *nodev1beta1.NodeV1beta1Client
policyV1 *policyv1.PolicyV1Client
policyV1beta1 *policyv1beta1.PolicyV1beta1Client
rbacV1 *rbacv1.RbacV1Client
rbacV1beta1 *rbacv1beta1.RbacV1beta1Client
@ -240,11 +240,6 @@ func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface {
return c.batchV1beta1
}
// BatchV2alpha1 retrieves the BatchV2alpha1Client
func (c *Clientset) BatchV2alpha1() batchv2alpha1.BatchV2alpha1Interface {
return c.batchV2alpha1
}
// CertificatesV1 retrieves the CertificatesV1Client
func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface {
return c.certificatesV1
@ -270,9 +265,9 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface {
return c.coreV1
}
// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client
func (c *Clientset) DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface {
return c.discoveryV1alpha1
// DiscoveryV1 retrieves the DiscoveryV1Client
func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface {
return c.discoveryV1
}
// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client
@ -330,6 +325,11 @@ func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface {
return c.nodeV1beta1
}
// PolicyV1 retrieves the PolicyV1Client
func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface {
return c.policyV1
}
// PolicyV1beta1 retrieves the PolicyV1beta1Client
func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
return c.policyV1beta1
@ -461,10 +461,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.batchV2alpha1, err = batchv2alpha1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.certificatesV1, err = certificatesv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@ -485,7 +481,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.discoveryV1alpha1, err = discoveryv1alpha1.NewForConfig(&configShallowCopy)
cs.discoveryV1, err = discoveryv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
@ -533,6 +529,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.policyV1, err = policyv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.policyV1beta1, err = policyv1beta1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
@ -600,13 +600,12 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.autoscalingV2beta2 = autoscalingv2beta2.NewForConfigOrDie(c)
cs.batchV1 = batchv1.NewForConfigOrDie(c)
cs.batchV1beta1 = batchv1beta1.NewForConfigOrDie(c)
cs.batchV2alpha1 = batchv2alpha1.NewForConfigOrDie(c)
cs.certificatesV1 = certificatesv1.NewForConfigOrDie(c)
cs.certificatesV1beta1 = certificatesv1beta1.NewForConfigOrDie(c)
cs.coordinationV1beta1 = coordinationv1beta1.NewForConfigOrDie(c)
cs.coordinationV1 = coordinationv1.NewForConfigOrDie(c)
cs.coreV1 = corev1.NewForConfigOrDie(c)
cs.discoveryV1alpha1 = discoveryv1alpha1.NewForConfigOrDie(c)
cs.discoveryV1 = discoveryv1.NewForConfigOrDie(c)
cs.discoveryV1beta1 = discoveryv1beta1.NewForConfigOrDie(c)
cs.eventsV1 = eventsv1.NewForConfigOrDie(c)
cs.eventsV1beta1 = eventsv1beta1.NewForConfigOrDie(c)
@ -618,6 +617,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
cs.nodeV1 = nodev1.NewForConfigOrDie(c)
cs.nodeV1alpha1 = nodev1alpha1.NewForConfigOrDie(c)
cs.nodeV1beta1 = nodev1beta1.NewForConfigOrDie(c)
cs.policyV1 = policyv1.NewForConfigOrDie(c)
cs.policyV1beta1 = policyv1beta1.NewForConfigOrDie(c)
cs.rbacV1 = rbacv1.NewForConfigOrDie(c)
cs.rbacV1beta1 = rbacv1beta1.NewForConfigOrDie(c)
@ -651,13 +651,12 @@ func New(c rest.Interface) *Clientset {
cs.autoscalingV2beta2 = autoscalingv2beta2.New(c)
cs.batchV1 = batchv1.New(c)
cs.batchV1beta1 = batchv1beta1.New(c)
cs.batchV2alpha1 = batchv2alpha1.New(c)
cs.certificatesV1 = certificatesv1.New(c)
cs.certificatesV1beta1 = certificatesv1beta1.New(c)
cs.coordinationV1beta1 = coordinationv1beta1.New(c)
cs.coordinationV1 = coordinationv1.New(c)
cs.coreV1 = corev1.New(c)
cs.discoveryV1alpha1 = discoveryv1alpha1.New(c)
cs.discoveryV1 = discoveryv1.New(c)
cs.discoveryV1beta1 = discoveryv1beta1.New(c)
cs.eventsV1 = eventsv1.New(c)
cs.eventsV1beta1 = eventsv1beta1.New(c)
@ -669,6 +668,7 @@ func New(c rest.Interface) *Clientset {
cs.nodeV1 = nodev1.New(c)
cs.nodeV1alpha1 = nodev1alpha1.New(c)
cs.nodeV1beta1 = nodev1beta1.New(c)
cs.policyV1 = policyv1.New(c)
cs.policyV1beta1 = policyv1beta1.New(c)
cs.rbacV1 = rbacv1.New(c)
cs.rbacV1beta1 = rbacv1beta1.New(c)

View File

@ -34,13 +34,12 @@ import (
autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
batchv2alpha1 "k8s.io/api/batch/v2alpha1"
certificatesv1 "k8s.io/api/certificates/v1"
certificatesv1beta1 "k8s.io/api/certificates/v1beta1"
coordinationv1 "k8s.io/api/coordination/v1"
coordinationv1beta1 "k8s.io/api/coordination/v1beta1"
corev1 "k8s.io/api/core/v1"
discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1"
discoveryv1 "k8s.io/api/discovery/v1"
discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
@ -52,6 +51,7 @@ import (
nodev1 "k8s.io/api/node/v1"
nodev1alpha1 "k8s.io/api/node/v1alpha1"
nodev1beta1 "k8s.io/api/node/v1beta1"
policyv1 "k8s.io/api/policy/v1"
policyv1beta1 "k8s.io/api/policy/v1beta1"
rbacv1 "k8s.io/api/rbac/v1"
rbacv1alpha1 "k8s.io/api/rbac/v1alpha1"
@ -88,13 +88,12 @@ var localSchemeBuilder = runtime.SchemeBuilder{
autoscalingv2beta2.AddToScheme,
batchv1.AddToScheme,
batchv1beta1.AddToScheme,
batchv2alpha1.AddToScheme,
certificatesv1.AddToScheme,
certificatesv1beta1.AddToScheme,
coordinationv1beta1.AddToScheme,
coordinationv1.AddToScheme,
corev1.AddToScheme,
discoveryv1alpha1.AddToScheme,
discoveryv1.AddToScheme,
discoveryv1beta1.AddToScheme,
eventsv1.AddToScheme,
eventsv1beta1.AddToScheme,
@ -106,6 +105,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{
nodev1.AddToScheme,
nodev1alpha1.AddToScheme,
nodev1beta1.AddToScheme,
policyv1.AddToScheme,
policyv1beta1.AddToScheme,
rbacv1.AddToScheme,
rbacv1beta1.AddToScheme,

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type MutatingWebhookConfigurationInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error)
Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MutatingWebhookConfiguration, err error)
MutatingWebhookConfigurationExpansion
}
@ -166,3 +170,28 @@ func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
func (c *mutatingWebhookConfigurations) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.MutatingWebhookConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("mutatingwebhookconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ValidatingWebhookConfigurationInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error)
Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ValidatingWebhookConfiguration, err error)
ValidatingWebhookConfigurationExpansion
}
@ -166,3 +170,28 @@ func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
func (c *validatingWebhookConfigurations) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.ValidatingWebhookConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("validatingwebhookconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type MutatingWebhookConfigurationInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, 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.MutatingWebhookConfiguration, err error)
Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error)
MutatingWebhookConfigurationExpansion
}
@ -166,3 +170,28 @@ func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
func (c *mutatingWebhookConfigurations) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.MutatingWebhookConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("mutatingwebhookconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ValidatingWebhookConfigurationInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, 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.ValidatingWebhookConfiguration, err error)
Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error)
ValidatingWebhookConfigurationExpansion
}
@ -166,3 +170,28 @@ func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
func (c *validatingWebhookConfigurations) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.ValidatingWebhookConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("validatingwebhookconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type StorageVersionInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.StorageVersionList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.StorageVersion, err error)
Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error)
ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error)
StorageVersionExpansion
}
@ -182,3 +187,57 @@ func (c *storageVersions) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion.
func (c *storageVersions) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1alpha1.StorageVersion{}
err = c.client.Patch(types.ApplyPatchType).
Resource("storageversions").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *storageVersions) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1alpha1.StorageVersion{}
err = c.client.Patch(types.ApplyPatchType).
Resource("storageversions").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ControllerRevisionInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error)
Apply(ctx context.Context, controllerRevision *appsv1.ControllerRevisionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ControllerRevision, err error)
ControllerRevisionExpansion
}
@ -176,3 +180,29 @@ func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *controllerRevisions) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.ControllerRevision{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("controllerrevisions").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/apps/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DaemonSetInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error)
Apply(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error)
ApplyStatus(ctx context.Context, daemonSet *appsv1.DaemonSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.DaemonSet, err error)
DaemonSetExpansion
}
@ -193,3 +198,59 @@ func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
func (c *daemonSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *daemonSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,6 +20,8 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/apps/v1"
@ -27,6 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -48,6 +51,8 @@ type DeploymentInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error)
Apply(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error)
ApplyStatus(ctx context.Context, deployment *appsv1.DeploymentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Deployment, err error)
GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
@ -198,6 +203,62 @@ func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the deployment, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *deployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}

View File

@ -20,6 +20,8 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/apps/v1"
@ -27,6 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -48,6 +51,8 @@ type ReplicaSetInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error)
Apply(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error)
ApplyStatus(ctx context.Context, replicaSet *appsv1.ReplicaSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicaSet, err error)
GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
@ -198,6 +203,62 @@ func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
func (c *replicaSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *replicaSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the replicaSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}

View File

@ -20,6 +20,8 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/apps/v1"
@ -27,6 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -48,6 +51,8 @@ type StatefulSetInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error)
Apply(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error)
ApplyStatus(ctx context.Context, statefulSet *appsv1.StatefulSetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StatefulSet, err error)
GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
@ -198,6 +203,62 @@ func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchTyp
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the statefulSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ControllerRevisionInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, 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.ControllerRevision, err error)
Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error)
ControllerRevisionExpansion
}
@ -176,3 +180,29 @@ func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *controllerRevisions) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.ControllerRevision{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("controllerrevisions").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DeploymentInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, 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.Deployment, err error)
Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error)
ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error)
DeploymentExpansion
}
@ -193,3 +198,59 @@ func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type StatefulSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, 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.StatefulSet, err error)
Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error)
ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error)
StatefulSetExpansion
}
@ -193,3 +198,59 @@ func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ControllerRevisionInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, 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 *v1beta2.ControllerRevision, err error)
Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error)
ControllerRevisionExpansion
}
@ -176,3 +180,29 @@ func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *controllerRevisions) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.ControllerRevision{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("controllerrevisions").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DaemonSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, 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 *v1beta2.DaemonSet, err error)
Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error)
ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error)
DaemonSetExpansion
}
@ -193,3 +198,59 @@ func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
func (c *daemonSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *daemonSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DeploymentInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, 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 *v1beta2.Deployment, err error)
Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error)
ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error)
DeploymentExpansion
}
@ -193,3 +198,59 @@ func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *deployments) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type ReplicaSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, 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 *v1beta2.ReplicaSet, err error)
Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error)
ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error)
ReplicaSetExpansion
}
@ -193,3 +198,59 @@ func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
func (c *replicaSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *replicaSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type StatefulSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, 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 *v1beta2.StatefulSet, err error)
Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error)
ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error)
GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error)
UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (*v1beta2.Scale, error)
@ -197,6 +202,62 @@ func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchTyp
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *statefulSets) 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")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta2.StatefulSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("statefulsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any.
func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
result = &v1beta2.Scale{}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/autoscaling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
autoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type HorizontalPodAutoscalerInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error)
Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error)
ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error)
HorizontalPodAutoscalerExpansion
}
@ -193,3 +198,59 @@ func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt ty
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v1.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v1.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v2beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v2beta1 "k8s.io/api/autoscaling/v2beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type HorizontalPodAutoscalerInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, 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 *v2beta1.HorizontalPodAutoscaler, err error)
Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error)
ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error)
HorizontalPodAutoscalerExpansion
}
@ -193,3 +198,59 @@ func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt ty
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v2beta1.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v2beta1.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v2beta2
import (
"context"
json "encoding/json"
"fmt"
"time"
v2beta2 "k8s.io/api/autoscaling/v2beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type HorizontalPodAutoscalerInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, 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 *v2beta2.HorizontalPodAutoscaler, err error)
Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error)
ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error)
HorizontalPodAutoscalerExpansion
}
@ -193,3 +198,59 @@ func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt ty
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *horizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v2beta2.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *horizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(horizontalPodAutoscaler)
if err != nil {
return nil, err
}
name := horizontalPodAutoscaler.Name
if name == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler.Name must be provided to Apply")
}
result = &v2beta2.HorizontalPodAutoscaler{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("horizontalpodautoscalers").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -26,6 +26,7 @@ import (
type BatchV1Interface interface {
RESTClient() rest.Interface
CronJobsGetter
JobsGetter
}
@ -34,6 +35,10 @@ type BatchV1Client struct {
restClient rest.Interface
}
func (c *BatchV1Client) CronJobs(namespace string) CronJobInterface {
return newCronJobs(c, namespace)
}
func (c *BatchV1Client) Jobs(namespace string) JobInterface {
return newJobs(c, namespace)
}

View File

@ -16,16 +16,19 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v2alpha1
package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v2alpha1 "k8s.io/api/batch/v2alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/api/batch/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
batchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -38,15 +41,17 @@ type CronJobsGetter interface {
// CronJobInterface has methods to work with CronJob resources.
type CronJobInterface interface {
Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (*v2alpha1.CronJob, error)
Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error)
UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CronJob, error)
List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CronJobList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error)
Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (*v1.CronJob, error)
Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error)
UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (*v1.CronJob, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CronJob, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.CronJobList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error)
Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error)
ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error)
CronJobExpansion
}
@ -57,7 +62,7 @@ type cronJobs struct {
}
// newCronJobs returns a CronJobs
func newCronJobs(c *BatchV2alpha1Client, namespace string) *cronJobs {
func newCronJobs(c *BatchV1Client, namespace string) *cronJobs {
return &cronJobs{
client: c.RESTClient(),
ns: namespace,
@ -65,8 +70,8 @@ func newCronJobs(c *BatchV2alpha1Client, namespace string) *cronJobs {
}
// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any.
func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
func (c *cronJobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CronJob, err error) {
result = &v1.CronJob{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
@ -78,12 +83,12 @@ func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions)
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) {
func (c *cronJobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CronJobList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v2alpha1.CronJobList{}
result = &v1.CronJobList{}
err = c.client.Get().
Namespace(c.ns).
Resource("cronjobs").
@ -95,7 +100,7 @@ func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alp
}
// Watch returns a watch.Interface that watches the requested cronJobs.
func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
func (c *cronJobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -110,8 +115,8 @@ func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interf
}
// Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *cronJobs) Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
func (c *cronJobs) Create(ctx context.Context, cronJob *v1.CronJob, opts metav1.CreateOptions) (result *v1.CronJob, err error) {
result = &v1.CronJob{}
err = c.client.Post().
Namespace(c.ns).
Resource("cronjobs").
@ -123,8 +128,8 @@ func (c *cronJobs) Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v
}
// Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any.
func (c *cronJobs) Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
func (c *cronJobs) Update(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) {
result = &v1.CronJob{}
err = c.client.Put().
Namespace(c.ns).
Resource("cronjobs").
@ -138,8 +143,8 @@ func (c *cronJobs) Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1.CronJob, opts metav1.UpdateOptions) (result *v1.CronJob, err error) {
result = &v1.CronJob{}
err = c.client.Put().
Namespace(c.ns).
Resource("cronjobs").
@ -153,7 +158,7 @@ func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob,
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
func (c *cronJobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("cronjobs").
@ -164,7 +169,7 @@ func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOption
}
// DeleteCollection deletes a collection of objects.
func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
func (c *cronJobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
@ -180,8 +185,8 @@ func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions,
}
// Patch applies the patch and returns the patched cronJob.
func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error) {
result = &v2alpha1.CronJob{}
func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CronJob, err error) {
result = &v1.CronJob{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("cronjobs").
@ -193,3 +198,59 @@ func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, d
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob.
func (c *cronJobs) Apply(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cronJob)
if err != nil {
return nil, err
}
name := cronJob.Name
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
result = &v1.CronJob{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("cronjobs").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *cronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1.CronJobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cronJob)
if err != nil {
return nil, err
}
name := cronJob.Name
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
result = &v1.CronJob{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("cronjobs").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -18,4 +18,6 @@ limitations under the License.
package v1
type CronJobExpansion interface{}
type JobExpansion interface{}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/batch/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
batchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type JobInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error)
Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error)
ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error)
JobExpansion
}
@ -193,3 +198,59 @@ func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied job.
func (c *jobs) Apply(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(job)
if err != nil {
return nil, err
}
name := job.Name
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
result = &v1.Job{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobs").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *jobs) ApplyStatus(ctx context.Context, job *batchv1.JobApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(job)
if err != nil {
return nil, err
}
name := job.Name
if name == nil {
return nil, fmt.Errorf("job.Name must be provided to Apply")
}
result = &v1.Job{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("jobs").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/batch/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type CronJobInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, 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.CronJob, err error)
Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error)
ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error)
CronJobExpansion
}
@ -193,3 +198,59 @@ func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, d
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob.
func (c *cronJobs) Apply(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cronJob)
if err != nil {
return nil, err
}
name := cronJob.Name
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
result = &v1beta1.CronJob{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("cronjobs").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *cronJobs) ApplyStatus(ctx context.Context, cronJob *batchv1beta1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cronJob)
if err != nil {
return nil, err
}
name := cronJob.Name
if name == nil {
return nil, fmt.Errorf("cronJob.Name must be provided to Apply")
}
result = &v1beta1.CronJob{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("cronjobs").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/certificates/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
certificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type CertificateSigningRequestInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.CertificateSigningRequestList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CertificateSigningRequest, err error)
Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error)
ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error)
UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (*v1.CertificateSigningRequest, error)
CertificateSigningRequestExpansion
@ -185,6 +190,60 @@ func (c *certificateSigningRequests) Patch(ctx context.Context, name string, pt
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest.
func (c *certificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(certificateSigningRequest)
if err != nil {
return nil, err
}
name := certificateSigningRequest.Name
if name == nil {
return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply")
}
result = &v1.CertificateSigningRequest{}
err = c.client.Patch(types.ApplyPatchType).
Resource("certificatesigningrequests").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *certificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequestApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(certificateSigningRequest)
if err != nil {
return nil, err
}
name := certificateSigningRequest.Name
if name == nil {
return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply")
}
result = &v1.CertificateSigningRequest{}
err = c.client.Patch(types.ApplyPatchType).
Resource("certificatesigningrequests").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// UpdateApproval takes the top resource name and the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any.
func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *v1.CertificateSigningRequest, opts metav1.UpdateOptions) (result *v1.CertificateSigningRequest, err error) {
result = &v1.CertificateSigningRequest{}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/certificates/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type CertificateSigningRequestInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, 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.CertificateSigningRequest, err error)
Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error)
ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error)
CertificateSigningRequestExpansion
}
@ -182,3 +187,57 @@ func (c *certificateSigningRequests) Patch(ctx context.Context, name string, pt
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest.
func (c *certificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(certificateSigningRequest)
if err != nil {
return nil, err
}
name := certificateSigningRequest.Name
if name == nil {
return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply")
}
result = &v1beta1.CertificateSigningRequest{}
err = c.client.Patch(types.ApplyPatchType).
Resource("certificatesigningrequests").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *certificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(certificateSigningRequest)
if err != nil {
return nil, err
}
name := certificateSigningRequest.Name
if name == nil {
return nil, fmt.Errorf("certificateSigningRequest.Name must be provided to Apply")
}
result = &v1beta1.CertificateSigningRequest{}
err = c.client.Patch(types.ApplyPatchType).
Resource("certificatesigningrequests").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/coordination/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
coordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type LeaseInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error)
Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error)
LeaseExpansion
}
@ -176,3 +180,29 @@ func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, dat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied lease.
func (c *leases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) {
if lease == nil {
return nil, fmt.Errorf("lease provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(lease)
if err != nil {
return nil, err
}
name := lease.Name
if name == nil {
return nil, fmt.Errorf("lease.Name must be provided to Apply")
}
result = &v1.Lease{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("leases").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/coordination/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type LeaseInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, 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.Lease, err error)
Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error)
LeaseExpansion
}
@ -176,3 +180,29 @@ func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, dat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied lease.
func (c *leases) Apply(ctx context.Context, lease *coordinationv1beta1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Lease, err error) {
if lease == nil {
return nil, fmt.Errorf("lease provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(lease)
if err != nil {
return nil, err
}
name := lease.Name
if name == nil {
return nil, fmt.Errorf("lease.Name must be provided to Apply")
}
result = &v1beta1.Lease{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("leases").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ComponentStatusInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error)
Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error)
ComponentStatusExpansion
}
@ -166,3 +170,28 @@ func (c *componentStatuses) Patch(ctx context.Context, name string, pt types.Pat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied componentStatus.
func (c *componentStatuses) Apply(ctx context.Context, componentStatus *corev1.ComponentStatusApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ComponentStatus, err error) {
if componentStatus == nil {
return nil, fmt.Errorf("componentStatus provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(componentStatus)
if err != nil {
return nil, err
}
name := componentStatus.Name
if name == nil {
return nil, fmt.Errorf("componentStatus.Name must be provided to Apply")
}
result = &v1.ComponentStatus{}
err = c.client.Patch(types.ApplyPatchType).
Resource("componentstatuses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ConfigMapInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error)
Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error)
ConfigMapExpansion
}
@ -176,3 +180,29 @@ func (c *configMaps) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied configMap.
func (c *configMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) {
if configMap == nil {
return nil, fmt.Errorf("configMap provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(configMap)
if err != nil {
return nil, err
}
name := configMap.Name
if name == nil {
return nil, fmt.Errorf("configMap.Name must be provided to Apply")
}
result = &v1.ConfigMap{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("configmaps").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type EndpointsInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error)
Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error)
EndpointsExpansion
}
@ -176,3 +180,29 @@ func (c *endpoints) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied endpoints.
func (c *endpoints) Apply(ctx context.Context, endpoints *corev1.EndpointsApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Endpoints, err error) {
if endpoints == nil {
return nil, fmt.Errorf("endpoints provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(endpoints)
if err != nil {
return nil, err
}
name := endpoints.Name
if name == nil {
return nil, fmt.Errorf("endpoints.Name must be provided to Apply")
}
result = &v1.Endpoints{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("endpoints").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type EventInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error)
Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error)
EventExpansion
}
@ -176,3 +180,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
func (c *events) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) {
if event == nil {
return nil, fmt.Errorf("event provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(event)
if err != nil {
return nil, err
}
name := event.Name
if name == nil {
return nil, fmt.Errorf("event.Name must be provided to Apply")
}
result = &v1.Event{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("events").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type LimitRangeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error)
Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error)
LimitRangeExpansion
}
@ -176,3 +180,29 @@ func (c *limitRanges) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied limitRange.
func (c *limitRanges) Apply(ctx context.Context, limitRange *corev1.LimitRangeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.LimitRange, err error) {
if limitRange == nil {
return nil, fmt.Errorf("limitRange provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(limitRange)
if err != nil {
return nil, err
}
name := limitRange.Name
if name == nil {
return nil, fmt.Errorf("limitRange.Name must be provided to Apply")
}
result = &v1.LimitRange{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("limitranges").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,8 @@ type NamespaceInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error)
Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error)
ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error)
NamespaceExpansion
}
@ -166,3 +171,57 @@ func (c *namespaces) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied namespace.
func (c *namespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) {
if namespace == nil {
return nil, fmt.Errorf("namespace provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(namespace)
if err != nil {
return nil, err
}
name := namespace.Name
if name == nil {
return nil, fmt.Errorf("namespace.Name must be provided to Apply")
}
result = &v1.Namespace{}
err = c.client.Patch(types.ApplyPatchType).
Resource("namespaces").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *namespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) {
if namespace == nil {
return nil, fmt.Errorf("namespace provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(namespace)
if err != nil {
return nil, err
}
name := namespace.Name
if name == nil {
return nil, fmt.Errorf("namespace.Name must be provided to Apply")
}
result = &v1.Namespace{}
err = c.client.Patch(types.ApplyPatchType).
Resource("namespaces").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type NodeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error)
Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error)
ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error)
NodeExpansion
}
@ -182,3 +187,57 @@ func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied node.
func (c *nodes) Apply(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) {
if node == nil {
return nil, fmt.Errorf("node provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(node)
if err != nil {
return nil, err
}
name := node.Name
if name == nil {
return nil, fmt.Errorf("node.Name must be provided to Apply")
}
result = &v1.Node{}
err = c.client.Patch(types.ApplyPatchType).
Resource("nodes").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *nodes) ApplyStatus(ctx context.Context, node *corev1.NodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Node, err error) {
if node == nil {
return nil, fmt.Errorf("node provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(node)
if err != nil {
return nil, err
}
name := node.Name
if name == nil {
return nil, fmt.Errorf("node.Name must be provided to Apply")
}
result = &v1.Node{}
err = c.client.Patch(types.ApplyPatchType).
Resource("nodes").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PersistentVolumeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error)
Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error)
ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error)
PersistentVolumeExpansion
}
@ -182,3 +187,57 @@ func (c *persistentVolumes) Patch(ctx context.Context, name string, pt types.Pat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolume.
func (c *persistentVolumes) Apply(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) {
if persistentVolume == nil {
return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(persistentVolume)
if err != nil {
return nil, err
}
name := persistentVolume.Name
if name == nil {
return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply")
}
result = &v1.PersistentVolume{}
err = c.client.Patch(types.ApplyPatchType).
Resource("persistentvolumes").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *persistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *corev1.PersistentVolumeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolume, err error) {
if persistentVolume == nil {
return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(persistentVolume)
if err != nil {
return nil, err
}
name := persistentVolume.Name
if name == nil {
return nil, fmt.Errorf("persistentVolume.Name must be provided to Apply")
}
result = &v1.PersistentVolume{}
err = c.client.Patch(types.ApplyPatchType).
Resource("persistentvolumes").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PersistentVolumeClaimInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error)
Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error)
ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error)
PersistentVolumeClaimExpansion
}
@ -193,3 +198,59 @@ func (c *persistentVolumeClaims) Patch(ctx context.Context, name string, pt type
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolumeClaim.
func (c *persistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) {
if persistentVolumeClaim == nil {
return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(persistentVolumeClaim)
if err != nil {
return nil, err
}
name := persistentVolumeClaim.Name
if name == nil {
return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply")
}
result = &v1.PersistentVolumeClaim{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *persistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaimApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PersistentVolumeClaim, err error) {
if persistentVolumeClaim == nil {
return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(persistentVolumeClaim)
if err != nil {
return nil, err
}
name := persistentVolumeClaim.Name
if name == nil {
return nil, fmt.Errorf("persistentVolumeClaim.Name must be provided to Apply")
}
result = &v1.PersistentVolumeClaim{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("persistentvolumeclaims").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PodInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error)
Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error)
ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error)
GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error)
UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (*v1.EphemeralContainers, error)
@ -197,6 +202,62 @@ func (c *pods) Patch(ctx context.Context, name string, pt types.PatchType, data
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied pod.
func (c *pods) Apply(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) {
if pod == nil {
return nil, fmt.Errorf("pod provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(pod)
if err != nil {
return nil, err
}
name := pod.Name
if name == nil {
return nil, fmt.Errorf("pod.Name must be provided to Apply")
}
result = &v1.Pod{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("pods").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *pods) ApplyStatus(ctx context.Context, pod *corev1.PodApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Pod, err error) {
if pod == nil {
return nil, fmt.Errorf("pod provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(pod)
if err != nil {
return nil, err
}
name := pod.Name
if name == nil {
return nil, fmt.Errorf("pod.Name must be provided to Apply")
}
result = &v1.Pod{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("pods").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any.
func (c *pods) GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) {
result = &v1.EphemeralContainers{}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PodTemplateInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error)
Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error)
PodTemplateExpansion
}
@ -176,3 +180,29 @@ func (c *podTemplates) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podTemplate.
func (c *podTemplates) Apply(ctx context.Context, podTemplate *corev1.PodTemplateApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodTemplate, err error) {
if podTemplate == nil {
return nil, fmt.Errorf("podTemplate provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podTemplate)
if err != nil {
return nil, err
}
name := podTemplate.Name
if name == nil {
return nil, fmt.Errorf("podTemplate.Name must be provided to Apply")
}
result = &v1.PodTemplate{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("podtemplates").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,6 +20,8 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@ -27,6 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -48,6 +51,8 @@ type ReplicationControllerInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error)
Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error)
ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error)
GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error)
UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error)
@ -198,6 +203,62 @@ func (c *replicationControllers) Patch(ctx context.Context, name string, pt type
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicationController.
func (c *replicationControllers) Apply(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) {
if replicationController == nil {
return nil, fmt.Errorf("replicationController provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(replicationController)
if err != nil {
return nil, err
}
name := replicationController.Name
if name == nil {
return nil, fmt.Errorf("replicationController.Name must be provided to Apply")
}
result = &v1.ReplicationController{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicationcontrollers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *replicationControllers) ApplyStatus(ctx context.Context, replicationController *corev1.ReplicationControllerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ReplicationController, err error) {
if replicationController == nil {
return nil, fmt.Errorf("replicationController provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(replicationController)
if err != nil {
return nil, err
}
name := replicationController.Name
if name == nil {
return nil, fmt.Errorf("replicationController.Name must be provided to Apply")
}
result = &v1.ReplicationController{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicationcontrollers").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any.
func (c *replicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) {
result = &autoscalingv1.Scale{}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type ResourceQuotaInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error)
Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error)
ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error)
ResourceQuotaExpansion
}
@ -193,3 +198,59 @@ func (c *resourceQuotas) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied resourceQuota.
func (c *resourceQuotas) Apply(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) {
if resourceQuota == nil {
return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(resourceQuota)
if err != nil {
return nil, err
}
name := resourceQuota.Name
if name == nil {
return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply")
}
result = &v1.ResourceQuota{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("resourcequotas").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *resourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *corev1.ResourceQuotaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ResourceQuota, err error) {
if resourceQuota == nil {
return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(resourceQuota)
if err != nil {
return nil, err
}
name := resourceQuota.Name
if name == nil {
return nil, fmt.Errorf("resourceQuota.Name must be provided to Apply")
}
result = &v1.ResourceQuota{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("resourcequotas").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type SecretInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error)
Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error)
SecretExpansion
}
@ -176,3 +180,29 @@ func (c *secrets) Patch(ctx context.Context, name string, pt types.PatchType, da
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied secret.
func (c *secrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) {
if secret == nil {
return nil, fmt.Errorf("secret provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(secret)
if err != nil {
return nil, err
}
name := secret.Name
if name == nil {
return nil, fmt.Errorf("secret.Name must be provided to Apply")
}
result = &v1.Secret{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("secrets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,8 @@ type ServiceInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error)
Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error)
ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error)
ServiceExpansion
}
@ -176,3 +181,59 @@ func (c *services) Patch(ctx context.Context, name string, pt types.PatchType, d
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied service.
func (c *services) Apply(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) {
if service == nil {
return nil, fmt.Errorf("service provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(service)
if err != nil {
return nil, err
}
name := service.Name
if name == nil {
return nil, fmt.Errorf("service.Name must be provided to Apply")
}
result = &v1.Service{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("services").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *services) ApplyStatus(ctx context.Context, service *corev1.ServiceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Service, err error) {
if service == nil {
return nil, fmt.Errorf("service provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(service)
if err != nil {
return nil, err
}
name := service.Name
if name == nil {
return nil, fmt.Errorf("service.Name must be provided to Apply")
}
result = &v1.Service{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("services").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,6 +20,8 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
authenticationv1 "k8s.io/api/authentication/v1"
@ -27,6 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
corev1 "k8s.io/client-go/applyconfigurations/core/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,7 @@ type ServiceAccountInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error)
Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error)
CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error)
ServiceAccountExpansion
@ -180,6 +184,32 @@ func (c *serviceAccounts) Patch(ctx context.Context, name string, pt types.Patch
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied serviceAccount.
func (c *serviceAccounts) Apply(ctx context.Context, serviceAccount *corev1.ServiceAccountApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ServiceAccount, err error) {
if serviceAccount == nil {
return nil, fmt.Errorf("serviceAccount provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(serviceAccount)
if err != nil {
return nil, err
}
name := serviceAccount.Name
if name == nil {
return nil, fmt.Errorf("serviceAccount.Name must be provided to Apply")
}
result = &v1.ServiceAccount{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("serviceaccounts").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any.
func (c *serviceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) {
result = &authenticationv1.TokenRequest{}

View File

@ -16,30 +16,30 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/api/discovery/v1"
"k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
type DiscoveryV1alpha1Interface interface {
type DiscoveryV1Interface interface {
RESTClient() rest.Interface
EndpointSlicesGetter
}
// DiscoveryV1alpha1Client is used to interact with features provided by the discovery.k8s.io group.
type DiscoveryV1alpha1Client struct {
// DiscoveryV1Client is used to interact with features provided by the discovery.k8s.io group.
type DiscoveryV1Client struct {
restClient rest.Interface
}
func (c *DiscoveryV1alpha1Client) EndpointSlices(namespace string) EndpointSliceInterface {
func (c *DiscoveryV1Client) EndpointSlices(namespace string) EndpointSliceInterface {
return newEndpointSlices(c, namespace)
}
// NewForConfig creates a new DiscoveryV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*DiscoveryV1alpha1Client, error) {
// NewForConfig creates a new DiscoveryV1Client for the given config.
func NewForConfig(c *rest.Config) (*DiscoveryV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -48,12 +48,12 @@ func NewForConfig(c *rest.Config) (*DiscoveryV1alpha1Client, error) {
if err != nil {
return nil, err
}
return &DiscoveryV1alpha1Client{client}, nil
return &DiscoveryV1Client{client}, nil
}
// NewForConfigOrDie creates a new DiscoveryV1alpha1Client for the given config and
// NewForConfigOrDie creates a new DiscoveryV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *DiscoveryV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *DiscoveryV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -61,13 +61,13 @@ func NewForConfigOrDie(c *rest.Config) *DiscoveryV1alpha1Client {
return client
}
// New creates a new DiscoveryV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *DiscoveryV1alpha1Client {
return &DiscoveryV1alpha1Client{c}
// New creates a new DiscoveryV1Client for the given RESTClient.
func New(c rest.Interface) *DiscoveryV1Client {
return &DiscoveryV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -81,7 +81,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *DiscoveryV1alpha1Client) RESTClient() rest.Interface {
func (c *DiscoveryV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1

View File

@ -16,16 +16,19 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/discovery/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
discoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -38,14 +41,15 @@ type EndpointSlicesGetter interface {
// EndpointSliceInterface has methods to work with EndpointSlice resources.
type EndpointSliceInterface interface {
Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (*v1alpha1.EndpointSlice, error)
Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (*v1alpha1.EndpointSlice, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.EndpointSlice, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EndpointSliceList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error)
Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (*v1.EndpointSlice, error)
Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (*v1.EndpointSlice, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.EndpointSlice, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointSliceList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error)
Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error)
EndpointSliceExpansion
}
@ -56,7 +60,7 @@ type endpointSlices struct {
}
// newEndpointSlices returns a EndpointSlices
func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSlices {
func newEndpointSlices(c *DiscoveryV1Client, namespace string) *endpointSlices {
return &endpointSlices{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +68,8 @@ func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSl
}
// Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any.
func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
@ -77,12 +81,12 @@ func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOpt
}
// List takes label and field selectors, and returns the list of EndpointSlices that match those selectors.
func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) {
func (c *endpointSlices) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointSliceList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.EndpointSliceList{}
result = &v1.EndpointSliceList{}
err = c.client.Get().
Namespace(c.ns).
Resource("endpointslices").
@ -94,7 +98,7 @@ func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result
}
// Watch returns a watch.Interface that watches the requested endpointSlices.
func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
func (c *endpointSlices) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -109,8 +113,8 @@ func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.
}
// Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.CreateOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Post().
Namespace(c.ns).
Resource("endpointslices").
@ -122,8 +126,8 @@ func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.End
}
// Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any.
func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1.EndpointSlice, opts metav1.UpdateOptions) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Put().
Namespace(c.ns).
Resource("endpointslices").
@ -136,7 +140,7 @@ func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.End
}
// Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs.
func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
func (c *endpointSlices) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("endpointslices").
@ -147,7 +151,7 @@ func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.Delete
}
// DeleteCollection deletes a collection of objects.
func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
func (c *endpointSlices) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
@ -163,8 +167,8 @@ func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOpt
}
// Patch applies the patch and returns the patched endpointSlice.
func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error) {
result = &v1alpha1.EndpointSlice{}
func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.EndpointSlice, err error) {
result = &v1.EndpointSlice{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("endpointslices").
@ -176,3 +180,29 @@ func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice.
func (c *endpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1.EndpointSliceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.EndpointSlice, err error) {
if endpointSlice == nil {
return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(endpointSlice)
if err != nil {
return nil, err
}
name := endpointSlice.Name
if name == nil {
return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply")
}
result = &v1.EndpointSlice{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("endpointslices").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -16,6 +16,6 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
type EndpointSliceExpansion interface{}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/discovery/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type EndpointSliceInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error)
Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error)
EndpointSliceExpansion
}
@ -176,3 +180,29 @@ func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice.
func (c *endpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) {
if endpointSlice == nil {
return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(endpointSlice)
if err != nil {
return nil, err
}
name := endpointSlice.Name
if name == nil {
return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply")
}
result = &v1beta1.EndpointSlice{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("endpointslices").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/events/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
eventsv1 "k8s.io/client-go/applyconfigurations/events/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type EventInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error)
Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error)
EventExpansion
}
@ -176,3 +180,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
func (c *events) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) {
if event == nil {
return nil, fmt.Errorf("event provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(event)
if err != nil {
return nil, err
}
name := event.Name
if name == nil {
return nil, fmt.Errorf("event.Name must be provided to Apply")
}
result = &v1.Event{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("events").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/events/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type EventInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, 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.Event, err error)
Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error)
EventExpansion
}
@ -176,3 +180,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
func (c *events) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) {
if event == nil {
return nil, fmt.Errorf("event provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(event)
if err != nil {
return nil, err
}
name := event.Name
if name == nil {
return nil, fmt.Errorf("event.Name must be provided to Apply")
}
result = &v1beta1.Event{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("events").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DaemonSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, 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.DaemonSet, err error)
Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error)
ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error)
DaemonSetExpansion
}
@ -193,3 +198,59 @@ func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
func (c *daemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *daemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.DaemonSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("daemonsets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type DeploymentInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, 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.Deployment, err error)
Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error)
ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error)
GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error)
@ -197,6 +202,62 @@ func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *deployments) Apply(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *deployments) ApplyStatus(ctx context.Context, deployment *extensionsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.Deployment{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("deployments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *deployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type IngressInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, 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.Ingress, err error)
Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error)
ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error)
IngressExpansion
}
@ -193,3 +198,59 @@ func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied ingress.
func (c *ingresses) Apply(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1beta1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *ingresses) ApplyStatus(ctx context.Context, ingress *extensionsv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1beta1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type NetworkPolicyInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, 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.NetworkPolicy, err error)
Apply(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.NetworkPolicy, err error)
NetworkPolicyExpansion
}
@ -176,3 +180,29 @@ func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy.
func (c *networkPolicies) Apply(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.NetworkPolicy, err error) {
if networkPolicy == nil {
return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(networkPolicy)
if err != nil {
return nil, err
}
name := networkPolicy.Name
if name == nil {
return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply")
}
result = &v1beta1.NetworkPolicy{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("networkpolicies").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PodSecurityPolicyInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, 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.PodSecurityPolicy, err error)
Apply(ctx context.Context, podSecurityPolicy *extensionsv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error)
PodSecurityPolicyExpansion
}
@ -166,3 +170,28 @@ func (c *podSecurityPolicies) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podSecurityPolicy.
func (c *podSecurityPolicies) Apply(ctx context.Context, podSecurityPolicy *extensionsv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error) {
if podSecurityPolicy == nil {
return nil, fmt.Errorf("podSecurityPolicy provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podSecurityPolicy)
if err != nil {
return nil, err
}
name := podSecurityPolicy.Name
if name == nil {
return nil, fmt.Errorf("podSecurityPolicy.Name must be provided to Apply")
}
result = &v1beta1.PodSecurityPolicy{}
err = c.client.Patch(types.ApplyPatchType).
Resource("podsecuritypolicies").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type ReplicaSetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, 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.ReplicaSet, err error)
Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error)
ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error)
GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error)
UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error)
@ -197,6 +202,62 @@ func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
func (c *replicaSets) Apply(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *replicaSets) ApplyStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
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")
}
result = &v1beta1.ReplicaSet{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("replicasets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any.
func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
result = &v1beta1.Scale{}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type FlowSchemaInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error)
Apply(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error)
ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error)
FlowSchemaExpansion
}
@ -182,3 +187,57 @@ func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema.
func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) {
if flowSchema == nil {
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(flowSchema)
if err != nil {
return nil, err
}
name := flowSchema.Name
if name == nil {
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
}
result = &v1alpha1.FlowSchema{}
err = c.client.Patch(types.ApplyPatchType).
Resource("flowschemas").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.FlowSchema, err error) {
if flowSchema == nil {
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(flowSchema)
if err != nil {
return nil, err
}
name := flowSchema.Name
if name == nil {
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
}
result = &v1alpha1.FlowSchema{}
err = c.client.Patch(types.ApplyPatchType).
Resource("flowschemas").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/flowcontrol/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
flowcontrolv1alpha1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PriorityLevelConfigurationInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error)
Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error)
ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error)
PriorityLevelConfigurationExpansion
}
@ -182,3 +187,57 @@ func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration.
func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
if priorityLevelConfiguration == nil {
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityLevelConfiguration)
if err != nil {
return nil, err
}
name := priorityLevelConfiguration.Name
if name == nil {
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
}
result = &v1alpha1.PriorityLevelConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("prioritylevelconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) {
if priorityLevelConfiguration == nil {
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityLevelConfiguration)
if err != nil {
return nil, err
}
name := priorityLevelConfiguration.Name
if name == nil {
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
}
result = &v1alpha1.PriorityLevelConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("prioritylevelconfigurations").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/flowcontrol/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type FlowSchemaInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.FlowSchemaList, 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.FlowSchema, err error)
Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error)
ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error)
FlowSchemaExpansion
}
@ -182,3 +187,57 @@ func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema.
func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) {
if flowSchema == nil {
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(flowSchema)
if err != nil {
return nil, err
}
name := flowSchema.Name
if name == nil {
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
}
result = &v1beta1.FlowSchema{}
err = c.client.Patch(types.ApplyPatchType).
Resource("flowschemas").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchemaApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.FlowSchema, err error) {
if flowSchema == nil {
return nil, fmt.Errorf("flowSchema provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(flowSchema)
if err != nil {
return nil, err
}
name := flowSchema.Name
if name == nil {
return nil, fmt.Errorf("flowSchema.Name must be provided to Apply")
}
result = &v1beta1.FlowSchema{}
err = c.client.Patch(types.ApplyPatchType).
Resource("flowschemas").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/flowcontrol/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
flowcontrolv1beta1 "k8s.io/client-go/applyconfigurations/flowcontrol/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PriorityLevelConfigurationInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityLevelConfigurationList, 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.PriorityLevelConfiguration, err error)
Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error)
ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error)
PriorityLevelConfigurationExpansion
}
@ -182,3 +187,57 @@ func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration.
func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) {
if priorityLevelConfiguration == nil {
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityLevelConfiguration)
if err != nil {
return nil, err
}
name := priorityLevelConfiguration.Name
if name == nil {
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
}
result = &v1beta1.PriorityLevelConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("prioritylevelconfigurations").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityLevelConfiguration, err error) {
if priorityLevelConfiguration == nil {
return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityLevelConfiguration)
if err != nil {
return nil, err
}
name := priorityLevelConfiguration.Name
if name == nil {
return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply")
}
result = &v1beta1.PriorityLevelConfiguration{}
err = c.client.Patch(types.ApplyPatchType).
Resource("prioritylevelconfigurations").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type IngressInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error)
Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error)
ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error)
IngressExpansion
}
@ -193,3 +198,59 @@ func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied ingress.
func (c *ingresses) Apply(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *ingresses) ApplyStatus(ctx context.Context, ingress *networkingv1.IngressApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type IngressClassInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error)
Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error)
IngressClassExpansion
}
@ -166,3 +170,28 @@ func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass.
func (c *ingressClasses) Apply(ctx context.Context, ingressClass *networkingv1.IngressClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.IngressClass, err error) {
if ingressClass == nil {
return nil, fmt.Errorf("ingressClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingressClass)
if err != nil {
return nil, err
}
name := ingressClass.Name
if name == nil {
return nil, fmt.Errorf("ingressClass.Name must be provided to Apply")
}
result = &v1.IngressClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("ingressclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
networkingv1 "k8s.io/client-go/applyconfigurations/networking/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type NetworkPolicyInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error)
Apply(ctx context.Context, networkPolicy *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.NetworkPolicy, err error)
NetworkPolicyExpansion
}
@ -176,3 +180,29 @@ func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied networkPolicy.
func (c *networkPolicies) Apply(ctx context.Context, networkPolicy *networkingv1.NetworkPolicyApplyConfiguration, opts metav1.ApplyOptions) (result *v1.NetworkPolicy, err error) {
if networkPolicy == nil {
return nil, fmt.Errorf("networkPolicy provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(networkPolicy)
if err != nil {
return nil, err
}
name := networkPolicy.Name
if name == nil {
return nil, fmt.Errorf("networkPolicy.Name must be provided to Apply")
}
result = &v1.NetworkPolicy{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("networkpolicies").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/networking/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type IngressInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, 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.Ingress, err error)
Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error)
ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error)
IngressExpansion
}
@ -193,3 +198,59 @@ func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied ingress.
func (c *ingresses) Apply(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1beta1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *ingresses) ApplyStatus(ctx context.Context, ingress *networkingv1beta1.IngressApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Ingress, err error) {
if ingress == nil {
return nil, fmt.Errorf("ingress provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingress)
if err != nil {
return nil, err
}
name := ingress.Name
if name == nil {
return nil, fmt.Errorf("ingress.Name must be provided to Apply")
}
result = &v1beta1.Ingress{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("ingresses").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/networking/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
networkingv1beta1 "k8s.io/client-go/applyconfigurations/networking/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type IngressClassInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, 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.IngressClass, err error)
Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error)
IngressClassExpansion
}
@ -166,3 +170,28 @@ func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied ingressClass.
func (c *ingressClasses) Apply(ctx context.Context, ingressClass *networkingv1beta1.IngressClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.IngressClass, err error) {
if ingressClass == nil {
return nil, fmt.Errorf("ingressClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(ingressClass)
if err != nil {
return nil, err
}
name := ingressClass.Name
if name == nil {
return nil, fmt.Errorf("ingressClass.Name must be provided to Apply")
}
result = &v1beta1.IngressClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("ingressclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/node/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
nodev1 "k8s.io/client-go/applyconfigurations/node/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RuntimeClassInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.RuntimeClassList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RuntimeClass, err error)
Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error)
RuntimeClassExpansion
}
@ -166,3 +170,28 @@ func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass.
func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1.RuntimeClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RuntimeClass, err error) {
if runtimeClass == nil {
return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(runtimeClass)
if err != nil {
return nil, err
}
name := runtimeClass.Name
if name == nil {
return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply")
}
result = &v1.RuntimeClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("runtimeclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/node/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
nodev1alpha1 "k8s.io/client-go/applyconfigurations/node/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RuntimeClassInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error)
Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error)
RuntimeClassExpansion
}
@ -166,3 +170,28 @@ func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass.
func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RuntimeClass, err error) {
if runtimeClass == nil {
return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(runtimeClass)
if err != nil {
return nil, err
}
name := runtimeClass.Name
if name == nil {
return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply")
}
result = &v1alpha1.RuntimeClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("runtimeclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/node/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
nodev1beta1 "k8s.io/client-go/applyconfigurations/node/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RuntimeClassInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, 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.RuntimeClass, err error)
Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error)
RuntimeClassExpansion
}
@ -166,3 +170,28 @@ func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied runtimeClass.
func (c *runtimeClasses) Apply(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RuntimeClass, err error) {
if runtimeClass == nil {
return nil, fmt.Errorf("runtimeClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(runtimeClass)
if err != nil {
return nil, err
}
name := runtimeClass.Name
if name == nil {
return nil, fmt.Errorf("runtimeClass.Name must be provided to Apply")
}
result = &v1beta1.RuntimeClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("runtimeclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v2alpha1
package v1

View File

@ -16,6 +16,6 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v2alpha1
package v1
type CronJobExpansion interface{}
type PodDisruptionBudgetExpansion interface{}

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 client-gen. DO NOT EDIT.
package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/policy/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
policyv1 "k8s.io/client-go/applyconfigurations/policy/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// PodDisruptionBudgetsGetter has a method to return a PodDisruptionBudgetInterface.
// A group's client should implement this interface.
type PodDisruptionBudgetsGetter interface {
PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface
}
// PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources.
type PodDisruptionBudgetInterface interface {
Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (*v1.PodDisruptionBudget, error)
Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error)
UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (*v1.PodDisruptionBudget, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodDisruptionBudget, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.PodDisruptionBudgetList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error)
Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error)
ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error)
PodDisruptionBudgetExpansion
}
// podDisruptionBudgets implements PodDisruptionBudgetInterface
type podDisruptionBudgets struct {
client rest.Interface
ns string
}
// newPodDisruptionBudgets returns a PodDisruptionBudgets
func newPodDisruptionBudgets(c *PolicyV1Client, namespace string) *podDisruptionBudgets {
return &podDisruptionBudgets{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any.
func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodDisruptionBudget, err error) {
result = &v1.PodDisruptionBudget{}
err = c.client.Get().
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors.
func (c *podDisruptionBudgets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodDisruptionBudgetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodDisruptionBudgetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("poddisruptionbudgets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podDisruptionBudgets.
func (c *podDisruptionBudgets) Watch(ctx context.Context, opts metav1.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("poddisruptionbudgets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any.
func (c *podDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.CreateOptions) (result *v1.PodDisruptionBudget, err error) {
result = &v1.PodDisruptionBudget{}
err = c.client.Post().
Namespace(c.ns).
Resource("poddisruptionbudgets").
VersionedParams(&opts, scheme.ParameterCodec).
Body(podDisruptionBudget).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any.
func (c *podDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) {
result = &v1.PodDisruptionBudget{}
err = c.client.Put().
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(podDisruptionBudget.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(podDisruptionBudget).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1.PodDisruptionBudget, opts metav1.UpdateOptions) (result *v1.PodDisruptionBudget, err error) {
result = &v1.PodDisruptionBudget{}
err = c.client.Put().
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(podDisruptionBudget.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(podDisruptionBudget).
Do(ctx).
Into(result)
return
}
// Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs.
func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.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("poddisruptionbudgets").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched podDisruptionBudget.
func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodDisruptionBudget, err error) {
result = &v1.PodDisruptionBudget{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("poddisruptionbudgets").
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 podDisruptionBudget.
func (c *podDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) {
if podDisruptionBudget == nil {
return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podDisruptionBudget)
if err != nil {
return nil, err
}
name := podDisruptionBudget.Name
if name == nil {
return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply")
}
result = &v1.PodDisruptionBudget{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *podDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudgetApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PodDisruptionBudget, err error) {
if podDisruptionBudget == nil {
return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podDisruptionBudget)
if err != nil {
return nil, err
}
name := podDisruptionBudget.Name
if name == nil {
return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply")
}
result = &v1.PodDisruptionBudget{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -16,30 +16,30 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v2alpha1
package v1
import (
v2alpha1 "k8s.io/api/batch/v2alpha1"
v1 "k8s.io/api/policy/v1"
"k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
type BatchV2alpha1Interface interface {
type PolicyV1Interface interface {
RESTClient() rest.Interface
CronJobsGetter
PodDisruptionBudgetsGetter
}
// BatchV2alpha1Client is used to interact with features provided by the batch group.
type BatchV2alpha1Client struct {
// PolicyV1Client is used to interact with features provided by the policy group.
type PolicyV1Client struct {
restClient rest.Interface
}
func (c *BatchV2alpha1Client) CronJobs(namespace string) CronJobInterface {
return newCronJobs(c, namespace)
func (c *PolicyV1Client) PodDisruptionBudgets(namespace string) PodDisruptionBudgetInterface {
return newPodDisruptionBudgets(c, namespace)
}
// NewForConfig creates a new BatchV2alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*BatchV2alpha1Client, error) {
// NewForConfig creates a new PolicyV1Client for the given config.
func NewForConfig(c *rest.Config) (*PolicyV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -48,12 +48,12 @@ func NewForConfig(c *rest.Config) (*BatchV2alpha1Client, error) {
if err != nil {
return nil, err
}
return &BatchV2alpha1Client{client}, nil
return &PolicyV1Client{client}, nil
}
// NewForConfigOrDie creates a new BatchV2alpha1Client for the given config and
// NewForConfigOrDie creates a new PolicyV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *BatchV2alpha1Client {
func NewForConfigOrDie(c *rest.Config) *PolicyV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -61,13 +61,13 @@ func NewForConfigOrDie(c *rest.Config) *BatchV2alpha1Client {
return client
}
// New creates a new BatchV2alpha1Client for the given RESTClient.
func New(c rest.Interface) *BatchV2alpha1Client {
return &BatchV2alpha1Client{c}
// New creates a new PolicyV1Client for the given RESTClient.
func New(c rest.Interface) *PolicyV1Client {
return &PolicyV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v2alpha1.SchemeGroupVersion
gv := v1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -81,7 +81,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *BatchV2alpha1Client) RESTClient() rest.Interface {
func (c *PolicyV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/policy/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type PodDisruptionBudgetInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, 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.PodDisruptionBudget, err error)
Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error)
ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error)
PodDisruptionBudgetExpansion
}
@ -193,3 +198,59 @@ func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podDisruptionBudget.
func (c *podDisruptionBudgets) Apply(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) {
if podDisruptionBudget == nil {
return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podDisruptionBudget)
if err != nil {
return nil, err
}
name := podDisruptionBudget.Name
if name == nil {
return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply")
}
result = &v1beta1.PodDisruptionBudget{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *podDisruptionBudgets) ApplyStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudgetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodDisruptionBudget, err error) {
if podDisruptionBudget == nil {
return nil, fmt.Errorf("podDisruptionBudget provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podDisruptionBudget)
if err != nil {
return nil, err
}
name := podDisruptionBudget.Name
if name == nil {
return nil, fmt.Errorf("podDisruptionBudget.Name must be provided to Apply")
}
result = &v1beta1.PodDisruptionBudget{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("poddisruptionbudgets").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/policy/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
policyv1beta1 "k8s.io/client-go/applyconfigurations/policy/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PodSecurityPolicyInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, 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.PodSecurityPolicy, err error)
Apply(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error)
PodSecurityPolicyExpansion
}
@ -166,3 +170,28 @@ func (c *podSecurityPolicies) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podSecurityPolicy.
func (c *podSecurityPolicies) Apply(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicyApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PodSecurityPolicy, err error) {
if podSecurityPolicy == nil {
return nil, fmt.Errorf("podSecurityPolicy provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(podSecurityPolicy)
if err != nil {
return nil, err
}
name := podSecurityPolicy.Name
if name == nil {
return nil, fmt.Errorf("podSecurityPolicy.Name must be provided to Apply")
}
result = &v1beta1.PodSecurityPolicy{}
err = c.client.Patch(types.ApplyPatchType).
Resource("podsecuritypolicies").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error)
Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error)
ClusterRoleExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole.
func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1.ClusterRoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRole, err error) {
if clusterRole == nil {
return nil, fmt.Errorf("clusterRole provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRole)
if err != nil {
return nil, err
}
name := clusterRole.Name
if name == nil {
return nil, fmt.Errorf("clusterRole.Name must be provided to Apply")
}
result = &v1.ClusterRole{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterroles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleBindingInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error)
Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error)
ClusterRoleBindingExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding.
func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ClusterRoleBinding, err error) {
if clusterRoleBinding == nil {
return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRoleBinding)
if err != nil {
return nil, err
}
name := clusterRoleBinding.Name
if name == nil {
return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply")
}
result = &v1.ClusterRoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterrolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error)
Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error)
RoleExpansion
}
@ -176,3 +180,29 @@ func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied role.
func (c *roles) Apply(ctx context.Context, role *rbacv1.RoleApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Role, err error) {
if role == nil {
return nil, fmt.Errorf("role provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(role)
if err != nil {
return nil, err
}
name := role.Name
if name == nil {
return nil, fmt.Errorf("role.Name must be provided to Apply")
}
result = &v1.Role{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("roles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1 "k8s.io/client-go/applyconfigurations/rbac/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleBindingInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error)
Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error)
RoleBindingExpansion
}
@ -176,3 +180,29 @@ func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding.
func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1.RoleBindingApplyConfiguration, opts metav1.ApplyOptions) (result *v1.RoleBinding, err error) {
if roleBinding == nil {
return nil, fmt.Errorf("roleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(roleBinding)
if err != nil {
return nil, err
}
name := roleBinding.Name
if name == nil {
return nil, fmt.Errorf("roleBinding.Name must be provided to Apply")
}
result = &v1.RoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("rolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/rbac/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error)
Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error)
ClusterRoleExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole.
func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRole, err error) {
if clusterRole == nil {
return nil, fmt.Errorf("clusterRole provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRole)
if err != nil {
return nil, err
}
name := clusterRole.Name
if name == nil {
return nil, fmt.Errorf("clusterRole.Name must be provided to Apply")
}
result = &v1alpha1.ClusterRole{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterroles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/rbac/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleBindingInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error)
Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error)
ClusterRoleBindingExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding.
func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.ClusterRoleBinding, err error) {
if clusterRoleBinding == nil {
return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRoleBinding)
if err != nil {
return nil, err
}
name := clusterRoleBinding.Name
if name == nil {
return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply")
}
result = &v1alpha1.ClusterRoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterrolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/rbac/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error)
Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error)
RoleExpansion
}
@ -176,3 +180,29 @@ func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied role.
func (c *roles) Apply(ctx context.Context, role *rbacv1alpha1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.Role, err error) {
if role == nil {
return nil, fmt.Errorf("role provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(role)
if err != nil {
return nil, err
}
name := role.Name
if name == nil {
return nil, fmt.Errorf("role.Name must be provided to Apply")
}
result = &v1alpha1.Role{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("roles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/rbac/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1alpha1 "k8s.io/client-go/applyconfigurations/rbac/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleBindingInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error)
Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error)
RoleBindingExpansion
}
@ -176,3 +180,29 @@ func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding.
func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1alpha1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.RoleBinding, err error) {
if roleBinding == nil {
return nil, fmt.Errorf("roleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(roleBinding)
if err != nil {
return nil, err
}
name := roleBinding.Name
if name == nil {
return nil, fmt.Errorf("roleBinding.Name must be provided to Apply")
}
result = &v1alpha1.RoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("rolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/rbac/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, 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.ClusterRole, err error)
Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error)
ClusterRoleExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRole.
func (c *clusterRoles) Apply(ctx context.Context, clusterRole *rbacv1beta1.ClusterRoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRole, err error) {
if clusterRole == nil {
return nil, fmt.Errorf("clusterRole provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRole)
if err != nil {
return nil, err
}
name := clusterRole.Name
if name == nil {
return nil, fmt.Errorf("clusterRole.Name must be provided to Apply")
}
result = &v1beta1.ClusterRole{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterroles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/rbac/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type ClusterRoleBindingInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, 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.ClusterRoleBinding, err error)
Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error)
ClusterRoleBindingExpansion
}
@ -166,3 +170,28 @@ func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.P
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied clusterRoleBinding.
func (c *clusterRoleBindings) Apply(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ClusterRoleBinding, err error) {
if clusterRoleBinding == nil {
return nil, fmt.Errorf("clusterRoleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(clusterRoleBinding)
if err != nil {
return nil, err
}
name := clusterRoleBinding.Name
if name == nil {
return nil, fmt.Errorf("clusterRoleBinding.Name must be provided to Apply")
}
result = &v1beta1.ClusterRoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Resource("clusterrolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/rbac/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, 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.Role, err error)
Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error)
RoleExpansion
}
@ -176,3 +180,29 @@ func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied role.
func (c *roles) Apply(ctx context.Context, role *rbacv1beta1.RoleApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Role, err error) {
if role == nil {
return nil, fmt.Errorf("role provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(role)
if err != nil {
return nil, err
}
name := role.Name
if name == nil {
return nil, fmt.Errorf("role.Name must be provided to Apply")
}
result = &v1beta1.Role{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("roles").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/rbac/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rbacv1beta1 "k8s.io/client-go/applyconfigurations/rbac/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type RoleBindingInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, 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.RoleBinding, err error)
Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error)
RoleBindingExpansion
}
@ -176,3 +180,29 @@ func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchTyp
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied roleBinding.
func (c *roleBindings) Apply(ctx context.Context, roleBinding *rbacv1beta1.RoleBindingApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.RoleBinding, err error) {
if roleBinding == nil {
return nil, fmt.Errorf("roleBinding provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(roleBinding)
if err != nil {
return nil, err
}
name := roleBinding.Name
if name == nil {
return nil, fmt.Errorf("roleBinding.Name must be provided to Apply")
}
result = &v1beta1.RoleBinding{}
err = c.client.Patch(types.ApplyPatchType).
Namespace(c.ns).
Resource("rolebindings").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/scheduling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
schedulingv1 "k8s.io/client-go/applyconfigurations/scheduling/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PriorityClassInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error)
Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error)
PriorityClassExpansion
}
@ -166,3 +170,28 @@ func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass.
func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1.PriorityClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityClass, err error) {
if priorityClass == nil {
return nil, fmt.Errorf("priorityClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityClass)
if err != nil {
return nil, err
}
name := priorityClass.Name
if name == nil {
return nil, fmt.Errorf("priorityClass.Name must be provided to Apply")
}
result = &v1.PriorityClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("priorityclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/scheduling/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
schedulingv1alpha1 "k8s.io/client-go/applyconfigurations/scheduling/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PriorityClassInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error)
Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error)
PriorityClassExpansion
}
@ -166,3 +170,28 @@ func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass.
func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.PriorityClass, err error) {
if priorityClass == nil {
return nil, fmt.Errorf("priorityClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityClass)
if err != nil {
return nil, err
}
name := priorityClass.Name
if name == nil {
return nil, fmt.Errorf("priorityClass.Name must be provided to Apply")
}
result = &v1alpha1.PriorityClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("priorityclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1beta1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1beta1 "k8s.io/api/scheduling/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
schedulingv1beta1 "k8s.io/client-go/applyconfigurations/scheduling/v1beta1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type PriorityClassInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, 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.PriorityClass, err error)
Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error)
PriorityClassExpansion
}
@ -166,3 +170,28 @@ func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.Patch
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied priorityClass.
func (c *priorityClasses) Apply(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClassApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.PriorityClass, err error) {
if priorityClass == nil {
return nil, fmt.Errorf("priorityClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(priorityClass)
if err != nil {
return nil, err
}
name := priorityClass.Name
if name == nil {
return nil, fmt.Errorf("priorityClass.Name must be provided to Apply")
}
result = &v1beta1.PriorityClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("priorityclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1 "k8s.io/client-go/applyconfigurations/storage/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type CSIDriverInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIDriverList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error)
Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error)
CSIDriverExpansion
}
@ -166,3 +170,28 @@ func (c *cSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType,
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cSIDriver.
func (c *cSIDrivers) Apply(ctx context.Context, cSIDriver *storagev1.CSIDriverApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSIDriver, err error) {
if cSIDriver == nil {
return nil, fmt.Errorf("cSIDriver provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cSIDriver)
if err != nil {
return nil, err
}
name := cSIDriver.Name
if name == nil {
return nil, fmt.Errorf("cSIDriver.Name must be provided to Apply")
}
result = &v1.CSIDriver{}
err = c.client.Patch(types.ApplyPatchType).
Resource("csidrivers").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1 "k8s.io/client-go/applyconfigurations/storage/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type CSINodeInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error)
Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error)
CSINodeExpansion
}
@ -166,3 +170,28 @@ func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, d
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cSINode.
func (c *cSINodes) Apply(ctx context.Context, cSINode *storagev1.CSINodeApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CSINode, err error) {
if cSINode == nil {
return nil, fmt.Errorf("cSINode provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(cSINode)
if err != nil {
return nil, err
}
name := cSINode.Name
if name == nil {
return nil, fmt.Errorf("cSINode.Name must be provided to Apply")
}
result = &v1.CSINode{}
err = c.client.Patch(types.ApplyPatchType).
Resource("csinodes").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1 "k8s.io/client-go/applyconfigurations/storage/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type StorageClassInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error)
Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error)
StorageClassExpansion
}
@ -166,3 +170,28 @@ func (c *storageClasses) Patch(ctx context.Context, name string, pt types.PatchT
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied storageClass.
func (c *storageClasses) Apply(ctx context.Context, storageClass *storagev1.StorageClassApplyConfiguration, opts metav1.ApplyOptions) (result *v1.StorageClass, err error) {
if storageClass == nil {
return nil, fmt.Errorf("storageClass provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(storageClass)
if err != nil {
return nil, err
}
name := storageClass.Name
if name == nil {
return nil, fmt.Errorf("storageClass.Name must be provided to Apply")
}
result = &v1.StorageClass{}
err = c.client.Patch(types.ApplyPatchType).
Resource("storageclasses").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1 "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1 "k8s.io/client-go/applyconfigurations/storage/v1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type VolumeAttachmentInterface interface {
List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error)
Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error)
ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error)
VolumeAttachmentExpansion
}
@ -182,3 +187,57 @@ func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.Pat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment.
func (c *volumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) {
if volumeAttachment == nil {
return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(volumeAttachment)
if err != nil {
return nil, err
}
name := volumeAttachment.Name
if name == nil {
return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply")
}
result = &v1.VolumeAttachment{}
err = c.client.Patch(types.ApplyPatchType).
Resource("volumeattachments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *volumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.VolumeAttachment, err error) {
if volumeAttachment == nil {
return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(volumeAttachment)
if err != nil {
return nil, err
}
name := volumeAttachment.Name
if name == nil {
return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply")
}
result = &v1.VolumeAttachment{}
err = c.client.Patch(types.ApplyPatchType).
Resource("volumeattachments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

View File

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/storage/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -46,6 +49,7 @@ type CSIStorageCapacityInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.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 *v1alpha1.CSIStorageCapacity, err error)
Apply(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.CSIStorageCapacity, err error)
CSIStorageCapacityExpansion
}
@ -176,3 +180,29 @@ func (c *cSIStorageCapacities) Patch(ctx context.Context, name string, pt types.
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 *storagev1alpha1.CSIStorageCapacityApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.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 = &v1alpha1.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

@ -20,12 +20,15 @@ package v1alpha1
import (
"context"
json "encoding/json"
"fmt"
"time"
v1alpha1 "k8s.io/api/storage/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
storagev1alpha1 "k8s.io/client-go/applyconfigurations/storage/v1alpha1"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
@ -47,6 +50,8 @@ type VolumeAttachmentInterface interface {
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error)
Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error)
ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error)
VolumeAttachmentExpansion
}
@ -182,3 +187,57 @@ func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.Pat
Into(result)
return
}
// Apply takes the given apply declarative configuration, applies it and returns the applied volumeAttachment.
func (c *volumeAttachments) Apply(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) {
if volumeAttachment == nil {
return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(volumeAttachment)
if err != nil {
return nil, err
}
name := volumeAttachment.Name
if name == nil {
return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply")
}
result = &v1alpha1.VolumeAttachment{}
err = c.client.Patch(types.ApplyPatchType).
Resource("volumeattachments").
Name(*name).
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *volumeAttachments) ApplyStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachmentApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.VolumeAttachment, err error) {
if volumeAttachment == nil {
return nil, fmt.Errorf("volumeAttachment provided to Apply must not be nil")
}
patchOpts := opts.ToPatchOptions()
data, err := json.Marshal(volumeAttachment)
if err != nil {
return nil, err
}
name := volumeAttachment.Name
if name == nil {
return nil, fmt.Errorf("volumeAttachment.Name must be provided to Apply")
}
result = &v1alpha1.VolumeAttachment{}
err = c.client.Patch(types.ApplyPatchType).
Resource("volumeattachments").
Name(*name).
SubResource("status").
VersionedParams(&patchOpts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}

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