Update k8s dependency version to 1.21

Signed-off-by: xinyanwu409 <wxinyan@vmware>
This commit is contained in:
wxinyan
2021-04-15 23:35:04 -07:00
committed by xinyanwu409
parent f255fe7b46
commit 17b8ffe7f8
1302 changed files with 108432 additions and 10464 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

@@ -54,8 +54,6 @@ import (
fakebatchv1 "k8s.io/client-go/kubernetes/typed/batch/v1/fake"
batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1"
fakebatchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1/fake"
batchv2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1"
fakebatchv2alpha1 "k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake"
certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1"
fakecertificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1/fake"
certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1"
@@ -66,8 +64,8 @@ import (
fakecoordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1/fake"
corev1 "k8s.io/client-go/kubernetes/typed/core/v1"
fakecorev1 "k8s.io/client-go/kubernetes/typed/core/v1/fake"
discoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
fakediscoveryv1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/fake"
discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
fakediscoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1/fake"
discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1"
fakediscoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1/fake"
eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1"
@@ -90,6 +88,8 @@ import (
fakenodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1/fake"
nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1"
fakenodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1/fake"
policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1"
fakepolicyv1 "k8s.io/client-go/kubernetes/typed/policy/v1/fake"
policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1"
fakepolicyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake"
rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1"
@@ -235,11 +235,6 @@ func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface {
return &fakebatchv1beta1.FakeBatchV1beta1{Fake: &c.Fake}
}
// BatchV2alpha1 retrieves the BatchV2alpha1Client
func (c *Clientset) BatchV2alpha1() batchv2alpha1.BatchV2alpha1Interface {
return &fakebatchv2alpha1.FakeBatchV2alpha1{Fake: &c.Fake}
}
// CertificatesV1 retrieves the CertificatesV1Client
func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface {
return &fakecertificatesv1.FakeCertificatesV1{Fake: &c.Fake}
@@ -265,9 +260,9 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface {
return &fakecorev1.FakeCoreV1{Fake: &c.Fake}
}
// DiscoveryV1alpha1 retrieves the DiscoveryV1alpha1Client
func (c *Clientset) DiscoveryV1alpha1() discoveryv1alpha1.DiscoveryV1alpha1Interface {
return &fakediscoveryv1alpha1.FakeDiscoveryV1alpha1{Fake: &c.Fake}
// DiscoveryV1 retrieves the DiscoveryV1Client
func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface {
return &fakediscoveryv1.FakeDiscoveryV1{Fake: &c.Fake}
}
// DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client
@@ -325,6 +320,11 @@ func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface {
return &fakenodev1beta1.FakeNodeV1beta1{Fake: &c.Fake}
}
// PolicyV1 retrieves the PolicyV1Client
func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface {
return &fakepolicyv1.FakePolicyV1{Fake: &c.Fake}
}
// PolicyV1beta1 retrieves the PolicyV1beta1Client
func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface {
return &fakepolicyv1beta1.FakePolicyV1beta1{Fake: &c.Fake}

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

@@ -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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
testing "k8s.io/client-go/testing"
)
@@ -120,3 +123,24 @@ func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name stri
}
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *applyconfigurationsadmissionregistrationv1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) {
if mutatingWebhookConfiguration == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil")
}
data, err := json.Marshal(mutatingWebhookConfiguration)
if err != nil {
return nil, err
}
name := mutatingWebhookConfiguration.Name
if name == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &admissionregistrationv1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsadmissionregistrationv1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1"
testing "k8s.io/client-go/testing"
)
@@ -120,3 +123,24 @@ func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name st
}
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *applyconfigurationsadmissionregistrationv1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) {
if validatingWebhookConfiguration == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil")
}
data, err := json.Marshal(validatingWebhookConfiguration)
if err != nil {
return nil, err
}
name := validatingWebhookConfiguration.Name
if name == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -120,3 +123,24 @@ func (c *FakeMutatingWebhookConfigurations) Patch(ctx context.Context, name stri
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied mutatingWebhookConfiguration.
func (c *FakeMutatingWebhookConfigurations) Apply(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) {
if mutatingWebhookConfiguration == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration provided to Apply must not be nil")
}
data, err := json.Marshal(mutatingWebhookConfiguration)
if err != nil {
return nil, err
}
name := mutatingWebhookConfiguration.Name
if name == nil {
return nil, fmt.Errorf("mutatingWebhookConfiguration.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.MutatingWebhookConfiguration), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
admissionregistrationv1beta1 "k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -120,3 +123,24 @@ func (c *FakeValidatingWebhookConfigurations) Patch(ctx context.Context, name st
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied validatingWebhookConfiguration.
func (c *FakeValidatingWebhookConfigurations) Apply(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfigurationApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
if validatingWebhookConfiguration == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration provided to Apply must not be nil")
}
data, err := json.Marshal(validatingWebhookConfiguration)
if err != nil {
return nil, err
}
name := validatingWebhookConfiguration.Name
if name == nil {
return nil, fmt.Errorf("validatingWebhookConfiguration.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, *name, types.ApplyPatchType, data), &v1beta1.ValidatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.ValidatingWebhookConfiguration), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1alpha1 "k8s.io/api/apiserverinternal/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
apiserverinternalv1alpha1 "k8s.io/client-go/applyconfigurations/apiserverinternal/v1alpha1"
testing "k8s.io/client-go/testing"
)
@@ -131,3 +134,46 @@ func (c *FakeStorageVersions) Patch(ctx context.Context, name string, pt types.P
}
return obj.(*v1alpha1.StorageVersion), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied storageVersion.
func (c *FakeStorageVersions) Apply(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) {
if storageVersion == nil {
return nil, fmt.Errorf("storageVersion provided to Apply must not be nil")
}
data, err := json.Marshal(storageVersion)
if err != nil {
return nil, err
}
name := storageVersion.Name
if name == nil {
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data), &v1alpha1.StorageVersion{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.StorageVersion), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeStorageVersions) ApplyStatus(ctx context.Context, storageVersion *apiserverinternalv1alpha1.StorageVersionApplyConfiguration, opts v1.ApplyOptions) (result *v1alpha1.StorageVersion, err error) {
if storageVersion == nil {
return nil, fmt.Errorf("storageVersion provided to Apply must not be nil")
}
data, err := json.Marshal(storageVersion)
if err != nil {
return nil, err
}
name := storageVersion.Name
if name == nil {
return nil, fmt.Errorf("storageVersion.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(storageversionsResource, *name, types.ApplyPatchType, data, "status"), &v1alpha1.StorageVersion{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.StorageVersion), err
}

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 fake
import (
"context"
json "encoding/json"
"fmt"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt typ
}
return obj.(*appsv1.ControllerRevision), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *applyconfigurationsappsv1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ControllerRevision, err error) {
if controllerRevision == nil {
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
}
data, err := json.Marshal(controllerRevision)
if err != nil {
return nil, err
}
name := controllerRevision.Name
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.ControllerRevision{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.ControllerRevision), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchT
}
return obj.(*appsv1.DaemonSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *applyconfigurationsappsv1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
data, err := json.Marshal(daemonSet)
if err != nil {
return nil, err
}
name := daemonSet.Name
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.DaemonSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.DaemonSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *applyconfigurationsappsv1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
data, err := json.Marshal(daemonSet)
if err != nil {
return nil, err
}
name := daemonSet.Name
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.DaemonSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.DaemonSet), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@@ -28,6 +30,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
testing "k8s.io/client-go/testing"
)
@@ -142,6 +145,51 @@ func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.Patch
return obj.(*appsv1.Deployment), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *FakeDeployments) Apply(ctx context.Context, deployment *applyconfigurationsappsv1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.Deployment), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *applyconfigurationsappsv1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.Deployment), err
}
// GetScale takes name of the deployment, and returns the corresponding scale object, and an error if there is any.
func (c *FakeDeployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake.

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@@ -28,6 +30,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
testing "k8s.io/client-go/testing"
)
@@ -142,6 +145,51 @@ func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.Patch
return obj.(*appsv1.ReplicaSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *applyconfigurationsappsv1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
data, err := json.Marshal(replicaSet)
if err != nil {
return nil, err
}
name := replicaSet.Name
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.ReplicaSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.ReplicaSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *applyconfigurationsappsv1.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
data, err := json.Marshal(replicaSet)
if err != nil {
return nil, err
}
name := replicaSet.Name
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.ReplicaSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.ReplicaSet), err
}
// GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake.

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
appsv1 "k8s.io/api/apps/v1"
autoscalingv1 "k8s.io/api/autoscaling/v1"
@@ -28,6 +30,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsappsv1 "k8s.io/client-go/applyconfigurations/apps/v1"
testing "k8s.io/client-go/testing"
)
@@ -142,6 +145,51 @@ func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.Patc
return obj.(*appsv1.StatefulSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *applyconfigurationsappsv1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &appsv1.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.StatefulSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *applyconfigurationsappsv1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *appsv1.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &appsv1.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*appsv1.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake.

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt typ
}
return obj.(*v1beta1.ControllerRevision), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ControllerRevision, err error) {
if controllerRevision == nil {
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
}
data, err := json.Marshal(controllerRevision)
if err != nil {
return nil, err
}
name := controllerRevision.Name
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ControllerRevision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.ControllerRevision), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.Patch
}
return obj.(*v1beta1.Deployment), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta1.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta1 "k8s.io/client-go/applyconfigurations/apps/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.Patc
}
return obj.(*v1beta1.StatefulSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.StatefulSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.StatefulSet), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeControllerRevisions) Patch(ctx context.Context, name string, pt typ
}
return obj.(*v1beta2.ControllerRevision), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied controllerRevision.
func (c *FakeControllerRevisions) Apply(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevisionApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ControllerRevision, err error) {
if controllerRevision == nil {
return nil, fmt.Errorf("controllerRevision provided to Apply must not be nil")
}
data, err := json.Marshal(controllerRevision)
if err != nil {
return nil, err
}
name := controllerRevision.Name
if name == nil {
return nil, fmt.Errorf("controllerRevision.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ControllerRevision{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ControllerRevision), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeDaemonSets) Patch(ctx context.Context, name string, pt types.PatchT
}
return obj.(*v1beta2.DaemonSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
func (c *FakeDaemonSets) Apply(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
data, err := json.Marshal(daemonSet)
if err != nil {
return nil, err
}
name := daemonSet.Name
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.DaemonSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.DaemonSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDaemonSets) ApplyStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.DaemonSet, err error) {
if daemonSet == nil {
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
}
data, err := json.Marshal(daemonSet)
if err != nil {
return nil, err
}
name := daemonSet.Name
if name == nil {
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.DaemonSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.DaemonSet), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeDeployments) Patch(ctx context.Context, name string, pt types.Patch
}
return obj.(*v1beta2.Deployment), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied deployment.
func (c *FakeDeployments) Apply(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Deployment), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeDeployments) ApplyStatus(ctx context.Context, deployment *appsv1beta2.DeploymentApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.Deployment, err error) {
if deployment == nil {
return nil, fmt.Errorf("deployment provided to Apply must not be nil")
}
data, err := json.Marshal(deployment)
if err != nil {
return nil, err
}
name := deployment.Name
if name == nil {
return nil, fmt.Errorf("deployment.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.Deployment), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeReplicaSets) Patch(ctx context.Context, name string, pt types.Patch
}
return obj.(*v1beta2.ReplicaSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicaSet.
func (c *FakeReplicaSets) Apply(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
data, err := json.Marshal(replicaSet)
if err != nil {
return nil, err
}
name := replicaSet.Name
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.ReplicaSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ReplicaSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeReplicaSets) ApplyStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.ReplicaSet, err error) {
if replicaSet == nil {
return nil, fmt.Errorf("replicaSet provided to Apply must not be nil")
}
data, err := json.Marshal(replicaSet)
if err != nil {
return nil, err
}
name := replicaSet.Name
if name == nil {
return nil, fmt.Errorf("replicaSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.ReplicaSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.ReplicaSet), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta2 "k8s.io/api/apps/v1beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
appsv1beta2 "k8s.io/client-go/applyconfigurations/apps/v1beta2"
testing "k8s.io/client-go/testing"
)
@@ -141,6 +144,51 @@ func (c *FakeStatefulSets) Patch(ctx context.Context, name string, pt types.Patc
return obj.(*v1beta2.StatefulSet), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied statefulSet.
func (c *FakeStatefulSets) Apply(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta2.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.StatefulSet), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeStatefulSets) ApplyStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta2.StatefulSet, err error) {
if statefulSet == nil {
return nil, fmt.Errorf("statefulSet provided to Apply must not be nil")
}
data, err := json.Marshal(statefulSet)
if err != nil {
return nil, err
}
name := statefulSet.Name
if name == nil {
return nil, fmt.Errorf("statefulSet.Name must be provided to Apply")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta2.StatefulSet{})
if obj == nil {
return nil, err
}
return obj.(*v1beta2.StatefulSet), err
}
// GetScale takes name of the statefulSet, and returns the corresponding scale object, and an error if there is any.
func (c *FakeStatefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) {
obj, err := c.Fake.

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
autoscalingv1 "k8s.io/api/autoscaling/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsautoscalingv1 "k8s.io/client-go/applyconfigurations/autoscaling/v1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, p
}
return obj.(*autoscalingv1.HorizontalPodAutoscaler), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) Apply(ctx context.Context, horizontalPodAutoscaler *applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &autoscalingv1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscalingv1.HorizontalPodAutoscaler), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeHorizontalPodAutoscalers) ApplyStatus(ctx context.Context, horizontalPodAutoscaler *applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.HorizontalPodAutoscaler, err error) {
if horizontalPodAutoscaler == nil {
return nil, fmt.Errorf("horizontalPodAutoscaler provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &autoscalingv1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*autoscalingv1.HorizontalPodAutoscaler), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v2beta1 "k8s.io/api/autoscaling/v2beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
autoscalingv2beta1 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, p
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeHorizontalPodAutoscalers) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta1.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*v2beta1.HorizontalPodAutoscaler), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v2beta2 "k8s.io/api/autoscaling/v2beta2"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
autoscalingv2beta2 "k8s.io/client-go/applyconfigurations/autoscaling/v2beta2"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeHorizontalPodAutoscalers) Patch(ctx context.Context, name string, p
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied horizontalPodAutoscaler.
func (c *FakeHorizontalPodAutoscalers) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data), &v2beta2.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeHorizontalPodAutoscalers) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v2beta2.HorizontalPodAutoscaler{})
if obj == nil {
return nil, err
}
return obj.(*v2beta2.HorizontalPodAutoscaler), err
}

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

