mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-26 23:17:34 +00:00
Merge pull request #99214 from jpbetz/apply-client-go-builders2-typedclient
Add Apply to client-go's typed client Kubernetes-commit: e688f22da07465a88728210412470e14330f1563
This commit is contained in:
commit
fa8f4cc307
2
Godeps/Godeps.json
generated
2
Godeps/Godeps.json
generated
@ -472,7 +472,7 @@
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/apimachinery",
|
||||
"Rev": "283a3268598b"
|
||||
"Rev": "543ebb56644a"
|
||||
},
|
||||
{
|
||||
"ImportPath": "k8s.io/gengo",
|
||||
|
4
go.mod
4
go.mod
@ -28,7 +28,7 @@ require (
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
|
||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
|
||||
k8s.io/api v0.0.0-20210307052319-8e35c5077a13
|
||||
k8s.io/apimachinery v0.0.0-20210306132128-283a3268598b
|
||||
k8s.io/apimachinery v0.0.0-20210307091931-543ebb56644a
|
||||
k8s.io/klog/v2 v2.5.0
|
||||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920
|
||||
sigs.k8s.io/yaml v1.2.0
|
||||
@ -36,5 +36,5 @@ require (
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20210307052319-8e35c5077a13
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210306132128-283a3268598b
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210307091931-543ebb56644a
|
||||
)
|
||||
|
2
go.sum
2
go.sum
@ -427,7 +427,7 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.0.0-20210307052319-8e35c5077a13/go.mod h1:oXIlxI7P0Fm+wAl92K966U84hJ8jYH+vvhPMIFggXJQ=
|
||||
k8s.io/apimachinery v0.0.0-20210306132128-283a3268598b/go.mod h1:2LERmYT9PI3b4uQt87vnb2UVkblBDzZhucIf8PxvJ2o=
|
||||
k8s.io/apimachinery v0.0.0-20210307091931-543ebb56644a/go.mod h1:2LERmYT9PI3b4uQt87vnb2UVkblBDzZhucIf8PxvJ2o=
|
||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
|
||||
k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI=
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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{}
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 CronJobInterface interface {
|
||||
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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
@ -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 *FakeCronJobs) Patch(ctx context.Context, name string, pt types.PatchTyp
|
||||
}
|
||||
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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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{}
|
||||
|
@ -20,12 +20,15 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
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"
|
||||
)
|
||||
@ -46,6 +49,7 @@ type EndpointSliceInterface interface {
|
||||
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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
discoveryv1 "k8s.io/api/discovery/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"
|
||||
applyconfigurationsdiscoveryv1 "k8s.io/client-go/applyconfigurations/discovery/v1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
@ -128,3 +131,25 @@ func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.Pa
|
||||
}
|
||||
return obj.(*discoveryv1.EndpointSlice), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice.
|
||||
func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *applyconfigurationsdiscoveryv1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *discoveryv1.EndpointSlice, err error) {
|
||||
if endpointSlice == nil {
|
||||
return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil")
|
||||
}
|
||||
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")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), &discoveryv1.EndpointSlice{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*discoveryv1.EndpointSlice), err
|
||||
}
|
||||
|
@ -20,12 +20,15 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1beta1 "k8s.io/api/discovery/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
@ -46,6 +49,7 @@ type EndpointSliceInterface interface {
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error)
|
||||
Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error)
|
||||
EndpointSliceExpansion
|
||||
}
|
||||
|
||||
@ -176,3 +180,29 @@ func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchT
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice.
|
||||
func (c *endpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) {
|
||||
if endpointSlice == nil {
|
||||
return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(endpointSlice)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := endpointSlice.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("endpointSlice.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1beta1.EndpointSlice{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("endpointslices").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/discovery/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"
|
||||
discoveryv1beta1 "k8s.io/client-go/applyconfigurations/discovery/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
@ -128,3 +131,25 @@ func (c *FakeEndpointSlices) Patch(ctx context.Context, name string, pt types.Pa
|
||||
}
|
||||
return obj.(*v1beta1.EndpointSlice), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied endpointSlice.
|
||||
func (c *FakeEndpointSlices) Apply(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSliceApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.EndpointSlice, err error) {
|
||||
if endpointSlice == nil {
|
||||
return nil, fmt.Errorf("endpointSlice provided to Apply must not be nil")
|
||||
}
|
||||
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")
|
||||
}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(endpointslicesResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.EndpointSlice{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta1.EndpointSlice), err
|
||||
}
|
||||
|
@ -20,12 +20,15 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/api/events/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
eventsv1 "k8s.io/client-go/applyconfigurations/events/v1"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
@ -46,6 +49,7 @@ type EventInterface interface {
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error)
|
||||
Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error)
|
||||
EventExpansion
|
||||
}
|
||||
|
||||
@ -176,3 +180,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
|
||||
func (c *events) Apply(ctx context.Context, event *eventsv1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) {
|
||||
if event == nil {
|
||||
return nil, fmt.Errorf("event provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := event.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("event.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.Event{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
eventsv1 "k8s.io/api/events/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"
|
||||
applyconfigurationseventsv1 "k8s.io/client-go/applyconfigurations/events/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.(*eventsv1.Event), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
|
||||
func (c *FakeEvents) Apply(ctx context.Context, event *applyconfigurationseventsv1.EventApplyConfiguration, opts v1.ApplyOptions) (result *eventsv1.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), &eventsv1.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*eventsv1.Event), err
|
||||
}
|
||||
|
@ -20,12 +20,15 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1beta1 "k8s.io/api/events/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
@ -46,6 +49,7 @@ type EventInterface interface {
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error)
|
||||
Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error)
|
||||
EventExpansion
|
||||
}
|
||||
|
||||
@ -176,3 +180,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
|
||||
func (c *events) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) {
|
||||
if event == nil {
|
||||
return nil, fmt.Errorf("event provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(event)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := event.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("event.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1beta1.Event{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
@ -20,6 +20,8 @@ package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
|
||||
v1beta1 "k8s.io/api/events/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"
|
||||
eventsv1beta1 "k8s.io/client-go/applyconfigurations/events/v1beta1"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
@ -128,3 +131,25 @@ func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType,
|
||||
}
|
||||
return obj.(*v1beta1.Event), err
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied event.
|
||||
func (c *FakeEvents) Apply(ctx context.Context, event *eventsv1beta1.EventApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Event, err error) {
|
||||
if event == nil {
|
||||
return nil, fmt.Errorf("event provided to Apply must not be nil")
|
||||
}
|
||||
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), &v1beta1.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v1beta1.Event), err
|
||||
}
|
||||
|
@ -20,12 +20,15 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1beta1 "k8s.io/api/extensions/v1beta1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
extensionsv1beta1 "k8s.io/client-go/applyconfigurations/extensions/v1beta1"
|
||||
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
@ -47,6 +50,8 @@ type DaemonSetInterface interface {
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error)
|
||||
Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error)
|
||||
ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error)
|
||||
DaemonSetExpansion
|
||||
}
|
||||
|
||||
@ -193,3 +198,59 @@ func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType,
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied daemonSet.
|
||||
func (c *daemonSets) Apply(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1beta1.DaemonSet{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// ApplyStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
func (c *daemonSets) ApplyStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.DaemonSet, err error) {
|
||||
if daemonSet == nil {
|
||||
return nil, fmt.Errorf("daemonSet provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(daemonSet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := daemonSet.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("daemonSet.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1beta1.DaemonSet{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user