Use typed rate limiting queue (#3028)
* Use typed rate limiting queue * update skaffold version * Update code-generator to 1.31 --------- Signed-off-by: Sanket <sanketsudake@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ limitations under the License.
|
||||
package fake
|
||||
|
||||
import (
|
||||
applyconfiguration "github.com/fission/fission/pkg/generated/applyconfiguration"
|
||||
clientset "github.com/fission/fission/pkg/generated/clientset/versioned"
|
||||
corev1 "github.com/fission/fission/pkg/generated/clientset/versioned/typed/core/v1"
|
||||
fakecorev1 "github.com/fission/fission/pkg/generated/clientset/versioned/typed/core/v1/fake"
|
||||
@@ -31,8 +32,12 @@ import (
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
|
||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
|
||||
// without applying any field management, validations and/or defaults. It shouldn't be considered a replacement
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
//
|
||||
// DEPRECATED: NewClientset replaces this with support for field management, which significantly improves
|
||||
// server side apply testing. NewClientset is only available when apply configurations are generated (e.g.
|
||||
// via --with-applyconfig).
|
||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||
for _, obj := range objects {
|
||||
@@ -74,6 +79,38 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
|
||||
return c.tracker
|
||||
}
|
||||
|
||||
// NewClientset returns a clientset that will respond with the provided objects.
|
||||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
|
||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
func NewClientset(objects ...runtime.Object) *Clientset {
|
||||
o := testing.NewFieldManagedObjectTracker(
|
||||
scheme,
|
||||
codecs.UniversalDecoder(),
|
||||
applyconfiguration.NewTypeConverter(scheme),
|
||||
)
|
||||
for _, obj := range objects {
|
||||
if err := o.Add(obj); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
cs := &Clientset{tracker: o}
|
||||
cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake}
|
||||
cs.AddReactor("*", "*", testing.ObjectReaction(o))
|
||||
cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) {
|
||||
gvr := action.GetResource()
|
||||
ns := action.GetNamespace()
|
||||
watch, err := o.Watch(gvr, ns)
|
||||
if err != nil {
|
||||
return false, nil, err
|
||||
}
|
||||
return true, watch, nil
|
||||
})
|
||||
|
||||
return cs
|
||||
}
|
||||
|
||||
var (
|
||||
_ clientset.Interface = &Clientset{}
|
||||
_ testing.FakeClient = &Clientset{}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// CanaryConfigsGetter has a method to return a CanaryConfigInterface.
|
||||
@@ -43,6 +40,7 @@ type CanaryConfigsGetter interface {
|
||||
type CanaryConfigInterface interface {
|
||||
Create(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.CreateOptions) (*v1.CanaryConfig, error)
|
||||
Update(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (*v1.CanaryConfig, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (*v1.CanaryConfig, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
@@ -51,206 +49,25 @@ type CanaryConfigInterface interface {
|
||||
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.CanaryConfig, err error)
|
||||
Apply(ctx context.Context, _canaryConfig *corev1.CanaryConfigApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CanaryConfig, err error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
ApplyStatus(ctx context.Context, _canaryConfig *corev1.CanaryConfigApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CanaryConfig, err error)
|
||||
CanaryConfigExpansion
|
||||
}
|
||||
|
||||
// canaryConfigs implements CanaryConfigInterface
|
||||
type canaryConfigs struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.CanaryConfig, *v1.CanaryConfigList, *corev1.CanaryConfigApplyConfiguration]
|
||||
}
|
||||
|
||||
// newCanaryConfigs returns a CanaryConfigs
|
||||
func newCanaryConfigs(c *CoreV1Client, namespace string) *canaryConfigs {
|
||||
return &canaryConfigs{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.CanaryConfig, *v1.CanaryConfigList, *corev1.CanaryConfigApplyConfiguration](
|
||||
"canaryconfigs",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.CanaryConfig { return &v1.CanaryConfig{} },
|
||||
func() *v1.CanaryConfigList { return &v1.CanaryConfigList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _canaryConfig, and returns the corresponding canaryConfig object, and an error if there is any.
|
||||
func (c *canaryConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CanaryConfig, err error) {
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of CanaryConfigs that match those selectors.
|
||||
func (c *canaryConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CanaryConfigList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.CanaryConfigList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested canaryConfigs.
|
||||
func (c *canaryConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _canaryConfig and creates it. Returns the server's representation of the canaryConfig, and an error, if there is any.
|
||||
func (c *canaryConfigs) Create(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.CreateOptions) (result *v1.CanaryConfig, err error) {
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_canaryConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _canaryConfig and updates it. Returns the server's representation of the canaryConfig, and an error, if there is any.
|
||||
func (c *canaryConfigs) Update(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (result *v1.CanaryConfig, err error) {
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(_canaryConfig.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_canaryConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *canaryConfigs) UpdateStatus(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (result *v1.CanaryConfig, err error) {
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(_canaryConfig.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_canaryConfig).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _canaryConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *canaryConfigs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *canaryConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched canaryConfig.
|
||||
func (c *canaryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CanaryConfig, err error) {
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied canaryConfig.
|
||||
func (c *canaryConfigs) Apply(ctx context.Context, _canaryConfig *corev1.CanaryConfigApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CanaryConfig, err error) {
|
||||
if _canaryConfig == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_canaryConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _canaryConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
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 *canaryConfigs) ApplyStatus(ctx context.Context, _canaryConfig *corev1.CanaryConfigApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CanaryConfig, err error) {
|
||||
if _canaryConfig == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_canaryConfig)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := _canaryConfig.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1.CanaryConfig{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("canaryconfigs").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// EnvironmentsGetter has a method to return a EnvironmentInterface.
|
||||
@@ -55,154 +52,18 @@ type EnvironmentInterface interface {
|
||||
|
||||
// environments implements EnvironmentInterface
|
||||
type environments struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.Environment, *v1.EnvironmentList, *corev1.EnvironmentApplyConfiguration]
|
||||
}
|
||||
|
||||
// newEnvironments returns a Environments
|
||||
func newEnvironments(c *CoreV1Client, namespace string) *environments {
|
||||
return &environments{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.Environment, *v1.EnvironmentList, *corev1.EnvironmentApplyConfiguration](
|
||||
"environments",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.Environment { return &v1.Environment{} },
|
||||
func() *v1.EnvironmentList { return &v1.EnvironmentList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _environment, and returns the corresponding environment object, and an error if there is any.
|
||||
func (c *environments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Environment, err error) {
|
||||
result = &v1.Environment{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Environments that match those selectors.
|
||||
func (c *environments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EnvironmentList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.EnvironmentList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested environments.
|
||||
func (c *environments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _environment and creates it. Returns the server's representation of the environment, and an error, if there is any.
|
||||
func (c *environments) Create(ctx context.Context, _environment *v1.Environment, opts metav1.CreateOptions) (result *v1.Environment, err error) {
|
||||
result = &v1.Environment{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_environment).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _environment and updates it. Returns the server's representation of the environment, and an error, if there is any.
|
||||
func (c *environments) Update(ctx context.Context, _environment *v1.Environment, opts metav1.UpdateOptions) (result *v1.Environment, err error) {
|
||||
result = &v1.Environment{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
Name(_environment.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_environment).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _environment and deletes it. Returns an error if one occurs.
|
||||
func (c *environments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *environments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched environment.
|
||||
func (c *environments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Environment, err error) {
|
||||
result = &v1.Environment{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied environment.
|
||||
func (c *environments) Apply(ctx context.Context, _environment *corev1.EnvironmentApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Environment, err error) {
|
||||
if _environment == nil {
|
||||
return nil, fmt.Errorf("_environment provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_environment)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _environment.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_environment.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.Environment{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("environments").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var canaryconfigsKind = v1.SchemeGroupVersion.WithKind("CanaryConfig")
|
||||
|
||||
// Get takes name of the _canaryConfig, and returns the corresponding canaryConfig object, and an error if there is any.
|
||||
func (c *FakeCanaryConfigs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CanaryConfig, err error) {
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(canaryconfigsResource, c.ns, name), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewGetActionWithOptions(canaryconfigsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of CanaryConfigs that match those selectors.
|
||||
func (c *FakeCanaryConfigs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CanaryConfigList, err error) {
|
||||
emptyResult := &v1.CanaryConfigList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(canaryconfigsResource, canaryconfigsKind, c.ns, opts), &v1.CanaryConfigList{})
|
||||
Invokes(testing.NewListActionWithOptions(canaryconfigsResource, canaryconfigsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,40 +80,43 @@ func (c *FakeCanaryConfigs) List(ctx context.Context, opts metav1.ListOptions) (
|
||||
// Watch returns a watch.Interface that watches the requested canaryConfigs.
|
||||
func (c *FakeCanaryConfigs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(canaryconfigsResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(canaryconfigsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _canaryConfig and creates it. Returns the server's representation of the canaryConfig, and an error, if there is any.
|
||||
func (c *FakeCanaryConfigs) Create(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.CreateOptions) (result *v1.CanaryConfig, err error) {
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(canaryconfigsResource, c.ns, _canaryConfig), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewCreateActionWithOptions(canaryconfigsResource, c.ns, _canaryConfig, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _canaryConfig and updates it. Returns the server's representation of the canaryConfig, and an error, if there is any.
|
||||
func (c *FakeCanaryConfigs) Update(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (result *v1.CanaryConfig, err error) {
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(canaryconfigsResource, c.ns, _canaryConfig), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(canaryconfigsResource, c.ns, _canaryConfig, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakeCanaryConfigs) UpdateStatus(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (*v1.CanaryConfig, error) {
|
||||
func (c *FakeCanaryConfigs) UpdateStatus(ctx context.Context, _canaryConfig *v1.CanaryConfig, opts metav1.UpdateOptions) (result *v1.CanaryConfig, err error) {
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(canaryconfigsResource, "status", c.ns, _canaryConfig), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(canaryconfigsResource, "status", c.ns, _canaryConfig, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
@@ -126,7 +131,7 @@ func (c *FakeCanaryConfigs) Delete(ctx context.Context, name string, opts metav1
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeCanaryConfigs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(canaryconfigsResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(canaryconfigsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.CanaryConfigList{})
|
||||
return err
|
||||
@@ -134,11 +139,12 @@ func (c *FakeCanaryConfigs) DeleteCollection(ctx context.Context, opts metav1.De
|
||||
|
||||
// Patch applies the patch and returns the patched canaryConfig.
|
||||
func (c *FakeCanaryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CanaryConfig, err error) {
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(canaryconfigsResource, c.ns, name, pt, data, subresources...), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(canaryconfigsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
@@ -156,11 +162,12 @@ func (c *FakeCanaryConfigs) Apply(ctx context.Context, _canaryConfig *corev1.Can
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(canaryconfigsResource, c.ns, *name, types.ApplyPatchType, data), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(canaryconfigsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
@@ -179,11 +186,12 @@ func (c *FakeCanaryConfigs) ApplyStatus(ctx context.Context, _canaryConfig *core
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_canaryConfig.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.CanaryConfig{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(canaryconfigsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.CanaryConfig{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(canaryconfigsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.CanaryConfig), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var environmentsKind = v1.SchemeGroupVersion.WithKind("Environment")
|
||||
|
||||
// Get takes name of the _environment, and returns the corresponding environment object, and an error if there is any.
|
||||
func (c *FakeEnvironments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Environment, err error) {
|
||||
emptyResult := &v1.Environment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(environmentsResource, c.ns, name), &v1.Environment{})
|
||||
Invokes(testing.NewGetActionWithOptions(environmentsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Environment), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Environments that match those selectors.
|
||||
func (c *FakeEnvironments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EnvironmentList, err error) {
|
||||
emptyResult := &v1.EnvironmentList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(environmentsResource, environmentsKind, c.ns, opts), &v1.EnvironmentList{})
|
||||
Invokes(testing.NewListActionWithOptions(environmentsResource, environmentsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeEnvironments) List(ctx context.Context, opts metav1.ListOptions) (r
|
||||
// Watch returns a watch.Interface that watches the requested environments.
|
||||
func (c *FakeEnvironments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(environmentsResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(environmentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _environment and creates it. Returns the server's representation of the environment, and an error, if there is any.
|
||||
func (c *FakeEnvironments) Create(ctx context.Context, _environment *v1.Environment, opts metav1.CreateOptions) (result *v1.Environment, err error) {
|
||||
emptyResult := &v1.Environment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(environmentsResource, c.ns, _environment), &v1.Environment{})
|
||||
Invokes(testing.NewCreateActionWithOptions(environmentsResource, c.ns, _environment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Environment), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _environment and updates it. Returns the server's representation of the environment, and an error, if there is any.
|
||||
func (c *FakeEnvironments) Update(ctx context.Context, _environment *v1.Environment, opts metav1.UpdateOptions) (result *v1.Environment, err error) {
|
||||
emptyResult := &v1.Environment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(environmentsResource, c.ns, _environment), &v1.Environment{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(environmentsResource, c.ns, _environment, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Environment), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeEnvironments) Delete(ctx context.Context, name string, opts metav1.
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeEnvironments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(environmentsResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(environmentsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.EnvironmentList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeEnvironments) DeleteCollection(ctx context.Context, opts metav1.Del
|
||||
|
||||
// Patch applies the patch and returns the patched environment.
|
||||
func (c *FakeEnvironments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Environment, err error) {
|
||||
emptyResult := &v1.Environment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(environmentsResource, c.ns, name, pt, data, subresources...), &v1.Environment{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(environmentsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Environment), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeEnvironments) Apply(ctx context.Context, _environment *corev1.Envir
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_environment.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Environment{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(environmentsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Environment{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(environmentsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Environment), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var functionsKind = v1.SchemeGroupVersion.WithKind("Function")
|
||||
|
||||
// Get takes name of the _function, and returns the corresponding function object, and an error if there is any.
|
||||
func (c *FakeFunctions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Function, err error) {
|
||||
emptyResult := &v1.Function{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(functionsResource, c.ns, name), &v1.Function{})
|
||||
Invokes(testing.NewGetActionWithOptions(functionsResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Function), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Functions that match those selectors.
|
||||
func (c *FakeFunctions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FunctionList, err error) {
|
||||
emptyResult := &v1.FunctionList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(functionsResource, functionsKind, c.ns, opts), &v1.FunctionList{})
|
||||
Invokes(testing.NewListActionWithOptions(functionsResource, functionsKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeFunctions) List(ctx context.Context, opts metav1.ListOptions) (resu
|
||||
// Watch returns a watch.Interface that watches the requested functions.
|
||||
func (c *FakeFunctions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(functionsResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(functionsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _function and creates it. Returns the server's representation of the function, and an error, if there is any.
|
||||
func (c *FakeFunctions) Create(ctx context.Context, _function *v1.Function, opts metav1.CreateOptions) (result *v1.Function, err error) {
|
||||
emptyResult := &v1.Function{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(functionsResource, c.ns, _function), &v1.Function{})
|
||||
Invokes(testing.NewCreateActionWithOptions(functionsResource, c.ns, _function, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Function), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _function and updates it. Returns the server's representation of the function, and an error, if there is any.
|
||||
func (c *FakeFunctions) Update(ctx context.Context, _function *v1.Function, opts metav1.UpdateOptions) (result *v1.Function, err error) {
|
||||
emptyResult := &v1.Function{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(functionsResource, c.ns, _function), &v1.Function{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(functionsResource, c.ns, _function, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Function), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeFunctions) Delete(ctx context.Context, name string, opts metav1.Del
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeFunctions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(functionsResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(functionsResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.FunctionList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeFunctions) DeleteCollection(ctx context.Context, opts metav1.Delete
|
||||
|
||||
// Patch applies the patch and returns the patched function.
|
||||
func (c *FakeFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Function, err error) {
|
||||
emptyResult := &v1.Function{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(functionsResource, c.ns, name, pt, data, subresources...), &v1.Function{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(functionsResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Function), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeFunctions) Apply(ctx context.Context, _function *corev1.FunctionApp
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_function.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Function{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(functionsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Function{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(functionsResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Function), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var httptriggersKind = v1.SchemeGroupVersion.WithKind("HTTPTrigger")
|
||||
|
||||
// Get takes name of the _hTTPTrigger, and returns the corresponding hTTPTrigger object, and an error if there is any.
|
||||
func (c *FakeHTTPTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPTrigger, err error) {
|
||||
emptyResult := &v1.HTTPTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(httptriggersResource, c.ns, name), &v1.HTTPTrigger{})
|
||||
Invokes(testing.NewGetActionWithOptions(httptriggersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPTrigger), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of HTTPTriggers that match those selectors.
|
||||
func (c *FakeHTTPTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPTriggerList, err error) {
|
||||
emptyResult := &v1.HTTPTriggerList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(httptriggersResource, httptriggersKind, c.ns, opts), &v1.HTTPTriggerList{})
|
||||
Invokes(testing.NewListActionWithOptions(httptriggersResource, httptriggersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeHTTPTriggers) List(ctx context.Context, opts metav1.ListOptions) (r
|
||||
// Watch returns a watch.Interface that watches the requested hTTPTriggers.
|
||||
func (c *FakeHTTPTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(httptriggersResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(httptriggersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _hTTPTrigger and creates it. Returns the server's representation of the hTTPTrigger, and an error, if there is any.
|
||||
func (c *FakeHTTPTriggers) Create(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.CreateOptions) (result *v1.HTTPTrigger, err error) {
|
||||
emptyResult := &v1.HTTPTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(httptriggersResource, c.ns, _hTTPTrigger), &v1.HTTPTrigger{})
|
||||
Invokes(testing.NewCreateActionWithOptions(httptriggersResource, c.ns, _hTTPTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPTrigger), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _hTTPTrigger and updates it. Returns the server's representation of the hTTPTrigger, and an error, if there is any.
|
||||
func (c *FakeHTTPTriggers) Update(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.UpdateOptions) (result *v1.HTTPTrigger, err error) {
|
||||
emptyResult := &v1.HTTPTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(httptriggersResource, c.ns, _hTTPTrigger), &v1.HTTPTrigger{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(httptriggersResource, c.ns, _hTTPTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPTrigger), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeHTTPTriggers) Delete(ctx context.Context, name string, opts metav1.
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeHTTPTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(httptriggersResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(httptriggersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.HTTPTriggerList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeHTTPTriggers) DeleteCollection(ctx context.Context, opts metav1.Del
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPTrigger.
|
||||
func (c *FakeHTTPTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPTrigger, err error) {
|
||||
emptyResult := &v1.HTTPTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(httptriggersResource, c.ns, name, pt, data, subresources...), &v1.HTTPTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(httptriggersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPTrigger), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeHTTPTriggers) Apply(ctx context.Context, _hTTPTrigger *corev1.HTTPT
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_hTTPTrigger.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.HTTPTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(httptriggersResource, c.ns, *name, types.ApplyPatchType, data), &v1.HTTPTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(httptriggersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.HTTPTrigger), err
|
||||
}
|
||||
|
||||
+20
-14
@@ -44,22 +44,24 @@ var kuberneteswatchtriggersKind = v1.SchemeGroupVersion.WithKind("KubernetesWatc
|
||||
|
||||
// Get takes name of the _kubernetesWatchTrigger, and returns the corresponding kubernetesWatchTrigger object, and an error if there is any.
|
||||
func (c *FakeKubernetesWatchTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
emptyResult := &v1.KubernetesWatchTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(kuberneteswatchtriggersResource, c.ns, name), &v1.KubernetesWatchTrigger{})
|
||||
Invokes(testing.NewGetActionWithOptions(kuberneteswatchtriggersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.KubernetesWatchTrigger), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of KubernetesWatchTriggers that match those selectors.
|
||||
func (c *FakeKubernetesWatchTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KubernetesWatchTriggerList, err error) {
|
||||
emptyResult := &v1.KubernetesWatchTriggerList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(kuberneteswatchtriggersResource, kuberneteswatchtriggersKind, c.ns, opts), &v1.KubernetesWatchTriggerList{})
|
||||
Invokes(testing.NewListActionWithOptions(kuberneteswatchtriggersResource, kuberneteswatchtriggersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeKubernetesWatchTriggers) List(ctx context.Context, opts metav1.List
|
||||
// Watch returns a watch.Interface that watches the requested kubernetesWatchTriggers.
|
||||
func (c *FakeKubernetesWatchTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(kuberneteswatchtriggersResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(kuberneteswatchtriggersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _kubernetesWatchTrigger and creates it. Returns the server's representation of the kubernetesWatchTrigger, and an error, if there is any.
|
||||
func (c *FakeKubernetesWatchTriggers) Create(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.CreateOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
emptyResult := &v1.KubernetesWatchTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger), &v1.KubernetesWatchTrigger{})
|
||||
Invokes(testing.NewCreateActionWithOptions(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.KubernetesWatchTrigger), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _kubernetesWatchTrigger and updates it. Returns the server's representation of the kubernetesWatchTrigger, and an error, if there is any.
|
||||
func (c *FakeKubernetesWatchTriggers) Update(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.UpdateOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
emptyResult := &v1.KubernetesWatchTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger), &v1.KubernetesWatchTrigger{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.KubernetesWatchTrigger), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeKubernetesWatchTriggers) Delete(ctx context.Context, name string, o
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeKubernetesWatchTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(kuberneteswatchtriggersResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(kuberneteswatchtriggersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.KubernetesWatchTriggerList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeKubernetesWatchTriggers) DeleteCollection(ctx context.Context, opts
|
||||
|
||||
// Patch applies the patch and returns the patched kubernetesWatchTrigger.
|
||||
func (c *FakeKubernetesWatchTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
emptyResult := &v1.KubernetesWatchTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(kuberneteswatchtriggersResource, c.ns, name, pt, data, subresources...), &v1.KubernetesWatchTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(kuberneteswatchtriggersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.KubernetesWatchTrigger), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeKubernetesWatchTriggers) Apply(ctx context.Context, _kubernetesWatc
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_kubernetesWatchTrigger.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.KubernetesWatchTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(kuberneteswatchtriggersResource, c.ns, *name, types.ApplyPatchType, data), &v1.KubernetesWatchTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(kuberneteswatchtriggersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.KubernetesWatchTrigger), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var messagequeuetriggersKind = v1.SchemeGroupVersion.WithKind("MessageQueueTrigg
|
||||
|
||||
// Get takes name of the _messageQueueTrigger, and returns the corresponding messageQueueTrigger object, and an error if there is any.
|
||||
func (c *FakeMessageQueueTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
emptyResult := &v1.MessageQueueTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(messagequeuetriggersResource, c.ns, name), &v1.MessageQueueTrigger{})
|
||||
Invokes(testing.NewGetActionWithOptions(messagequeuetriggersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MessageQueueTrigger), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MessageQueueTriggers that match those selectors.
|
||||
func (c *FakeMessageQueueTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MessageQueueTriggerList, err error) {
|
||||
emptyResult := &v1.MessageQueueTriggerList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(messagequeuetriggersResource, messagequeuetriggersKind, c.ns, opts), &v1.MessageQueueTriggerList{})
|
||||
Invokes(testing.NewListActionWithOptions(messagequeuetriggersResource, messagequeuetriggersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeMessageQueueTriggers) List(ctx context.Context, opts metav1.ListOpt
|
||||
// Watch returns a watch.Interface that watches the requested messageQueueTriggers.
|
||||
func (c *FakeMessageQueueTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(messagequeuetriggersResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(messagequeuetriggersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _messageQueueTrigger and creates it. Returns the server's representation of the messageQueueTrigger, and an error, if there is any.
|
||||
func (c *FakeMessageQueueTriggers) Create(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.CreateOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
emptyResult := &v1.MessageQueueTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(messagequeuetriggersResource, c.ns, _messageQueueTrigger), &v1.MessageQueueTrigger{})
|
||||
Invokes(testing.NewCreateActionWithOptions(messagequeuetriggersResource, c.ns, _messageQueueTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MessageQueueTrigger), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _messageQueueTrigger and updates it. Returns the server's representation of the messageQueueTrigger, and an error, if there is any.
|
||||
func (c *FakeMessageQueueTriggers) Update(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.UpdateOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
emptyResult := &v1.MessageQueueTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(messagequeuetriggersResource, c.ns, _messageQueueTrigger), &v1.MessageQueueTrigger{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(messagequeuetriggersResource, c.ns, _messageQueueTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MessageQueueTrigger), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeMessageQueueTriggers) Delete(ctx context.Context, name string, opts
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMessageQueueTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(messagequeuetriggersResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(messagequeuetriggersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.MessageQueueTriggerList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeMessageQueueTriggers) DeleteCollection(ctx context.Context, opts me
|
||||
|
||||
// Patch applies the patch and returns the patched messageQueueTrigger.
|
||||
func (c *FakeMessageQueueTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MessageQueueTrigger, err error) {
|
||||
emptyResult := &v1.MessageQueueTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(messagequeuetriggersResource, c.ns, name, pt, data, subresources...), &v1.MessageQueueTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(messagequeuetriggersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MessageQueueTrigger), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeMessageQueueTriggers) Apply(ctx context.Context, _messageQueueTrigg
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_messageQueueTrigger.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.MessageQueueTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(messagequeuetriggersResource, c.ns, *name, types.ApplyPatchType, data), &v1.MessageQueueTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(messagequeuetriggersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.MessageQueueTrigger), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var packagesKind = v1.SchemeGroupVersion.WithKind("Package")
|
||||
|
||||
// Get takes name of the _package, and returns the corresponding package object, and an error if there is any.
|
||||
func (c *FakePackages) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Package, err error) {
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(packagesResource, c.ns, name), &v1.Package{})
|
||||
Invokes(testing.NewGetActionWithOptions(packagesResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Packages that match those selectors.
|
||||
func (c *FakePackages) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PackageList, err error) {
|
||||
emptyResult := &v1.PackageList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(packagesResource, packagesKind, c.ns, opts), &v1.PackageList{})
|
||||
Invokes(testing.NewListActionWithOptions(packagesResource, packagesKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,40 +80,43 @@ func (c *FakePackages) List(ctx context.Context, opts metav1.ListOptions) (resul
|
||||
// Watch returns a watch.Interface that watches the requested packages.
|
||||
func (c *FakePackages) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(packagesResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(packagesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _package and creates it. Returns the server's representation of the package, and an error, if there is any.
|
||||
func (c *FakePackages) Create(ctx context.Context, _package *v1.Package, opts metav1.CreateOptions) (result *v1.Package, err error) {
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(packagesResource, c.ns, _package), &v1.Package{})
|
||||
Invokes(testing.NewCreateActionWithOptions(packagesResource, c.ns, _package, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _package and updates it. Returns the server's representation of the package, and an error, if there is any.
|
||||
func (c *FakePackages) Update(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (result *v1.Package, err error) {
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(packagesResource, c.ns, _package), &v1.Package{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(packagesResource, c.ns, _package, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *FakePackages) UpdateStatus(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (*v1.Package, error) {
|
||||
func (c *FakePackages) UpdateStatus(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (result *v1.Package, err error) {
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(packagesResource, "status", c.ns, _package), &v1.Package{})
|
||||
Invokes(testing.NewUpdateSubresourceActionWithOptions(packagesResource, "status", c.ns, _package, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
@@ -126,7 +131,7 @@ func (c *FakePackages) Delete(ctx context.Context, name string, opts metav1.Dele
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePackages) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(packagesResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(packagesResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.PackageList{})
|
||||
return err
|
||||
@@ -134,11 +139,12 @@ func (c *FakePackages) DeleteCollection(ctx context.Context, opts metav1.DeleteO
|
||||
|
||||
// Patch applies the patch and returns the patched package.
|
||||
func (c *FakePackages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Package, err error) {
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(packagesResource, c.ns, name, pt, data, subresources...), &v1.Package{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(packagesResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
@@ -156,11 +162,12 @@ func (c *FakePackages) Apply(ctx context.Context, _package *corev1.PackageApplyC
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_package.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(packagesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Package{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(packagesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
@@ -179,11 +186,12 @@ func (c *FakePackages) ApplyStatus(ctx context.Context, _package *corev1.Package
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_package.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.Package{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(packagesResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1.Package{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(packagesResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions(), "status"), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.Package), err
|
||||
}
|
||||
|
||||
@@ -44,22 +44,24 @@ var timetriggersKind = v1.SchemeGroupVersion.WithKind("TimeTrigger")
|
||||
|
||||
// Get takes name of the _timeTrigger, and returns the corresponding timeTrigger object, and an error if there is any.
|
||||
func (c *FakeTimeTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TimeTrigger, err error) {
|
||||
emptyResult := &v1.TimeTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(timetriggersResource, c.ns, name), &v1.TimeTrigger{})
|
||||
Invokes(testing.NewGetActionWithOptions(timetriggersResource, c.ns, name, options), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TimeTrigger), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TimeTriggers that match those selectors.
|
||||
func (c *FakeTimeTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TimeTriggerList, err error) {
|
||||
emptyResult := &v1.TimeTriggerList{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(timetriggersResource, timetriggersKind, c.ns, opts), &v1.TimeTriggerList{})
|
||||
Invokes(testing.NewListActionWithOptions(timetriggersResource, timetriggersKind, c.ns, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
@@ -78,28 +80,30 @@ func (c *FakeTimeTriggers) List(ctx context.Context, opts metav1.ListOptions) (r
|
||||
// Watch returns a watch.Interface that watches the requested timeTriggers.
|
||||
func (c *FakeTimeTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(timetriggersResource, c.ns, opts))
|
||||
InvokesWatch(testing.NewWatchActionWithOptions(timetriggersResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a _timeTrigger and creates it. Returns the server's representation of the timeTrigger, and an error, if there is any.
|
||||
func (c *FakeTimeTriggers) Create(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.CreateOptions) (result *v1.TimeTrigger, err error) {
|
||||
emptyResult := &v1.TimeTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(timetriggersResource, c.ns, _timeTrigger), &v1.TimeTrigger{})
|
||||
Invokes(testing.NewCreateActionWithOptions(timetriggersResource, c.ns, _timeTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TimeTrigger), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a _timeTrigger and updates it. Returns the server's representation of the timeTrigger, and an error, if there is any.
|
||||
func (c *FakeTimeTriggers) Update(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.UpdateOptions) (result *v1.TimeTrigger, err error) {
|
||||
emptyResult := &v1.TimeTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(timetriggersResource, c.ns, _timeTrigger), &v1.TimeTrigger{})
|
||||
Invokes(testing.NewUpdateActionWithOptions(timetriggersResource, c.ns, _timeTrigger, opts), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TimeTrigger), err
|
||||
}
|
||||
@@ -114,7 +118,7 @@ func (c *FakeTimeTriggers) Delete(ctx context.Context, name string, opts metav1.
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTimeTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(timetriggersResource, c.ns, listOpts)
|
||||
action := testing.NewDeleteCollectionActionWithOptions(timetriggersResource, c.ns, opts, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v1.TimeTriggerList{})
|
||||
return err
|
||||
@@ -122,11 +126,12 @@ func (c *FakeTimeTriggers) DeleteCollection(ctx context.Context, opts metav1.Del
|
||||
|
||||
// Patch applies the patch and returns the patched timeTrigger.
|
||||
func (c *FakeTimeTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TimeTrigger, err error) {
|
||||
emptyResult := &v1.TimeTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(timetriggersResource, c.ns, name, pt, data, subresources...), &v1.TimeTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(timetriggersResource, c.ns, name, pt, data, opts, subresources...), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TimeTrigger), err
|
||||
}
|
||||
@@ -144,11 +149,12 @@ func (c *FakeTimeTriggers) Apply(ctx context.Context, _timeTrigger *corev1.TimeT
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_timeTrigger.Name must be provided to Apply")
|
||||
}
|
||||
emptyResult := &v1.TimeTrigger{}
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(timetriggersResource, c.ns, *name, types.ApplyPatchType, data), &v1.TimeTrigger{})
|
||||
Invokes(testing.NewPatchSubresourceActionWithOptions(timetriggersResource, c.ns, *name, types.ApplyPatchType, data, opts.ToPatchOptions()), emptyResult)
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
return emptyResult, err
|
||||
}
|
||||
return obj.(*v1.TimeTrigger), err
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// FunctionsGetter has a method to return a FunctionInterface.
|
||||
@@ -55,154 +52,18 @@ type FunctionInterface interface {
|
||||
|
||||
// functions implements FunctionInterface
|
||||
type functions struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.Function, *v1.FunctionList, *corev1.FunctionApplyConfiguration]
|
||||
}
|
||||
|
||||
// newFunctions returns a Functions
|
||||
func newFunctions(c *CoreV1Client, namespace string) *functions {
|
||||
return &functions{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.Function, *v1.FunctionList, *corev1.FunctionApplyConfiguration](
|
||||
"functions",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.Function { return &v1.Function{} },
|
||||
func() *v1.FunctionList { return &v1.FunctionList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _function, and returns the corresponding function object, and an error if there is any.
|
||||
func (c *functions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Function, err error) {
|
||||
result = &v1.Function{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Functions that match those selectors.
|
||||
func (c *functions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FunctionList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.FunctionList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested functions.
|
||||
func (c *functions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _function and creates it. Returns the server's representation of the function, and an error, if there is any.
|
||||
func (c *functions) Create(ctx context.Context, _function *v1.Function, opts metav1.CreateOptions) (result *v1.Function, err error) {
|
||||
result = &v1.Function{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_function).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _function and updates it. Returns the server's representation of the function, and an error, if there is any.
|
||||
func (c *functions) Update(ctx context.Context, _function *v1.Function, opts metav1.UpdateOptions) (result *v1.Function, err error) {
|
||||
result = &v1.Function{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
Name(_function.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_function).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _function and deletes it. Returns an error if one occurs.
|
||||
func (c *functions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *functions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched function.
|
||||
func (c *functions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Function, err error) {
|
||||
result = &v1.Function{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied function.
|
||||
func (c *functions) Apply(ctx context.Context, _function *corev1.FunctionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Function, err error) {
|
||||
if _function == nil {
|
||||
return nil, fmt.Errorf("_function provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_function)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _function.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_function.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.Function{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("functions").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// HTTPTriggersGetter has a method to return a HTTPTriggerInterface.
|
||||
@@ -55,154 +52,18 @@ type HTTPTriggerInterface interface {
|
||||
|
||||
// hTTPTriggers implements HTTPTriggerInterface
|
||||
type hTTPTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.HTTPTrigger, *v1.HTTPTriggerList, *corev1.HTTPTriggerApplyConfiguration]
|
||||
}
|
||||
|
||||
// newHTTPTriggers returns a HTTPTriggers
|
||||
func newHTTPTriggers(c *CoreV1Client, namespace string) *hTTPTriggers {
|
||||
return &hTTPTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.HTTPTrigger, *v1.HTTPTriggerList, *corev1.HTTPTriggerApplyConfiguration](
|
||||
"httptriggers",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.HTTPTrigger { return &v1.HTTPTrigger{} },
|
||||
func() *v1.HTTPTriggerList { return &v1.HTTPTriggerList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _hTTPTrigger, and returns the corresponding hTTPTrigger object, and an error if there is any.
|
||||
func (c *hTTPTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HTTPTrigger, err error) {
|
||||
result = &v1.HTTPTrigger{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of HTTPTriggers that match those selectors.
|
||||
func (c *hTTPTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HTTPTriggerList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.HTTPTriggerList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested hTTPTriggers.
|
||||
func (c *hTTPTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _hTTPTrigger and creates it. Returns the server's representation of the hTTPTrigger, and an error, if there is any.
|
||||
func (c *hTTPTriggers) Create(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.CreateOptions) (result *v1.HTTPTrigger, err error) {
|
||||
result = &v1.HTTPTrigger{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_hTTPTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _hTTPTrigger and updates it. Returns the server's representation of the hTTPTrigger, and an error, if there is any.
|
||||
func (c *hTTPTriggers) Update(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.UpdateOptions) (result *v1.HTTPTrigger, err error) {
|
||||
result = &v1.HTTPTrigger{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
Name(_hTTPTrigger.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_hTTPTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _hTTPTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *hTTPTriggers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *hTTPTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPTrigger.
|
||||
func (c *hTTPTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPTrigger, err error) {
|
||||
result = &v1.HTTPTrigger{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied hTTPTrigger.
|
||||
func (c *hTTPTriggers) Apply(ctx context.Context, _hTTPTrigger *corev1.HTTPTriggerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.HTTPTrigger, err error) {
|
||||
if _hTTPTrigger == nil {
|
||||
return nil, fmt.Errorf("_hTTPTrigger provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_hTTPTrigger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _hTTPTrigger.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_hTTPTrigger.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.HTTPTrigger{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("httptriggers").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// KubernetesWatchTriggersGetter has a method to return a KubernetesWatchTriggerInterface.
|
||||
@@ -55,154 +52,18 @@ type KubernetesWatchTriggerInterface interface {
|
||||
|
||||
// kubernetesWatchTriggers implements KubernetesWatchTriggerInterface
|
||||
type kubernetesWatchTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.KubernetesWatchTrigger, *v1.KubernetesWatchTriggerList, *corev1.KubernetesWatchTriggerApplyConfiguration]
|
||||
}
|
||||
|
||||
// newKubernetesWatchTriggers returns a KubernetesWatchTriggers
|
||||
func newKubernetesWatchTriggers(c *CoreV1Client, namespace string) *kubernetesWatchTriggers {
|
||||
return &kubernetesWatchTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.KubernetesWatchTrigger, *v1.KubernetesWatchTriggerList, *corev1.KubernetesWatchTriggerApplyConfiguration](
|
||||
"kuberneteswatchtriggers",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.KubernetesWatchTrigger { return &v1.KubernetesWatchTrigger{} },
|
||||
func() *v1.KubernetesWatchTriggerList { return &v1.KubernetesWatchTriggerList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _kubernetesWatchTrigger, and returns the corresponding kubernetesWatchTrigger object, and an error if there is any.
|
||||
func (c *kubernetesWatchTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
result = &v1.KubernetesWatchTrigger{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of KubernetesWatchTriggers that match those selectors.
|
||||
func (c *kubernetesWatchTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KubernetesWatchTriggerList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.KubernetesWatchTriggerList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested kubernetesWatchTriggers.
|
||||
func (c *kubernetesWatchTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _kubernetesWatchTrigger and creates it. Returns the server's representation of the kubernetesWatchTrigger, and an error, if there is any.
|
||||
func (c *kubernetesWatchTriggers) Create(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.CreateOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
result = &v1.KubernetesWatchTrigger{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_kubernetesWatchTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _kubernetesWatchTrigger and updates it. Returns the server's representation of the kubernetesWatchTrigger, and an error, if there is any.
|
||||
func (c *kubernetesWatchTriggers) Update(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.UpdateOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
result = &v1.KubernetesWatchTrigger{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
Name(_kubernetesWatchTrigger.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_kubernetesWatchTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _kubernetesWatchTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *kubernetesWatchTriggers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *kubernetesWatchTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched kubernetesWatchTrigger.
|
||||
func (c *kubernetesWatchTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
result = &v1.KubernetesWatchTrigger{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied kubernetesWatchTrigger.
|
||||
func (c *kubernetesWatchTriggers) Apply(ctx context.Context, _kubernetesWatchTrigger *corev1.KubernetesWatchTriggerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.KubernetesWatchTrigger, err error) {
|
||||
if _kubernetesWatchTrigger == nil {
|
||||
return nil, fmt.Errorf("_kubernetesWatchTrigger provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_kubernetesWatchTrigger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _kubernetesWatchTrigger.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_kubernetesWatchTrigger.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.KubernetesWatchTrigger{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("kuberneteswatchtriggers").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// MessageQueueTriggersGetter has a method to return a MessageQueueTriggerInterface.
|
||||
@@ -55,154 +52,18 @@ type MessageQueueTriggerInterface interface {
|
||||
|
||||
// messageQueueTriggers implements MessageQueueTriggerInterface
|
||||
type messageQueueTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.MessageQueueTrigger, *v1.MessageQueueTriggerList, *corev1.MessageQueueTriggerApplyConfiguration]
|
||||
}
|
||||
|
||||
// newMessageQueueTriggers returns a MessageQueueTriggers
|
||||
func newMessageQueueTriggers(c *CoreV1Client, namespace string) *messageQueueTriggers {
|
||||
return &messageQueueTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.MessageQueueTrigger, *v1.MessageQueueTriggerList, *corev1.MessageQueueTriggerApplyConfiguration](
|
||||
"messagequeuetriggers",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.MessageQueueTrigger { return &v1.MessageQueueTrigger{} },
|
||||
func() *v1.MessageQueueTriggerList { return &v1.MessageQueueTriggerList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _messageQueueTrigger, and returns the corresponding messageQueueTrigger object, and an error if there is any.
|
||||
func (c *messageQueueTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
result = &v1.MessageQueueTrigger{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of MessageQueueTriggers that match those selectors.
|
||||
func (c *messageQueueTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MessageQueueTriggerList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.MessageQueueTriggerList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested messageQueueTriggers.
|
||||
func (c *messageQueueTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _messageQueueTrigger and creates it. Returns the server's representation of the messageQueueTrigger, and an error, if there is any.
|
||||
func (c *messageQueueTriggers) Create(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.CreateOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
result = &v1.MessageQueueTrigger{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_messageQueueTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _messageQueueTrigger and updates it. Returns the server's representation of the messageQueueTrigger, and an error, if there is any.
|
||||
func (c *messageQueueTriggers) Update(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.UpdateOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
result = &v1.MessageQueueTrigger{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
Name(_messageQueueTrigger.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_messageQueueTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _messageQueueTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *messageQueueTriggers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *messageQueueTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched messageQueueTrigger.
|
||||
func (c *messageQueueTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MessageQueueTrigger, err error) {
|
||||
result = &v1.MessageQueueTrigger{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied messageQueueTrigger.
|
||||
func (c *messageQueueTriggers) Apply(ctx context.Context, _messageQueueTrigger *corev1.MessageQueueTriggerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.MessageQueueTrigger, err error) {
|
||||
if _messageQueueTrigger == nil {
|
||||
return nil, fmt.Errorf("_messageQueueTrigger provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_messageQueueTrigger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _messageQueueTrigger.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_messageQueueTrigger.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.MessageQueueTrigger{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("messagequeuetriggers").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// PackagesGetter has a method to return a PackageInterface.
|
||||
@@ -43,6 +40,7 @@ type PackagesGetter interface {
|
||||
type PackageInterface interface {
|
||||
Create(ctx context.Context, _package *v1.Package, opts metav1.CreateOptions) (*v1.Package, error)
|
||||
Update(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (*v1.Package, error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
UpdateStatus(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (*v1.Package, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
@@ -51,206 +49,25 @@ type PackageInterface interface {
|
||||
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.Package, err error)
|
||||
Apply(ctx context.Context, _package *corev1.PackageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Package, err error)
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus().
|
||||
ApplyStatus(ctx context.Context, _package *corev1.PackageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Package, err error)
|
||||
PackageExpansion
|
||||
}
|
||||
|
||||
// packages implements PackageInterface
|
||||
type packages struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.Package, *v1.PackageList, *corev1.PackageApplyConfiguration]
|
||||
}
|
||||
|
||||
// newPackages returns a Packages
|
||||
func newPackages(c *CoreV1Client, namespace string) *packages {
|
||||
return &packages{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.Package, *v1.PackageList, *corev1.PackageApplyConfiguration](
|
||||
"packages",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.Package { return &v1.Package{} },
|
||||
func() *v1.PackageList { return &v1.PackageList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _package, and returns the corresponding package object, and an error if there is any.
|
||||
func (c *packages) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Package, err error) {
|
||||
result = &v1.Package{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Packages that match those selectors.
|
||||
func (c *packages) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PackageList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.PackageList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested packages.
|
||||
func (c *packages) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _package and creates it. Returns the server's representation of the package, and an error, if there is any.
|
||||
func (c *packages) Create(ctx context.Context, _package *v1.Package, opts metav1.CreateOptions) (result *v1.Package, err error) {
|
||||
result = &v1.Package{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_package).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _package and updates it. Returns the server's representation of the package, and an error, if there is any.
|
||||
func (c *packages) Update(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (result *v1.Package, err error) {
|
||||
result = &v1.Package{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(_package.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_package).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateStatus was generated because the type contains a Status member.
|
||||
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
|
||||
func (c *packages) UpdateStatus(ctx context.Context, _package *v1.Package, opts metav1.UpdateOptions) (result *v1.Package, err error) {
|
||||
result = &v1.Package{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(_package.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_package).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _package and deletes it. Returns an error if one occurs.
|
||||
func (c *packages) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *packages) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched package.
|
||||
func (c *packages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Package, err error) {
|
||||
result = &v1.Package{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied package.
|
||||
func (c *packages) Apply(ctx context.Context, _package *corev1.PackageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Package, err error) {
|
||||
if _package == nil {
|
||||
return nil, fmt.Errorf("_package provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_package)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _package.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_package.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.Package{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
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 *packages) ApplyStatus(ctx context.Context, _package *corev1.PackageApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Package, err error) {
|
||||
if _package == nil {
|
||||
return nil, fmt.Errorf("_package provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_package)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
name := _package.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_package.Name must be provided to Apply")
|
||||
}
|
||||
|
||||
result = &v1.Package{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("packages").
|
||||
Name(*name).
|
||||
SubResource("status").
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -20,9 +20,6 @@ package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
json "encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
corev1 "github.com/fission/fission/pkg/generated/applyconfiguration/core/v1"
|
||||
@@ -30,7 +27,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
rest "k8s.io/client-go/rest"
|
||||
gentype "k8s.io/client-go/gentype"
|
||||
)
|
||||
|
||||
// TimeTriggersGetter has a method to return a TimeTriggerInterface.
|
||||
@@ -55,154 +52,18 @@ type TimeTriggerInterface interface {
|
||||
|
||||
// timeTriggers implements TimeTriggerInterface
|
||||
type timeTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
*gentype.ClientWithListAndApply[*v1.TimeTrigger, *v1.TimeTriggerList, *corev1.TimeTriggerApplyConfiguration]
|
||||
}
|
||||
|
||||
// newTimeTriggers returns a TimeTriggers
|
||||
func newTimeTriggers(c *CoreV1Client, namespace string) *timeTriggers {
|
||||
return &timeTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
gentype.NewClientWithListAndApply[*v1.TimeTrigger, *v1.TimeTriggerList, *corev1.TimeTriggerApplyConfiguration](
|
||||
"timetriggers",
|
||||
c.RESTClient(),
|
||||
scheme.ParameterCodec,
|
||||
namespace,
|
||||
func() *v1.TimeTrigger { return &v1.TimeTrigger{} },
|
||||
func() *v1.TimeTriggerList { return &v1.TimeTriggerList{} }),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the _timeTrigger, and returns the corresponding timeTrigger object, and an error if there is any.
|
||||
func (c *timeTriggers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.TimeTrigger, err error) {
|
||||
result = &v1.TimeTrigger{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of TimeTriggers that match those selectors.
|
||||
func (c *timeTriggers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.TimeTriggerList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.TimeTriggerList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested timeTriggers.
|
||||
func (c *timeTriggers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
opts.Watch = true
|
||||
return c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a _timeTrigger and creates it. Returns the server's representation of the timeTrigger, and an error, if there is any.
|
||||
func (c *timeTriggers) Create(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.CreateOptions) (result *v1.TimeTrigger, err error) {
|
||||
result = &v1.TimeTrigger{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_timeTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a _timeTrigger and updates it. Returns the server's representation of the timeTrigger, and an error, if there is any.
|
||||
func (c *timeTriggers) Update(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.UpdateOptions) (result *v1.TimeTrigger, err error) {
|
||||
result = &v1.TimeTrigger{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
Name(_timeTrigger.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(_timeTrigger).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the _timeTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *timeTriggers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *timeTriggers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched timeTrigger.
|
||||
func (c *timeTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TimeTrigger, err error) {
|
||||
result = &v1.TimeTrigger{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Apply takes the given apply declarative configuration, applies it and returns the applied timeTrigger.
|
||||
func (c *timeTriggers) Apply(ctx context.Context, _timeTrigger *corev1.TimeTriggerApplyConfiguration, opts metav1.ApplyOptions) (result *v1.TimeTrigger, err error) {
|
||||
if _timeTrigger == nil {
|
||||
return nil, fmt.Errorf("_timeTrigger provided to Apply must not be nil")
|
||||
}
|
||||
patchOpts := opts.ToPatchOptions()
|
||||
data, err := json.Marshal(_timeTrigger)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name := _timeTrigger.Name
|
||||
if name == nil {
|
||||
return nil, fmt.Errorf("_timeTrigger.Name must be provided to Apply")
|
||||
}
|
||||
result = &v1.TimeTrigger{}
|
||||
err = c.client.Patch(types.ApplyPatchType).
|
||||
Namespace(c.ns).
|
||||
Resource("timetriggers").
|
||||
Name(*name).
|
||||
VersionedParams(&patchOpts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user