@@ -28,6 +28,10 @@ type FakeBatchV1 struct {
*testing.Fake
}
func (c *FakeBatchV1) CronJobs(namespace string) v1.CronJobInterface {
return &FakeCronJobs{c, namespace}
}
func (c *FakeBatchV1) Jobs(namespace string) v1.JobInterface {
return &FakeJobs{c, namespace}
}

View File

@@ -20,41 +20,44 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v2alpha1 "k8s.io/api/batch/v2alpha1"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
testing "k8s.io/client-go/testing"
)
// FakeCronJobs implements CronJobInterface
type FakeCronJobs struct {
Fake *FakeBatchV2alpha1
Fake *FakeBatchV1
ns string
}
var cronjobsResource = schema.GroupVersionResource{Group: "batch", Version: "v2alpha1", Resource: "cronjobs"}
var cronjobsResource = schema.GroupVersionResource{Group: "batch", Version: "v1", Resource: "cronjobs"}
var cronjobsKind = schema.GroupVersionKind{Group: "batch", Version: "v2alpha1", Kind: "CronJob"}
var cronjobsKind = schema.GroupVersionKind{Group: "batch", Version: "v1", Kind: "CronJob"}
// Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any.
func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.CronJob, err error) {
func (c *FakeCronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *batchv1.CronJob, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{})
Invokes(testing.NewGetAction(cronjobsResource, c.ns, name), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v2alpha1.CronJob), err
return obj.(*batchv1.CronJob), err
}
// List takes label and field selectors, and returns the list of CronJobs that match those selectors.
func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) {
func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *batchv1.CronJobList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &v2alpha1.CronJobList{})
Invokes(testing.NewListAction(cronjobsResource, cronjobsKind, c.ns, opts), &batchv1.CronJobList{})
if obj == nil {
return nil, err
@@ -64,8 +67,8 @@ func (c *FakeCronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v
if label == nil {
label = labels.Everything()
}
list := &v2alpha1.CronJobList{ListMeta: obj.(*v2alpha1.CronJobList).ListMeta}
for _, item := range obj.(*v2alpha1.CronJobList).Items {
list := &batchv1.CronJobList{ListMeta: obj.(*batchv1.CronJobList).ListMeta}
for _, item := range obj.(*batchv1.CronJobList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@@ -81,43 +84,43 @@ func (c *FakeCronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.In
}
// 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 *FakeCronJobs) Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (result *v2alpha1.CronJob, err error) {
func (c *FakeCronJobs) Create(ctx context.Context, cronJob *batchv1.CronJob, opts v1.CreateOptions) (result *batchv1.CronJob, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &v2alpha1.CronJob{})
Invokes(testing.NewCreateAction(cronjobsResource, c.ns, cronJob), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v2alpha1.CronJob), err
return obj.(*batchv1.CronJob), err
}
// 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 *FakeCronJobs) Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (result *v2alpha1.CronJob, err error) {
func (c *FakeCronJobs) Update(ctx context.Context, cronJob *batchv1.CronJob, opts v1.UpdateOptions) (result *batchv1.CronJob, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &v2alpha1.CronJob{})
Invokes(testing.NewUpdateAction(cronjobsResource, c.ns, cronJob), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v2alpha1.CronJob), err
return obj.(*batchv1.CronJob), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error) {
func (c *FakeCronJobs) UpdateStatus(ctx context.Context, cronJob *batchv1.CronJob, opts v1.UpdateOptions) (*batchv1.CronJob, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &v2alpha1.CronJob{})
Invokes(testing.NewUpdateSubresourceAction(cronjobsResource, "status", c.ns, cronJob), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v2alpha1.CronJob), err
return obj.(*batchv1.CronJob), err
}
// Delete takes name of the cronJob and deletes it. Returns an error if one occurs.
func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &v2alpha1.CronJob{})
Invokes(testing.NewDeleteAction(cronjobsResource, c.ns, name), &batchv1.CronJob{})
return err
}
@@ -126,17 +129,62 @@ func (c *FakeCronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOp
func (c *FakeCronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(cronjobsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &v2alpha1.CronJobList{})
_, err := c.Fake.Invokes(action, &batchv1.CronJobList{})
return err
}
// Patch applies the patch and returns the patched cronJob.
func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error) {
func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *batchv1.CronJob, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &v2alpha1.CronJob{})
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, pt, data, subresources...), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v2alpha1.CronJob), err
return obj.(*batchv1.CronJob), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob.
func (c *FakeCronJobs) Apply(ctx context.Context, cronJob *applyconfigurationsbatchv1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*batchv1.CronJob), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeCronJobs) ApplyStatus(ctx context.Context, cronJob *applyconfigurationsbatchv1.CronJobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.CronJob, err error) {
if cronJob == nil {
return nil, fmt.Errorf("cronJob provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &batchv1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*batchv1.CronJob), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
batchv1 "k8s.io/api/batch/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationsbatchv1 "k8s.io/client-go/applyconfigurations/batch/v1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeJobs) Patch(ctx context.Context, name string, pt types.PatchType, d
}
return obj.(*batchv1.Job), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied job.
func (c *FakeJobs) Apply(ctx context.Context, job *applyconfigurationsbatchv1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data), &batchv1.Job{})
if obj == nil {
return nil, err
}
return obj.(*batchv1.Job), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeJobs) ApplyStatus(ctx context.Context, job *applyconfigurationsbatchv1.JobApplyConfiguration, opts v1.ApplyOptions) (result *batchv1.Job, err error) {
if job == nil {
return nil, fmt.Errorf("job provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &batchv1.Job{})
if obj == nil {
return nil, err
}
return obj.(*batchv1.Job), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/batch/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
batchv1beta1 "k8s.io/client-go/applyconfigurations/batch/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchTyp
}
return obj.(*v1beta1.CronJob), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied cronJob.
func (c *FakeCronJobs) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CronJob), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeCronJobs) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.CronJob{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CronJob), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
certificatesv1 "k8s.io/api/certificates/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscertificatesv1 "k8s.io/client-go/applyconfigurations/certificates/v1"
testing "k8s.io/client-go/testing"
)
@@ -132,6 +135,49 @@ func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string,
return obj.(*certificatesv1.CertificateSigningRequest), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest.
func (c *FakeCertificateSigningRequests) Apply(ctx context.Context, certificateSigningRequest *applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *certificatesv1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &certificatesv1.CertificateSigningRequest{})
if obj == nil {
return nil, err
}
return obj.(*certificatesv1.CertificateSigningRequest), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeCertificateSigningRequests) ApplyStatus(ctx context.Context, certificateSigningRequest *applyconfigurationscertificatesv1.CertificateSigningRequestApplyConfiguration, opts v1.ApplyOptions) (result *certificatesv1.CertificateSigningRequest, err error) {
if certificateSigningRequest == nil {
return nil, fmt.Errorf("certificateSigningRequest provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &certificatesv1.CertificateSigningRequest{})
if obj == nil {
return nil, err
}
return obj.(*certificatesv1.CertificateSigningRequest), err
}
// UpdateApproval takes 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 *FakeCertificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts v1.UpdateOptions) (result *certificatesv1.CertificateSigningRequest, err error) {
obj, err := c.Fake.

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/certificates/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
certificatesv1beta1 "k8s.io/client-go/applyconfigurations/certificates/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -131,3 +134,46 @@ func (c *FakeCertificateSigningRequests) Patch(ctx context.Context, name string,
}
return obj.(*v1beta1.CertificateSigningRequest), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied certificateSigningRequest.
func (c *FakeCertificateSigningRequests) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data), &v1beta1.CertificateSigningRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CertificateSigningRequest), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeCertificateSigningRequests) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, *name, types.ApplyPatchType, data, "status"), &v1beta1.CertificateSigningRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.CertificateSigningRequest), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
coordinationv1 "k8s.io/api/coordination/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscoordinationv1 "k8s.io/client-go/applyconfigurations/coordination/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType,
}
return obj.(*coordinationv1.Lease), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied lease.
func (c *FakeLeases) Apply(ctx context.Context, lease *applyconfigurationscoordinationv1.LeaseApplyConfiguration, opts v1.ApplyOptions) (result *coordinationv1.Lease, err error) {
if lease == nil {
return nil, fmt.Errorf("lease provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &coordinationv1.Lease{})
if obj == nil {
return nil, err
}
return obj.(*coordinationv1.Lease), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
v1beta1 "k8s.io/api/coordination/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
coordinationv1beta1 "k8s.io/client-go/applyconfigurations/coordination/v1beta1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType,
}
return obj.(*v1beta1.Lease), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied lease.
func (c *FakeLeases) 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")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Lease{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Lease), err
}

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,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -120,3 +123,24 @@ func (c *FakeComponentStatuses) Patch(ctx context.Context, name string, pt types
}
return obj.(*corev1.ComponentStatus), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied componentStatus.
func (c *FakeComponentStatuses) Apply(ctx context.Context, componentStatus *applyconfigurationscorev1.ComponentStatusApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ComponentStatus, err error) {
if componentStatus == nil {
return nil, fmt.Errorf("componentStatus provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, *name, types.ApplyPatchType, data), &corev1.ComponentStatus{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ComponentStatus), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchT
}
return obj.(*corev1.ConfigMap), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied configMap.
func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *applyconfigurationscorev1.ConfigMapApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ConfigMap, err error) {
if configMap == nil {
return nil, fmt.Errorf("configMap provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.ConfigMap{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ConfigMap), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeEndpoints) Patch(ctx context.Context, name string, pt types.PatchTy
}
return obj.(*corev1.Endpoints), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied endpoints.
func (c *FakeEndpoints) Apply(ctx context.Context, endpoints *applyconfigurationscorev1.EndpointsApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Endpoints, err error) {
if endpoints == nil {
return nil, fmt.Errorf("endpoints provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Endpoints{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Endpoints), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType,
}
return obj.(*corev1.Event), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
func (c *FakeEvents) Apply(ctx context.Context, event *applyconfigurationscorev1.EventApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Event, err error) {
if event == nil {
return nil, fmt.Errorf("event provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Event{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Event), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeLimitRanges) Patch(ctx context.Context, name string, pt types.Patch
}
return obj.(*corev1.LimitRange), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied limitRange.
func (c *FakeLimitRanges) Apply(ctx context.Context, limitRange *applyconfigurationscorev1.LimitRangeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.LimitRange, err error) {
if limitRange == nil {
return nil, fmt.Errorf("limitRange provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, *name, types.ApplyPatchType, data), &corev1.LimitRange{})
if obj == nil {
return nil, err
}
return obj.(*corev1.LimitRange), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -123,3 +126,46 @@ func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchT
}
return obj.(*corev1.Namespace), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied namespace.
func (c *FakeNamespaces) Apply(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Namespace, err error) {
if namespace == nil {
return nil, fmt.Errorf("namespace provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), &corev1.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Namespace), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *applyconfigurationscorev1.NamespaceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Namespace, err error) {
if namespace == nil {
return nil, fmt.Errorf("namespace provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), &corev1.Namespace{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Namespace), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -131,3 +134,46 @@ func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType,
}
return obj.(*corev1.Node), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied node.
func (c *FakeNodes) Apply(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Node, err error) {
if node == nil {
return nil, fmt.Errorf("node provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data), &corev1.Node{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Node), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeNodes) ApplyStatus(ctx context.Context, node *applyconfigurationscorev1.NodeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Node, err error) {
if node == nil {
return nil, fmt.Errorf("node provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(nodesResource, *name, types.ApplyPatchType, data, "status"), &corev1.Node{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Node), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -131,3 +134,46 @@ func (c *FakePersistentVolumes) Patch(ctx context.Context, name string, pt types
}
return obj.(*corev1.PersistentVolume), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolume.
func (c *FakePersistentVolumes) Apply(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolume, err error) {
if persistentVolume == nil {
return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data), &corev1.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PersistentVolume), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakePersistentVolumes) ApplyStatus(ctx context.Context, persistentVolume *applyconfigurationscorev1.PersistentVolumeApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolume, err error) {
if persistentVolume == nil {
return nil, fmt.Errorf("persistentVolume provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolume{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PersistentVolume), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakePersistentVolumeClaims) Patch(ctx context.Context, name string, pt
}
return obj.(*corev1.PersistentVolumeClaim), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied persistentVolumeClaim.
func (c *FakePersistentVolumeClaims) Apply(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) {
if persistentVolumeClaim == nil {
return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PersistentVolumeClaim), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakePersistentVolumeClaims) ApplyStatus(ctx context.Context, persistentVolumeClaim *applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PersistentVolumeClaim, err error) {
if persistentVolumeClaim == nil {
return nil, fmt.Errorf("persistentVolumeClaim provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolumeClaim{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PersistentVolumeClaim), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -141,6 +144,51 @@ func (c *FakePods) Patch(ctx context.Context, name string, pt types.PatchType, d
return obj.(*corev1.Pod), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied pod.
func (c *FakePods) Apply(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Pod, err error) {
if pod == nil {
return nil, fmt.Errorf("pod provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Pod{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Pod), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakePods) ApplyStatus(ctx context.Context, pod *applyconfigurationscorev1.PodApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Pod, err error) {
if pod == nil {
return nil, fmt.Errorf("pod provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.Pod{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Pod), err
}
// GetEphemeralContainers takes name of the pod, and returns the corresponding ephemeralContainers object, and an error if there is any.
func (c *FakePods) GetEphemeralContainers(ctx context.Context, podName string, options v1.GetOptions) (result *corev1.EphemeralContainers, err error) {
obj, err := c.Fake.

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakePodTemplates) Patch(ctx context.Context, name string, pt types.Patc
}
return obj.(*corev1.PodTemplate), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied podTemplate.
func (c *FakePodTemplates) Apply(ctx context.Context, podTemplate *applyconfigurationscorev1.PodTemplateApplyConfiguration, opts v1.ApplyOptions) (result *corev1.PodTemplate, err error) {
if podTemplate == nil {
return nil, fmt.Errorf("podTemplate provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, *name, types.ApplyPatchType, data), &corev1.PodTemplate{})
if obj == nil {
return nil, err
}
return obj.(*corev1.PodTemplate), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
autoscalingv1 "k8s.io/api/autoscaling/v1"
corev1 "k8s.io/api/core/v1"
@@ -28,6 +30,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -142,6 +145,51 @@ func (c *FakeReplicationControllers) Patch(ctx context.Context, name string, pt
return obj.(*corev1.ReplicationController), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied replicationController.
func (c *FakeReplicationControllers) Apply(ctx context.Context, replicationController *applyconfigurationscorev1.ReplicationControllerApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ReplicationController, err error) {
if replicationController == nil {
return nil, fmt.Errorf("replicationController provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data), &corev1.ReplicationController{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ReplicationController), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeReplicationControllers) ApplyStatus(ctx context.Context, replicationController *applyconfigurationscorev1.ReplicationControllerApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ReplicationController, err error) {
if replicationController == nil {
return nil, fmt.Errorf("replicationController provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.ReplicationController{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ReplicationController), err
}
// GetScale takes name of the replicationController, and returns the corresponding scale object, and an error if there is any.
func (c *FakeReplicationControllers) GetScale(ctx context.Context, replicationControllerName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) {
obj, err := c.Fake.

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -140,3 +143,48 @@ func (c *FakeResourceQuotas) Patch(ctx context.Context, name string, pt types.Pa
}
return obj.(*corev1.ResourceQuota), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied resourceQuota.
func (c *FakeResourceQuotas) Apply(ctx context.Context, resourceQuota *applyconfigurationscorev1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ResourceQuota, err error) {
if resourceQuota == nil {
return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data), &corev1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ResourceQuota), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeResourceQuotas) ApplyStatus(ctx context.Context, resourceQuota *applyconfigurationscorev1.ResourceQuotaApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ResourceQuota, err error) {
if resourceQuota == nil {
return nil, fmt.Errorf("resourceQuota provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ResourceQuota), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -128,3 +131,25 @@ func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType
}
return obj.(*corev1.Secret), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied secret.
func (c *FakeSecrets) Apply(ctx context.Context, secret *applyconfigurationscorev1.SecretApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Secret, err error) {
if secret == nil {
return nil, fmt.Errorf("secret provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Secret{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Secret), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -27,6 +29,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -132,3 +135,48 @@ func (c *FakeServices) Patch(ctx context.Context, name string, pt types.PatchTyp
}
return obj.(*corev1.Service), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied service.
func (c *FakeServices) Apply(ctx context.Context, service *applyconfigurationscorev1.ServiceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Service, err error) {
if service == nil {
return nil, fmt.Errorf("service provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data), &corev1.Service{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Service), err
}
// ApplyStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
func (c *FakeServices) ApplyStatus(ctx context.Context, service *applyconfigurationscorev1.ServiceApplyConfiguration, opts v1.ApplyOptions) (result *corev1.Service, err error) {
if service == nil {
return nil, fmt.Errorf("service provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &corev1.Service{})
if obj == nil {
return nil, err
}
return obj.(*corev1.Service), err
}

View File

@@ -20,6 +20,8 @@ package fake
import (
"context"
json "encoding/json"
"fmt"
authenticationv1 "k8s.io/api/authentication/v1"
corev1 "k8s.io/api/core/v1"
@@ -28,6 +30,7 @@ import (
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
applyconfigurationscorev1 "k8s.io/client-go/applyconfigurations/core/v1"
testing "k8s.io/client-go/testing"
)
@@ -130,6 +133,28 @@ func (c *FakeServiceAccounts) Patch(ctx context.Context, name string, pt types.P
return obj.(*corev1.ServiceAccount), err
}
// Apply takes the given apply declarative configuration, applies it and returns the applied serviceAccount.
func (c *FakeServiceAccounts) Apply(ctx context.Context, serviceAccount *applyconfigurationscorev1.ServiceAccountApplyConfiguration, opts v1.ApplyOptions) (result *corev1.ServiceAccount, err error) {
if serviceAccount == nil {
return nil, fmt.Errorf("serviceAccount provided to Apply must not be nil")
}
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")
}
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, *name, types.ApplyPatchType, data), &corev1.ServiceAccount{})
if obj == nil {
return nil, err
}
return obj.(*corev1.ServiceAccount), err
}
// 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 *FakeServiceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts v1.CreateOptions) (result *authenticationv1.TokenRequest, err error) {
obj, err := c.Fake.

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

@@ -19,22 +19,22 @@ limitations under the License.
package fake
import (
v1alpha1 "k8s.io/client-go/kubernetes/typed/discovery/v1alpha1"
v1 "k8s.io/client-go/kubernetes/typed/discovery/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeDiscoveryV1alpha1 struct {
type FakeDiscoveryV1 struct {
*testing.Fake
}
func (c *FakeDiscoveryV1alpha1) EndpointSlices(namespace string) v1alpha1.EndpointSliceInterface {
func (c *FakeDiscoveryV1) EndpointSlices(namespace string) v1.EndpointSliceInterface {
return &FakeEndpointSlices{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeDiscoveryV1alpha1) RESTClient() rest.Interface {
func (c *FakeDiscoveryV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

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