Move informers,clientset and listers to generated package (#2093)
Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package versioned
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/generated/clientset/versioned/typed/core/v1"
|
||||
discovery "k8s.io/client-go/discovery"
|
||||
rest "k8s.io/client-go/rest"
|
||||
flowcontrol "k8s.io/client-go/util/flowcontrol"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
CoreV1() corev1.CoreV1Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
// version included in a Clientset.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
coreV1 *corev1.CoreV1Client
|
||||
}
|
||||
|
||||
// CoreV1 retrieves the CoreV1Client
|
||||
func (c *Clientset) CoreV1() corev1.CoreV1Interface {
|
||||
return c.coreV1
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.DiscoveryClient
|
||||
}
|
||||
|
||||
// NewForConfig creates a new Clientset for the given config.
|
||||
// If config's RateLimiter is not set and QPS and Burst are acceptable,
|
||||
// NewForConfig will generate a rate-limiter in configShallowCopy.
|
||||
func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
|
||||
if configShallowCopy.Burst <= 0 {
|
||||
return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
|
||||
}
|
||||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
|
||||
}
|
||||
var cs Clientset
|
||||
var err error
|
||||
cs.coreV1, err = corev1.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &cs, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new Clientset for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
var cs Clientset
|
||||
cs.coreV1 = corev1.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c rest.Interface) *Clientset {
|
||||
var cs Clientset
|
||||
cs.coreV1 = corev1.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated clientset.
|
||||
package versioned
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
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"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/discovery"
|
||||
fakediscovery "k8s.io/client-go/discovery/fake"
|
||||
"k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// 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
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder())
|
||||
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
|
||||
}
|
||||
|
||||
// Clientset implements clientset.Interface. Meant to be embedded into a
|
||||
// struct to get a default implementation. This makes faking out just the method
|
||||
// you want to test easier.
|
||||
type Clientset struct {
|
||||
testing.Fake
|
||||
discovery *fakediscovery.FakeDiscovery
|
||||
tracker testing.ObjectTracker
|
||||
}
|
||||
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return c.discovery
|
||||
}
|
||||
|
||||
func (c *Clientset) Tracker() testing.ObjectTracker {
|
||||
return c.tracker
|
||||
}
|
||||
|
||||
var _ clientset.Interface = &Clientset{}
|
||||
|
||||
// CoreV1 retrieves the CoreV1Client
|
||||
func (c *Clientset) CoreV1() corev1.CoreV1Interface {
|
||||
return &fakecorev1.FakeCoreV1{Fake: &c.Fake}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated fake clientset.
|
||||
package fake
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
var codecs = serializer.NewCodecFactory(scheme)
|
||||
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
corev1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(scheme))
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package contains the scheme of the automatically generated clientset.
|
||||
package scheme
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package scheme
|
||||
|
||||
import (
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
)
|
||||
|
||||
var Scheme = runtime.NewScheme()
|
||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
corev1.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
var AddToScheme = localSchemeBuilder.AddToScheme
|
||||
|
||||
func init() {
|
||||
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
|
||||
utilruntime.Must(AddToScheme(Scheme))
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// CanaryConfigsGetter has a method to return a CanaryConfigInterface.
|
||||
// A group's client should implement this interface.
|
||||
type CanaryConfigsGetter interface {
|
||||
CanaryConfigs(namespace string) CanaryConfigInterface
|
||||
}
|
||||
|
||||
// CanaryConfigInterface has methods to work with CanaryConfig resources.
|
||||
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)
|
||||
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
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CanaryConfig, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.CanaryConfigList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CanaryConfig, err error)
|
||||
CanaryConfigExpansion
|
||||
}
|
||||
|
||||
// canaryConfigs implements CanaryConfigInterface
|
||||
type canaryConfigs struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newCanaryConfigs returns a CanaryConfigs
|
||||
func newCanaryConfigs(c *CoreV1Client, namespace string) *canaryConfigs {
|
||||
return &canaryConfigs{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
"github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
rest "k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type CoreV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
CanaryConfigsGetter
|
||||
EnvironmentsGetter
|
||||
FunctionsGetter
|
||||
HTTPTriggersGetter
|
||||
KubernetesWatchTriggersGetter
|
||||
MessageQueueTriggersGetter
|
||||
PackagesGetter
|
||||
TimeTriggersGetter
|
||||
}
|
||||
|
||||
// CoreV1Client is used to interact with features provided by the fission.io group.
|
||||
type CoreV1Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) CanaryConfigs(namespace string) CanaryConfigInterface {
|
||||
return newCanaryConfigs(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) Environments(namespace string) EnvironmentInterface {
|
||||
return newEnvironments(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) Functions(namespace string) FunctionInterface {
|
||||
return newFunctions(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) HTTPTriggers(namespace string) HTTPTriggerInterface {
|
||||
return newHTTPTriggers(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) KubernetesWatchTriggers(namespace string) KubernetesWatchTriggerInterface {
|
||||
return newKubernetesWatchTriggers(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) MessageQueueTriggers(namespace string) MessageQueueTriggerInterface {
|
||||
return newMessageQueueTriggers(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) Packages(namespace string) PackageInterface {
|
||||
return newPackages(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreV1Client) TimeTriggers(namespace string) TimeTriggerInterface {
|
||||
return newTimeTriggers(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new CoreV1Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*CoreV1Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &CoreV1Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new CoreV1Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *CoreV1Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new CoreV1Client for the given RESTClient.
|
||||
func New(c rest.Interface) *CoreV1Client {
|
||||
return &CoreV1Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1.SchemeGroupVersion
|
||||
config.GroupVersion = &gv
|
||||
config.APIPath = "/apis"
|
||||
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CoreV1Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package v1
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// EnvironmentsGetter has a method to return a EnvironmentInterface.
|
||||
// A group's client should implement this interface.
|
||||
type EnvironmentsGetter interface {
|
||||
Environments(namespace string) EnvironmentInterface
|
||||
}
|
||||
|
||||
// EnvironmentInterface has methods to work with Environment resources.
|
||||
type EnvironmentInterface interface {
|
||||
Create(ctx context.Context, _environment *v1.Environment, opts metav1.CreateOptions) (*v1.Environment, error)
|
||||
Update(ctx context.Context, _environment *v1.Environment, opts metav1.UpdateOptions) (*v1.Environment, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Environment, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.EnvironmentList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Environment, err error)
|
||||
EnvironmentExpansion
|
||||
}
|
||||
|
||||
// environments implements EnvironmentInterface
|
||||
type environments struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEnvironments returns a Environments
|
||||
func newEnvironments(c *CoreV1Client, namespace string) *environments {
|
||||
return &environments{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeCanaryConfigs implements CanaryConfigInterface
|
||||
type FakeCanaryConfigs struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var canaryconfigsResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "canaryconfigs"}
|
||||
|
||||
var canaryconfigsKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.CanaryConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(canaryconfigsResource, c.ns, name), &corev1.CanaryConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.CanaryConfigList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(canaryconfigsResource, canaryconfigsKind, c.ns, opts), &corev1.CanaryConfigList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.CanaryConfigList{ListMeta: obj.(*corev1.CanaryConfigList).ListMeta}
|
||||
for _, item := range obj.(*corev1.CanaryConfigList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested canaryConfigs.
|
||||
func (c *FakeCanaryConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.CanaryConfig, opts v1.CreateOptions) (result *corev1.CanaryConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(canaryconfigsResource, c.ns, _canaryConfig), &corev1.CanaryConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.CanaryConfig, opts v1.UpdateOptions) (result *corev1.CanaryConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(canaryconfigsResource, c.ns, _canaryConfig), &corev1.CanaryConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.CanaryConfig, opts v1.UpdateOptions) (*corev1.CanaryConfig, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(canaryconfigsResource, "status", c.ns, _canaryConfig), &corev1.CanaryConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.CanaryConfig), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _canaryConfig and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeCanaryConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(canaryconfigsResource, c.ns, name), &corev1.CanaryConfig{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeCanaryConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(canaryconfigsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.CanaryConfigList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched canaryConfig.
|
||||
func (c *FakeCanaryConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.CanaryConfig, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(canaryconfigsResource, c.ns, name, pt, data, subresources...), &corev1.CanaryConfig{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.CanaryConfig), err
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
v1 "github.com/fission/fission/pkg/generated/clientset/versioned/typed/core/v1"
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeCoreV1 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) CanaryConfigs(namespace string) v1.CanaryConfigInterface {
|
||||
return &FakeCanaryConfigs{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) Environments(namespace string) v1.EnvironmentInterface {
|
||||
return &FakeEnvironments{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) Functions(namespace string) v1.FunctionInterface {
|
||||
return &FakeFunctions{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) HTTPTriggers(namespace string) v1.HTTPTriggerInterface {
|
||||
return &FakeHTTPTriggers{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) KubernetesWatchTriggers(namespace string) v1.KubernetesWatchTriggerInterface {
|
||||
return &FakeKubernetesWatchTriggers{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) MessageQueueTriggers(namespace string) v1.MessageQueueTriggerInterface {
|
||||
return &FakeMessageQueueTriggers{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) Packages(namespace string) v1.PackageInterface {
|
||||
return &FakePackages{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCoreV1) TimeTriggers(namespace string) v1.TimeTriggerInterface {
|
||||
return &FakeTimeTriggers{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeCoreV1) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeEnvironments implements EnvironmentInterface
|
||||
type FakeEnvironments struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var environmentsResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "environments"}
|
||||
|
||||
var environmentsKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.Environment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(environmentsResource, c.ns, name), &corev1.Environment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.EnvironmentList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(environmentsResource, environmentsKind, c.ns, opts), &corev1.EnvironmentList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.EnvironmentList{ListMeta: obj.(*corev1.EnvironmentList).ListMeta}
|
||||
for _, item := range obj.(*corev1.EnvironmentList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested environments.
|
||||
func (c *FakeEnvironments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.Environment, opts v1.CreateOptions) (result *corev1.Environment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(environmentsResource, c.ns, _environment), &corev1.Environment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.Environment, opts v1.UpdateOptions) (result *corev1.Environment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(environmentsResource, c.ns, _environment), &corev1.Environment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Environment), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _environment and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeEnvironments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(environmentsResource, c.ns, name), &corev1.Environment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeEnvironments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(environmentsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.EnvironmentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched environment.
|
||||
func (c *FakeEnvironments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Environment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(environmentsResource, c.ns, name, pt, data, subresources...), &corev1.Environment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Environment), err
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeFunctions implements FunctionInterface
|
||||
type FakeFunctions struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var functionsResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "functions"}
|
||||
|
||||
var functionsKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.Function, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(functionsResource, c.ns, name), &corev1.Function{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.FunctionList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(functionsResource, functionsKind, c.ns, opts), &corev1.FunctionList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.FunctionList{ListMeta: obj.(*corev1.FunctionList).ListMeta}
|
||||
for _, item := range obj.(*corev1.FunctionList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested functions.
|
||||
func (c *FakeFunctions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.Function, opts v1.CreateOptions) (result *corev1.Function, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(functionsResource, c.ns, _function), &corev1.Function{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.Function, opts v1.UpdateOptions) (result *corev1.Function, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(functionsResource, c.ns, _function), &corev1.Function{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Function), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _function and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeFunctions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(functionsResource, c.ns, name), &corev1.Function{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeFunctions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(functionsResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.FunctionList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched function.
|
||||
func (c *FakeFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Function, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(functionsResource, c.ns, name, pt, data, subresources...), &corev1.Function{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Function), err
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeHTTPTriggers implements HTTPTriggerInterface
|
||||
type FakeHTTPTriggers struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var httptriggersResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "httptriggers"}
|
||||
|
||||
var httptriggersKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.HTTPTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(httptriggersResource, c.ns, name), &corev1.HTTPTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.HTTPTriggerList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(httptriggersResource, httptriggersKind, c.ns, opts), &corev1.HTTPTriggerList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.HTTPTriggerList{ListMeta: obj.(*corev1.HTTPTriggerList).ListMeta}
|
||||
for _, item := range obj.(*corev1.HTTPTriggerList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested hTTPTriggers.
|
||||
func (c *FakeHTTPTriggers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.HTTPTrigger, opts v1.CreateOptions) (result *corev1.HTTPTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(httptriggersResource, c.ns, _hTTPTrigger), &corev1.HTTPTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.HTTPTrigger, opts v1.UpdateOptions) (result *corev1.HTTPTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(httptriggersResource, c.ns, _hTTPTrigger), &corev1.HTTPTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.HTTPTrigger), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _hTTPTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeHTTPTriggers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(httptriggersResource, c.ns, name), &corev1.HTTPTrigger{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeHTTPTriggers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(httptriggersResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.HTTPTriggerList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched hTTPTrigger.
|
||||
func (c *FakeHTTPTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.HTTPTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(httptriggersResource, c.ns, name, pt, data, subresources...), &corev1.HTTPTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.HTTPTrigger), err
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeKubernetesWatchTriggers implements KubernetesWatchTriggerInterface
|
||||
type FakeKubernetesWatchTriggers struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var kuberneteswatchtriggersResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "kuberneteswatchtriggers"}
|
||||
|
||||
var kuberneteswatchtriggersKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "KubernetesWatchTrigger"}
|
||||
|
||||
// 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 v1.GetOptions) (result *corev1.KubernetesWatchTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(kuberneteswatchtriggersResource, c.ns, name), &corev1.KubernetesWatchTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.KubernetesWatchTriggerList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(kuberneteswatchtriggersResource, kuberneteswatchtriggersKind, c.ns, opts), &corev1.KubernetesWatchTriggerList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.KubernetesWatchTriggerList{ListMeta: obj.(*corev1.KubernetesWatchTriggerList).ListMeta}
|
||||
for _, item := range obj.(*corev1.KubernetesWatchTriggerList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested kubernetesWatchTriggers.
|
||||
func (c *FakeKubernetesWatchTriggers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.KubernetesWatchTrigger, opts v1.CreateOptions) (result *corev1.KubernetesWatchTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger), &corev1.KubernetesWatchTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.KubernetesWatchTrigger, opts v1.UpdateOptions) (result *corev1.KubernetesWatchTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(kuberneteswatchtriggersResource, c.ns, _kubernetesWatchTrigger), &corev1.KubernetesWatchTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.KubernetesWatchTrigger), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _kubernetesWatchTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeKubernetesWatchTriggers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(kuberneteswatchtriggersResource, c.ns, name), &corev1.KubernetesWatchTrigger{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeKubernetesWatchTriggers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(kuberneteswatchtriggersResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.KubernetesWatchTriggerList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched kubernetesWatchTrigger.
|
||||
func (c *FakeKubernetesWatchTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.KubernetesWatchTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(kuberneteswatchtriggersResource, c.ns, name, pt, data, subresources...), &corev1.KubernetesWatchTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.KubernetesWatchTrigger), err
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeMessageQueueTriggers implements MessageQueueTriggerInterface
|
||||
type FakeMessageQueueTriggers struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var messagequeuetriggersResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "messagequeuetriggers"}
|
||||
|
||||
var messagequeuetriggersKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "MessageQueueTrigger"}
|
||||
|
||||
// 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 v1.GetOptions) (result *corev1.MessageQueueTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(messagequeuetriggersResource, c.ns, name), &corev1.MessageQueueTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.MessageQueueTriggerList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(messagequeuetriggersResource, messagequeuetriggersKind, c.ns, opts), &corev1.MessageQueueTriggerList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.MessageQueueTriggerList{ListMeta: obj.(*corev1.MessageQueueTriggerList).ListMeta}
|
||||
for _, item := range obj.(*corev1.MessageQueueTriggerList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested messageQueueTriggers.
|
||||
func (c *FakeMessageQueueTriggers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.MessageQueueTrigger, opts v1.CreateOptions) (result *corev1.MessageQueueTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(messagequeuetriggersResource, c.ns, _messageQueueTrigger), &corev1.MessageQueueTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.MessageQueueTrigger, opts v1.UpdateOptions) (result *corev1.MessageQueueTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(messagequeuetriggersResource, c.ns, _messageQueueTrigger), &corev1.MessageQueueTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.MessageQueueTrigger), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _messageQueueTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeMessageQueueTriggers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(messagequeuetriggersResource, c.ns, name), &corev1.MessageQueueTrigger{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeMessageQueueTriggers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(messagequeuetriggersResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.MessageQueueTriggerList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched messageQueueTrigger.
|
||||
func (c *FakeMessageQueueTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.MessageQueueTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(messagequeuetriggersResource, c.ns, name, pt, data, subresources...), &corev1.MessageQueueTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.MessageQueueTrigger), err
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakePackages implements PackageInterface
|
||||
type FakePackages struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var packagesResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "packages"}
|
||||
|
||||
var packagesKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.Package, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(packagesResource, c.ns, name), &corev1.Package{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.PackageList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(packagesResource, packagesKind, c.ns, opts), &corev1.PackageList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.PackageList{ListMeta: obj.(*corev1.PackageList).ListMeta}
|
||||
for _, item := range obj.(*corev1.PackageList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested packages.
|
||||
func (c *FakePackages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.Package, opts v1.CreateOptions) (result *corev1.Package, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(packagesResource, c.ns, _package), &corev1.Package{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.Package, opts v1.UpdateOptions) (result *corev1.Package, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(packagesResource, c.ns, _package), &corev1.Package{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.Package, opts v1.UpdateOptions) (*corev1.Package, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateSubresourceAction(packagesResource, "status", c.ns, _package), &corev1.Package{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Package), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _package and deletes it. Returns an error if one occurs.
|
||||
func (c *FakePackages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(packagesResource, c.ns, name), &corev1.Package{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakePackages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(packagesResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.PackageList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched package.
|
||||
func (c *FakePackages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.Package, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(packagesResource, c.ns, name, pt, data, subresources...), &corev1.Package{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.Package), err
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package fake
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
corev1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
labels "k8s.io/apimachinery/pkg/labels"
|
||||
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||
types "k8s.io/apimachinery/pkg/types"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
// FakeTimeTriggers implements TimeTriggerInterface
|
||||
type FakeTimeTriggers struct {
|
||||
Fake *FakeCoreV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var timetriggersResource = schema.GroupVersionResource{Group: "fission.io", Version: "v1", Resource: "timetriggers"}
|
||||
|
||||
var timetriggersKind = schema.GroupVersionKind{Group: "fission.io", Version: "v1", Kind: "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 v1.GetOptions) (result *corev1.TimeTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(timetriggersResource, c.ns, name), &corev1.TimeTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 v1.ListOptions) (result *corev1.TimeTriggerList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(timetriggersResource, timetriggersKind, c.ns, opts), &corev1.TimeTriggerList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &corev1.TimeTriggerList{ListMeta: obj.(*corev1.TimeTriggerList).ListMeta}
|
||||
for _, item := range obj.(*corev1.TimeTriggerList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested timeTriggers.
|
||||
func (c *FakeTimeTriggers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(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 *corev1.TimeTrigger, opts v1.CreateOptions) (result *corev1.TimeTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(timetriggersResource, c.ns, _timeTrigger), &corev1.TimeTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.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 *corev1.TimeTrigger, opts v1.UpdateOptions) (result *corev1.TimeTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(timetriggersResource, c.ns, _timeTrigger), &corev1.TimeTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.TimeTrigger), err
|
||||
}
|
||||
|
||||
// Delete takes name of the _timeTrigger and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeTimeTriggers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(timetriggersResource, c.ns, name), &corev1.TimeTrigger{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeTimeTriggers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(timetriggersResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &corev1.TimeTriggerList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched timeTrigger.
|
||||
func (c *FakeTimeTriggers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.TimeTrigger, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(timetriggersResource, c.ns, name, pt, data, subresources...), &corev1.TimeTrigger{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*corev1.TimeTrigger), err
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// FunctionsGetter has a method to return a FunctionInterface.
|
||||
// A group's client should implement this interface.
|
||||
type FunctionsGetter interface {
|
||||
Functions(namespace string) FunctionInterface
|
||||
}
|
||||
|
||||
// FunctionInterface has methods to work with Function resources.
|
||||
type FunctionInterface interface {
|
||||
Create(ctx context.Context, _function *v1.Function, opts metav1.CreateOptions) (*v1.Function, error)
|
||||
Update(ctx context.Context, _function *v1.Function, opts metav1.UpdateOptions) (*v1.Function, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Function, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.FunctionList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Function, err error)
|
||||
FunctionExpansion
|
||||
}
|
||||
|
||||
// functions implements FunctionInterface
|
||||
type functions struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newFunctions returns a Functions
|
||||
func newFunctions(c *CoreV1Client, namespace string) *functions {
|
||||
return &functions{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
type CanaryConfigExpansion interface{}
|
||||
|
||||
type EnvironmentExpansion interface{}
|
||||
|
||||
type FunctionExpansion interface{}
|
||||
|
||||
type HTTPTriggerExpansion interface{}
|
||||
|
||||
type KubernetesWatchTriggerExpansion interface{}
|
||||
|
||||
type MessageQueueTriggerExpansion interface{}
|
||||
|
||||
type PackageExpansion interface{}
|
||||
|
||||
type TimeTriggerExpansion interface{}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// HTTPTriggersGetter has a method to return a HTTPTriggerInterface.
|
||||
// A group's client should implement this interface.
|
||||
type HTTPTriggersGetter interface {
|
||||
HTTPTriggers(namespace string) HTTPTriggerInterface
|
||||
}
|
||||
|
||||
// HTTPTriggerInterface has methods to work with HTTPTrigger resources.
|
||||
type HTTPTriggerInterface interface {
|
||||
Create(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.CreateOptions) (*v1.HTTPTrigger, error)
|
||||
Update(ctx context.Context, _hTTPTrigger *v1.HTTPTrigger, opts metav1.UpdateOptions) (*v1.HTTPTrigger, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HTTPTrigger, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.HTTPTriggerList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HTTPTrigger, err error)
|
||||
HTTPTriggerExpansion
|
||||
}
|
||||
|
||||
// hTTPTriggers implements HTTPTriggerInterface
|
||||
type hTTPTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newHTTPTriggers returns a HTTPTriggers
|
||||
func newHTTPTriggers(c *CoreV1Client, namespace string) *hTTPTriggers {
|
||||
return &hTTPTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// KubernetesWatchTriggersGetter has a method to return a KubernetesWatchTriggerInterface.
|
||||
// A group's client should implement this interface.
|
||||
type KubernetesWatchTriggersGetter interface {
|
||||
KubernetesWatchTriggers(namespace string) KubernetesWatchTriggerInterface
|
||||
}
|
||||
|
||||
// KubernetesWatchTriggerInterface has methods to work with KubernetesWatchTrigger resources.
|
||||
type KubernetesWatchTriggerInterface interface {
|
||||
Create(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.CreateOptions) (*v1.KubernetesWatchTrigger, error)
|
||||
Update(ctx context.Context, _kubernetesWatchTrigger *v1.KubernetesWatchTrigger, opts metav1.UpdateOptions) (*v1.KubernetesWatchTrigger, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.KubernetesWatchTrigger, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.KubernetesWatchTriggerList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubernetesWatchTrigger, err error)
|
||||
KubernetesWatchTriggerExpansion
|
||||
}
|
||||
|
||||
// kubernetesWatchTriggers implements KubernetesWatchTriggerInterface
|
||||
type kubernetesWatchTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newKubernetesWatchTriggers returns a KubernetesWatchTriggers
|
||||
func newKubernetesWatchTriggers(c *CoreV1Client, namespace string) *kubernetesWatchTriggers {
|
||||
return &kubernetesWatchTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// MessageQueueTriggersGetter has a method to return a MessageQueueTriggerInterface.
|
||||
// A group's client should implement this interface.
|
||||
type MessageQueueTriggersGetter interface {
|
||||
MessageQueueTriggers(namespace string) MessageQueueTriggerInterface
|
||||
}
|
||||
|
||||
// MessageQueueTriggerInterface has methods to work with MessageQueueTrigger resources.
|
||||
type MessageQueueTriggerInterface interface {
|
||||
Create(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.CreateOptions) (*v1.MessageQueueTrigger, error)
|
||||
Update(ctx context.Context, _messageQueueTrigger *v1.MessageQueueTrigger, opts metav1.UpdateOptions) (*v1.MessageQueueTrigger, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MessageQueueTrigger, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.MessageQueueTriggerList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MessageQueueTrigger, err error)
|
||||
MessageQueueTriggerExpansion
|
||||
}
|
||||
|
||||
// messageQueueTriggers implements MessageQueueTriggerInterface
|
||||
type messageQueueTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newMessageQueueTriggers returns a MessageQueueTriggers
|
||||
func newMessageQueueTriggers(c *CoreV1Client, namespace string) *messageQueueTriggers {
|
||||
return &messageQueueTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// PackagesGetter has a method to return a PackageInterface.
|
||||
// A group's client should implement this interface.
|
||||
type PackagesGetter interface {
|
||||
Packages(namespace string) PackageInterface
|
||||
}
|
||||
|
||||
// PackageInterface has methods to work with Package resources.
|
||||
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)
|
||||
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
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Package, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.PackageList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Package, err error)
|
||||
PackageExpansion
|
||||
}
|
||||
|
||||
// packages implements PackageInterface
|
||||
type packages struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newPackages returns a Packages
|
||||
func newPackages(c *CoreV1Client, namespace string) *packages {
|
||||
return &packages{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
Copyright The Fission Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by client-gen. DO NOT EDIT.
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
scheme "github.com/fission/fission/pkg/generated/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// TimeTriggersGetter has a method to return a TimeTriggerInterface.
|
||||
// A group's client should implement this interface.
|
||||
type TimeTriggersGetter interface {
|
||||
TimeTriggers(namespace string) TimeTriggerInterface
|
||||
}
|
||||
|
||||
// TimeTriggerInterface has methods to work with TimeTrigger resources.
|
||||
type TimeTriggerInterface interface {
|
||||
Create(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.CreateOptions) (*v1.TimeTrigger, error)
|
||||
Update(ctx context.Context, _timeTrigger *v1.TimeTrigger, opts metav1.UpdateOptions) (*v1.TimeTrigger, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.TimeTrigger, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.TimeTriggerList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.TimeTrigger, err error)
|
||||
TimeTriggerExpansion
|
||||
}
|
||||
|
||||
// timeTriggers implements TimeTriggerInterface
|
||||
type timeTriggers struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newTimeTriggers returns a TimeTriggers
|
||||
func newTimeTriggers(c *CoreV1Client, namespace string) *timeTriggers {
|
||||
return &timeTriggers{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user