update notification manager to v2.0 (#5030)
Signed-off-by: wanjunlei <wanjunlei@kubesphere.io>
This commit is contained in:
@@ -32,12 +32,14 @@ import (
|
||||
iamv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/iam/v1alpha2"
|
||||
networkv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/network/v1alpha1"
|
||||
notificationv2beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta1"
|
||||
notificationv2beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta2"
|
||||
quotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2"
|
||||
servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2"
|
||||
storagev1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/storage/v1alpha1"
|
||||
tenantv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/tenant/v1alpha1"
|
||||
tenantv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/tenant/v1alpha2"
|
||||
typesv1beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta1"
|
||||
typesv1beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta2"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
@@ -50,12 +52,14 @@ type Interface interface {
|
||||
IamV1alpha2() iamv1alpha2.IamV1alpha2Interface
|
||||
NetworkV1alpha1() networkv1alpha1.NetworkV1alpha1Interface
|
||||
NotificationV2beta1() notificationv2beta1.NotificationV2beta1Interface
|
||||
NotificationV2beta2() notificationv2beta2.NotificationV2beta2Interface
|
||||
QuotaV1alpha2() quotav1alpha2.QuotaV1alpha2Interface
|
||||
ServicemeshV1alpha2() servicemeshv1alpha2.ServicemeshV1alpha2Interface
|
||||
StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface
|
||||
TenantV1alpha1() tenantv1alpha1.TenantV1alpha1Interface
|
||||
TenantV1alpha2() tenantv1alpha2.TenantV1alpha2Interface
|
||||
TypesV1beta1() typesv1beta1.TypesV1beta1Interface
|
||||
TypesV1beta2() typesv1beta2.TypesV1beta2Interface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
@@ -70,12 +74,14 @@ type Clientset struct {
|
||||
iamV1alpha2 *iamv1alpha2.IamV1alpha2Client
|
||||
networkV1alpha1 *networkv1alpha1.NetworkV1alpha1Client
|
||||
notificationV2beta1 *notificationv2beta1.NotificationV2beta1Client
|
||||
notificationV2beta2 *notificationv2beta2.NotificationV2beta2Client
|
||||
quotaV1alpha2 *quotav1alpha2.QuotaV1alpha2Client
|
||||
servicemeshV1alpha2 *servicemeshv1alpha2.ServicemeshV1alpha2Client
|
||||
storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client
|
||||
tenantV1alpha1 *tenantv1alpha1.TenantV1alpha1Client
|
||||
tenantV1alpha2 *tenantv1alpha2.TenantV1alpha2Client
|
||||
typesV1beta1 *typesv1beta1.TypesV1beta1Client
|
||||
typesV1beta2 *typesv1beta2.TypesV1beta2Client
|
||||
}
|
||||
|
||||
// ApplicationV1alpha1 retrieves the ApplicationV1alpha1Client
|
||||
@@ -118,6 +124,11 @@ func (c *Clientset) NotificationV2beta1() notificationv2beta1.NotificationV2beta
|
||||
return c.notificationV2beta1
|
||||
}
|
||||
|
||||
// NotificationV2beta2 retrieves the NotificationV2beta2Client
|
||||
func (c *Clientset) NotificationV2beta2() notificationv2beta2.NotificationV2beta2Interface {
|
||||
return c.notificationV2beta2
|
||||
}
|
||||
|
||||
// QuotaV1alpha2 retrieves the QuotaV1alpha2Client
|
||||
func (c *Clientset) QuotaV1alpha2() quotav1alpha2.QuotaV1alpha2Interface {
|
||||
return c.quotaV1alpha2
|
||||
@@ -148,6 +159,11 @@ func (c *Clientset) TypesV1beta1() typesv1beta1.TypesV1beta1Interface {
|
||||
return c.typesV1beta1
|
||||
}
|
||||
|
||||
// TypesV1beta2 retrieves the TypesV1beta2Client
|
||||
func (c *Clientset) TypesV1beta2() typesv1beta2.TypesV1beta2Interface {
|
||||
return c.typesV1beta2
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
if c == nil {
|
||||
@@ -201,6 +217,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.notificationV2beta2, err = notificationv2beta2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.quotaV1alpha2, err = quotav1alpha2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -225,6 +245,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cs.typesV1beta2, err = typesv1beta2.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
@@ -245,12 +269,14 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||
cs.iamV1alpha2 = iamv1alpha2.NewForConfigOrDie(c)
|
||||
cs.networkV1alpha1 = networkv1alpha1.NewForConfigOrDie(c)
|
||||
cs.notificationV2beta1 = notificationv2beta1.NewForConfigOrDie(c)
|
||||
cs.notificationV2beta2 = notificationv2beta2.NewForConfigOrDie(c)
|
||||
cs.quotaV1alpha2 = quotav1alpha2.NewForConfigOrDie(c)
|
||||
cs.servicemeshV1alpha2 = servicemeshv1alpha2.NewForConfigOrDie(c)
|
||||
cs.storageV1alpha1 = storagev1alpha1.NewForConfigOrDie(c)
|
||||
cs.tenantV1alpha1 = tenantv1alpha1.NewForConfigOrDie(c)
|
||||
cs.tenantV1alpha2 = tenantv1alpha2.NewForConfigOrDie(c)
|
||||
cs.typesV1beta1 = typesv1beta1.NewForConfigOrDie(c)
|
||||
cs.typesV1beta2 = typesv1beta2.NewForConfigOrDie(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &cs
|
||||
@@ -267,12 +293,14 @@ func New(c rest.Interface) *Clientset {
|
||||
cs.iamV1alpha2 = iamv1alpha2.New(c)
|
||||
cs.networkV1alpha1 = networkv1alpha1.New(c)
|
||||
cs.notificationV2beta1 = notificationv2beta1.New(c)
|
||||
cs.notificationV2beta2 = notificationv2beta2.New(c)
|
||||
cs.quotaV1alpha2 = quotav1alpha2.New(c)
|
||||
cs.servicemeshV1alpha2 = servicemeshv1alpha2.New(c)
|
||||
cs.storageV1alpha1 = storagev1alpha1.New(c)
|
||||
cs.tenantV1alpha1 = tenantv1alpha1.New(c)
|
||||
cs.tenantV1alpha2 = tenantv1alpha2.New(c)
|
||||
cs.typesV1beta1 = typesv1beta1.New(c)
|
||||
cs.typesV1beta2 = typesv1beta2.New(c)
|
||||
|
||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &cs
|
||||
|
||||
@@ -41,6 +41,8 @@ import (
|
||||
fakenetworkv1alpha1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/network/v1alpha1/fake"
|
||||
notificationv2beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta1"
|
||||
fakenotificationv2beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta1/fake"
|
||||
notificationv2beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta2"
|
||||
fakenotificationv2beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta2/fake"
|
||||
quotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2"
|
||||
fakequotav1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/quota/v1alpha2/fake"
|
||||
servicemeshv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/servicemesh/v1alpha2"
|
||||
@@ -53,6 +55,8 @@ import (
|
||||
faketenantv1alpha2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/tenant/v1alpha2/fake"
|
||||
typesv1beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta1"
|
||||
faketypesv1beta1 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta1/fake"
|
||||
typesv1beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta2"
|
||||
faketypesv1beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/types/v1beta2/fake"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
@@ -142,6 +146,11 @@ func (c *Clientset) NotificationV2beta1() notificationv2beta1.NotificationV2beta
|
||||
return &fakenotificationv2beta1.FakeNotificationV2beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// NotificationV2beta2 retrieves the NotificationV2beta2Client
|
||||
func (c *Clientset) NotificationV2beta2() notificationv2beta2.NotificationV2beta2Interface {
|
||||
return &fakenotificationv2beta2.FakeNotificationV2beta2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// QuotaV1alpha2 retrieves the QuotaV1alpha2Client
|
||||
func (c *Clientset) QuotaV1alpha2() quotav1alpha2.QuotaV1alpha2Interface {
|
||||
return &fakequotav1alpha2.FakeQuotaV1alpha2{Fake: &c.Fake}
|
||||
@@ -171,3 +180,8 @@ func (c *Clientset) TenantV1alpha2() tenantv1alpha2.TenantV1alpha2Interface {
|
||||
func (c *Clientset) TypesV1beta1() typesv1beta1.TypesV1beta1Interface {
|
||||
return &faketypesv1beta1.FakeTypesV1beta1{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// TypesV1beta2 retrieves the TypesV1beta2Client
|
||||
func (c *Clientset) TypesV1beta2() typesv1beta2.TypesV1beta2Interface {
|
||||
return &faketypesv1beta2.FakeTypesV1beta2{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
@@ -32,12 +32,14 @@ import (
|
||||
iamv1alpha2 "kubesphere.io/api/iam/v1alpha2"
|
||||
networkv1alpha1 "kubesphere.io/api/network/v1alpha1"
|
||||
notificationv2beta1 "kubesphere.io/api/notification/v2beta1"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
quotav1alpha2 "kubesphere.io/api/quota/v1alpha2"
|
||||
servicemeshv1alpha2 "kubesphere.io/api/servicemesh/v1alpha2"
|
||||
storagev1alpha1 "kubesphere.io/api/storage/v1alpha1"
|
||||
tenantv1alpha1 "kubesphere.io/api/tenant/v1alpha1"
|
||||
tenantv1alpha2 "kubesphere.io/api/tenant/v1alpha2"
|
||||
typesv1beta1 "kubesphere.io/api/types/v1beta1"
|
||||
typesv1beta2 "kubesphere.io/api/types/v1beta2"
|
||||
)
|
||||
|
||||
var scheme = runtime.NewScheme()
|
||||
@@ -52,12 +54,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
iamv1alpha2.AddToScheme,
|
||||
networkv1alpha1.AddToScheme,
|
||||
notificationv2beta1.AddToScheme,
|
||||
notificationv2beta2.AddToScheme,
|
||||
quotav1alpha2.AddToScheme,
|
||||
servicemeshv1alpha2.AddToScheme,
|
||||
storagev1alpha1.AddToScheme,
|
||||
tenantv1alpha1.AddToScheme,
|
||||
tenantv1alpha2.AddToScheme,
|
||||
typesv1beta1.AddToScheme,
|
||||
typesv1beta2.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
||||
@@ -32,12 +32,14 @@ import (
|
||||
iamv1alpha2 "kubesphere.io/api/iam/v1alpha2"
|
||||
networkv1alpha1 "kubesphere.io/api/network/v1alpha1"
|
||||
notificationv2beta1 "kubesphere.io/api/notification/v2beta1"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
quotav1alpha2 "kubesphere.io/api/quota/v1alpha2"
|
||||
servicemeshv1alpha2 "kubesphere.io/api/servicemesh/v1alpha2"
|
||||
storagev1alpha1 "kubesphere.io/api/storage/v1alpha1"
|
||||
tenantv1alpha1 "kubesphere.io/api/tenant/v1alpha1"
|
||||
tenantv1alpha2 "kubesphere.io/api/tenant/v1alpha2"
|
||||
typesv1beta1 "kubesphere.io/api/types/v1beta1"
|
||||
typesv1beta2 "kubesphere.io/api/types/v1beta2"
|
||||
)
|
||||
|
||||
var Scheme = runtime.NewScheme()
|
||||
@@ -52,12 +54,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
iamv1alpha2.AddToScheme,
|
||||
networkv1alpha1.AddToScheme,
|
||||
notificationv2beta1.AddToScheme,
|
||||
notificationv2beta2.AddToScheme,
|
||||
quotav1alpha2.AddToScheme,
|
||||
servicemeshv1alpha2.AddToScheme,
|
||||
storagev1alpha1.AddToScheme,
|
||||
tenantv1alpha1.AddToScheme,
|
||||
tenantv1alpha2.AddToScheme,
|
||||
typesv1beta1.AddToScheme,
|
||||
typesv1beta2.AddToScheme,
|
||||
}
|
||||
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
// ConfigsGetter has a method to return a ConfigInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ConfigsGetter interface {
|
||||
Configs() ConfigInterface
|
||||
}
|
||||
|
||||
// ConfigInterface has methods to work with Config resources.
|
||||
type ConfigInterface interface {
|
||||
Create(ctx context.Context, config *v2beta2.Config, opts v1.CreateOptions) (*v2beta2.Config, error)
|
||||
Update(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (*v2beta2.Config, error)
|
||||
UpdateStatus(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (*v2beta2.Config, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.Config, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.ConfigList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Config, err error)
|
||||
ConfigExpansion
|
||||
}
|
||||
|
||||
// configs implements ConfigInterface
|
||||
type configs struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newConfigs returns a Configs
|
||||
func newConfigs(c *NotificationV2beta2Client) *configs {
|
||||
return &configs{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the config, and returns the corresponding config object, and an error if there is any.
|
||||
func (c *configs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Config, err error) {
|
||||
result = &v2beta2.Config{}
|
||||
err = c.client.Get().
|
||||
Resource("configs").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Configs that match those selectors.
|
||||
func (c *configs) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.ConfigList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v2beta2.ConfigList{}
|
||||
err = c.client.Get().
|
||||
Resource("configs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested configs.
|
||||
func (c *configs) Watch(ctx context.Context, opts v1.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().
|
||||
Resource("configs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any.
|
||||
func (c *configs) Create(ctx context.Context, config *v2beta2.Config, opts v1.CreateOptions) (result *v2beta2.Config, err error) {
|
||||
result = &v2beta2.Config{}
|
||||
err = c.client.Post().
|
||||
Resource("configs").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(config).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any.
|
||||
func (c *configs) Update(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (result *v2beta2.Config, err error) {
|
||||
result = &v2beta2.Config{}
|
||||
err = c.client.Put().
|
||||
Resource("configs").
|
||||
Name(config.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(config).
|
||||
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 *configs) UpdateStatus(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (result *v2beta2.Config, err error) {
|
||||
result = &v2beta2.Config{}
|
||||
err = c.client.Put().
|
||||
Resource("configs").
|
||||
Name(config.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(config).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the config and deletes it. Returns an error if one occurs.
|
||||
func (c *configs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("configs").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *configs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("configs").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched config.
|
||||
func (c *configs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Config, err error) {
|
||||
result = &v2beta2.Config{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("configs").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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,133 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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"
|
||||
|
||||
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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// FakeConfigs implements ConfigInterface
|
||||
type FakeConfigs struct {
|
||||
Fake *FakeNotificationV2beta2
|
||||
}
|
||||
|
||||
var configsResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2beta2", Resource: "configs"}
|
||||
|
||||
var configsKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2beta2", Kind: "Config"}
|
||||
|
||||
// Get takes name of the config, and returns the corresponding config object, and an error if there is any.
|
||||
func (c *FakeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Config, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(configsResource, name), &v2beta2.Config{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Config), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Configs that match those selectors.
|
||||
func (c *FakeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.ConfigList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(configsResource, configsKind, opts), &v2beta2.ConfigList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v2beta2.ConfigList{ListMeta: obj.(*v2beta2.ConfigList).ListMeta}
|
||||
for _, item := range obj.(*v2beta2.ConfigList).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 configs.
|
||||
func (c *FakeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(configsResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a config and creates it. Returns the server's representation of the config, and an error, if there is any.
|
||||
func (c *FakeConfigs) Create(ctx context.Context, config *v2beta2.Config, opts v1.CreateOptions) (result *v2beta2.Config, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(configsResource, config), &v2beta2.Config{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Config), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a config and updates it. Returns the server's representation of the config, and an error, if there is any.
|
||||
func (c *FakeConfigs) Update(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (result *v2beta2.Config, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(configsResource, config), &v2beta2.Config{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Config), 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 *FakeConfigs) UpdateStatus(ctx context.Context, config *v2beta2.Config, opts v1.UpdateOptions) (*v2beta2.Config, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(configsResource, "status", config), &v2beta2.Config{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Config), err
|
||||
}
|
||||
|
||||
// Delete takes name of the config and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(configsResource, name), &v2beta2.Config{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(configsResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v2beta2.ConfigList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched config.
|
||||
func (c *FakeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Config, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(configsResource, name, pt, data, subresources...), &v2beta2.Config{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Config), err
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/clientset/versioned/typed/notification/v2beta2"
|
||||
)
|
||||
|
||||
type FakeNotificationV2beta2 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
func (c *FakeNotificationV2beta2) Configs() v2beta2.ConfigInterface {
|
||||
return &FakeConfigs{c}
|
||||
}
|
||||
|
||||
func (c *FakeNotificationV2beta2) Receivers() v2beta2.ReceiverInterface {
|
||||
return &FakeReceivers{c}
|
||||
}
|
||||
|
||||
func (c *FakeNotificationV2beta2) Routers() v2beta2.RouterInterface {
|
||||
return &FakeRouters{c}
|
||||
}
|
||||
|
||||
func (c *FakeNotificationV2beta2) Silences() v2beta2.SilenceInterface {
|
||||
return &FakeSilences{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeNotificationV2beta2) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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"
|
||||
|
||||
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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// FakeReceivers implements ReceiverInterface
|
||||
type FakeReceivers struct {
|
||||
Fake *FakeNotificationV2beta2
|
||||
}
|
||||
|
||||
var receiversResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2beta2", Resource: "receivers"}
|
||||
|
||||
var receiversKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2beta2", Kind: "Receiver"}
|
||||
|
||||
// Get takes name of the receiver, and returns the corresponding receiver object, and an error if there is any.
|
||||
func (c *FakeReceivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Receiver, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(receiversResource, name), &v2beta2.Receiver{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Receivers that match those selectors.
|
||||
func (c *FakeReceivers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.ReceiverList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(receiversResource, receiversKind, opts), &v2beta2.ReceiverList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v2beta2.ReceiverList{ListMeta: obj.(*v2beta2.ReceiverList).ListMeta}
|
||||
for _, item := range obj.(*v2beta2.ReceiverList).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 receivers.
|
||||
func (c *FakeReceivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(receiversResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a receiver and creates it. Returns the server's representation of the receiver, and an error, if there is any.
|
||||
func (c *FakeReceivers) Create(ctx context.Context, receiver *v2beta2.Receiver, opts v1.CreateOptions) (result *v2beta2.Receiver, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(receiversResource, receiver), &v2beta2.Receiver{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a receiver and updates it. Returns the server's representation of the receiver, and an error, if there is any.
|
||||
func (c *FakeReceivers) Update(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (result *v2beta2.Receiver, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(receiversResource, receiver), &v2beta2.Receiver{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), 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 *FakeReceivers) UpdateStatus(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (*v2beta2.Receiver, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(receiversResource, "status", receiver), &v2beta2.Receiver{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), err
|
||||
}
|
||||
|
||||
// Delete takes name of the receiver and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeReceivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(receiversResource, name), &v2beta2.Receiver{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeReceivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(receiversResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v2beta2.ReceiverList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched receiver.
|
||||
func (c *FakeReceivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Receiver, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(receiversResource, name, pt, data, subresources...), &v2beta2.Receiver{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), err
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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"
|
||||
|
||||
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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// FakeRouters implements RouterInterface
|
||||
type FakeRouters struct {
|
||||
Fake *FakeNotificationV2beta2
|
||||
}
|
||||
|
||||
var routersResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2beta2", Resource: "routers"}
|
||||
|
||||
var routersKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2beta2", Kind: "Router"}
|
||||
|
||||
// Get takes name of the router, and returns the corresponding router object, and an error if there is any.
|
||||
func (c *FakeRouters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Router, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(routersResource, name), &v2beta2.Router{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Router), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Routers that match those selectors.
|
||||
func (c *FakeRouters) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.RouterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(routersResource, routersKind, opts), &v2beta2.RouterList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v2beta2.RouterList{ListMeta: obj.(*v2beta2.RouterList).ListMeta}
|
||||
for _, item := range obj.(*v2beta2.RouterList).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 routers.
|
||||
func (c *FakeRouters) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(routersResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a router and creates it. Returns the server's representation of the router, and an error, if there is any.
|
||||
func (c *FakeRouters) Create(ctx context.Context, router *v2beta2.Router, opts v1.CreateOptions) (result *v2beta2.Router, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(routersResource, router), &v2beta2.Router{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Router), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a router and updates it. Returns the server's representation of the router, and an error, if there is any.
|
||||
func (c *FakeRouters) Update(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (result *v2beta2.Router, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(routersResource, router), &v2beta2.Router{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Router), 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 *FakeRouters) UpdateStatus(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (*v2beta2.Router, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(routersResource, "status", router), &v2beta2.Router{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Router), err
|
||||
}
|
||||
|
||||
// Delete takes name of the router and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeRouters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(routersResource, name), &v2beta2.Router{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeRouters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(routersResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v2beta2.RouterList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched router.
|
||||
func (c *FakeRouters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Router, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(routersResource, name, pt, data, subresources...), &v2beta2.Router{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Router), err
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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"
|
||||
|
||||
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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// FakeSilences implements SilenceInterface
|
||||
type FakeSilences struct {
|
||||
Fake *FakeNotificationV2beta2
|
||||
}
|
||||
|
||||
var silencesResource = schema.GroupVersionResource{Group: "notification.kubesphere.io", Version: "v2beta2", Resource: "silences"}
|
||||
|
||||
var silencesKind = schema.GroupVersionKind{Group: "notification.kubesphere.io", Version: "v2beta2", Kind: "Silence"}
|
||||
|
||||
// Get takes name of the silence, and returns the corresponding silence object, and an error if there is any.
|
||||
func (c *FakeSilences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Silence, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootGetAction(silencesResource, name), &v2beta2.Silence{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Silence), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Silences that match those selectors.
|
||||
func (c *FakeSilences) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.SilenceList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootListAction(silencesResource, silencesKind, opts), &v2beta2.SilenceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &v2beta2.SilenceList{ListMeta: obj.(*v2beta2.SilenceList).ListMeta}
|
||||
for _, item := range obj.(*v2beta2.SilenceList).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 silences.
|
||||
func (c *FakeSilences) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewRootWatchAction(silencesResource, opts))
|
||||
}
|
||||
|
||||
// Create takes the representation of a silence and creates it. Returns the server's representation of the silence, and an error, if there is any.
|
||||
func (c *FakeSilences) Create(ctx context.Context, silence *v2beta2.Silence, opts v1.CreateOptions) (result *v2beta2.Silence, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootCreateAction(silencesResource, silence), &v2beta2.Silence{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Silence), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a silence and updates it. Returns the server's representation of the silence, and an error, if there is any.
|
||||
func (c *FakeSilences) Update(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (result *v2beta2.Silence, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateAction(silencesResource, silence), &v2beta2.Silence{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Silence), 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 *FakeSilences) UpdateStatus(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (*v2beta2.Silence, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootUpdateSubresourceAction(silencesResource, "status", silence), &v2beta2.Silence{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Silence), err
|
||||
}
|
||||
|
||||
// Delete takes name of the silence and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeSilences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewRootDeleteAction(silencesResource, name), &v2beta2.Silence{})
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeSilences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewRootDeleteCollectionAction(silencesResource, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &v2beta2.SilenceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched silence.
|
||||
func (c *FakeSilences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Silence, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewRootPatchSubresourceAction(silencesResource, name, pt, data, subresources...), &v2beta2.Silence{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*v2beta2.Silence), err
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
type ConfigExpansion interface{}
|
||||
|
||||
type ReceiverExpansion interface{}
|
||||
|
||||
type RouterExpansion interface{}
|
||||
|
||||
type SilenceExpansion interface{}
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
"kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
type NotificationV2beta2Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
ConfigsGetter
|
||||
ReceiversGetter
|
||||
RoutersGetter
|
||||
SilencesGetter
|
||||
}
|
||||
|
||||
// NotificationV2beta2Client is used to interact with features provided by the notification.kubesphere.io group.
|
||||
type NotificationV2beta2Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
func (c *NotificationV2beta2Client) Configs() ConfigInterface {
|
||||
return newConfigs(c)
|
||||
}
|
||||
|
||||
func (c *NotificationV2beta2Client) Receivers() ReceiverInterface {
|
||||
return newReceivers(c)
|
||||
}
|
||||
|
||||
func (c *NotificationV2beta2Client) Routers() RouterInterface {
|
||||
return newRouters(c)
|
||||
}
|
||||
|
||||
func (c *NotificationV2beta2Client) Silences() SilenceInterface {
|
||||
return newSilences(c)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new NotificationV2beta2Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*NotificationV2beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &NotificationV2beta2Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new NotificationV2beta2Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *NotificationV2beta2Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new NotificationV2beta2Client for the given RESTClient.
|
||||
func New(c rest.Interface) *NotificationV2beta2Client {
|
||||
return &NotificationV2beta2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v2beta2.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 *NotificationV2beta2Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
// ReceiversGetter has a method to return a ReceiverInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ReceiversGetter interface {
|
||||
Receivers() ReceiverInterface
|
||||
}
|
||||
|
||||
// ReceiverInterface has methods to work with Receiver resources.
|
||||
type ReceiverInterface interface {
|
||||
Create(ctx context.Context, receiver *v2beta2.Receiver, opts v1.CreateOptions) (*v2beta2.Receiver, error)
|
||||
Update(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (*v2beta2.Receiver, error)
|
||||
UpdateStatus(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (*v2beta2.Receiver, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.Receiver, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.ReceiverList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Receiver, err error)
|
||||
ReceiverExpansion
|
||||
}
|
||||
|
||||
// receivers implements ReceiverInterface
|
||||
type receivers struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newReceivers returns a Receivers
|
||||
func newReceivers(c *NotificationV2beta2Client) *receivers {
|
||||
return &receivers{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the receiver, and returns the corresponding receiver object, and an error if there is any.
|
||||
func (c *receivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Receiver, err error) {
|
||||
result = &v2beta2.Receiver{}
|
||||
err = c.client.Get().
|
||||
Resource("receivers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Receivers that match those selectors.
|
||||
func (c *receivers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.ReceiverList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v2beta2.ReceiverList{}
|
||||
err = c.client.Get().
|
||||
Resource("receivers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested receivers.
|
||||
func (c *receivers) Watch(ctx context.Context, opts v1.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().
|
||||
Resource("receivers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a receiver and creates it. Returns the server's representation of the receiver, and an error, if there is any.
|
||||
func (c *receivers) Create(ctx context.Context, receiver *v2beta2.Receiver, opts v1.CreateOptions) (result *v2beta2.Receiver, err error) {
|
||||
result = &v2beta2.Receiver{}
|
||||
err = c.client.Post().
|
||||
Resource("receivers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(receiver).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a receiver and updates it. Returns the server's representation of the receiver, and an error, if there is any.
|
||||
func (c *receivers) Update(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (result *v2beta2.Receiver, err error) {
|
||||
result = &v2beta2.Receiver{}
|
||||
err = c.client.Put().
|
||||
Resource("receivers").
|
||||
Name(receiver.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(receiver).
|
||||
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 *receivers) UpdateStatus(ctx context.Context, receiver *v2beta2.Receiver, opts v1.UpdateOptions) (result *v2beta2.Receiver, err error) {
|
||||
result = &v2beta2.Receiver{}
|
||||
err = c.client.Put().
|
||||
Resource("receivers").
|
||||
Name(receiver.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(receiver).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the receiver and deletes it. Returns an error if one occurs.
|
||||
func (c *receivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("receivers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *receivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("receivers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched receiver.
|
||||
func (c *receivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Receiver, err error) {
|
||||
result = &v2beta2.Receiver{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("receivers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
// RoutersGetter has a method to return a RouterInterface.
|
||||
// A group's client should implement this interface.
|
||||
type RoutersGetter interface {
|
||||
Routers() RouterInterface
|
||||
}
|
||||
|
||||
// RouterInterface has methods to work with Router resources.
|
||||
type RouterInterface interface {
|
||||
Create(ctx context.Context, router *v2beta2.Router, opts v1.CreateOptions) (*v2beta2.Router, error)
|
||||
Update(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (*v2beta2.Router, error)
|
||||
UpdateStatus(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (*v2beta2.Router, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.Router, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.RouterList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Router, err error)
|
||||
RouterExpansion
|
||||
}
|
||||
|
||||
// routers implements RouterInterface
|
||||
type routers struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newRouters returns a Routers
|
||||
func newRouters(c *NotificationV2beta2Client) *routers {
|
||||
return &routers{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the router, and returns the corresponding router object, and an error if there is any.
|
||||
func (c *routers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Router, err error) {
|
||||
result = &v2beta2.Router{}
|
||||
err = c.client.Get().
|
||||
Resource("routers").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Routers that match those selectors.
|
||||
func (c *routers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.RouterList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v2beta2.RouterList{}
|
||||
err = c.client.Get().
|
||||
Resource("routers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested routers.
|
||||
func (c *routers) Watch(ctx context.Context, opts v1.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().
|
||||
Resource("routers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a router and creates it. Returns the server's representation of the router, and an error, if there is any.
|
||||
func (c *routers) Create(ctx context.Context, router *v2beta2.Router, opts v1.CreateOptions) (result *v2beta2.Router, err error) {
|
||||
result = &v2beta2.Router{}
|
||||
err = c.client.Post().
|
||||
Resource("routers").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(router).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a router and updates it. Returns the server's representation of the router, and an error, if there is any.
|
||||
func (c *routers) Update(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (result *v2beta2.Router, err error) {
|
||||
result = &v2beta2.Router{}
|
||||
err = c.client.Put().
|
||||
Resource("routers").
|
||||
Name(router.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(router).
|
||||
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 *routers) UpdateStatus(ctx context.Context, router *v2beta2.Router, opts v1.UpdateOptions) (result *v2beta2.Router, err error) {
|
||||
result = &v2beta2.Router{}
|
||||
err = c.client.Put().
|
||||
Resource("routers").
|
||||
Name(router.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(router).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the router and deletes it. Returns an error if one occurs.
|
||||
func (c *routers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("routers").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *routers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("routers").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched router.
|
||||
func (c *routers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Router, err error) {
|
||||
result = &v2beta2.Router{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("routers").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "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"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
scheme "kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
// SilencesGetter has a method to return a SilenceInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SilencesGetter interface {
|
||||
Silences() SilenceInterface
|
||||
}
|
||||
|
||||
// SilenceInterface has methods to work with Silence resources.
|
||||
type SilenceInterface interface {
|
||||
Create(ctx context.Context, silence *v2beta2.Silence, opts v1.CreateOptions) (*v2beta2.Silence, error)
|
||||
Update(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (*v2beta2.Silence, error)
|
||||
UpdateStatus(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (*v2beta2.Silence, error)
|
||||
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.Silence, error)
|
||||
List(ctx context.Context, opts v1.ListOptions) (*v2beta2.SilenceList, error)
|
||||
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Silence, err error)
|
||||
SilenceExpansion
|
||||
}
|
||||
|
||||
// silences implements SilenceInterface
|
||||
type silences struct {
|
||||
client rest.Interface
|
||||
}
|
||||
|
||||
// newSilences returns a Silences
|
||||
func newSilences(c *NotificationV2beta2Client) *silences {
|
||||
return &silences{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the silence, and returns the corresponding silence object, and an error if there is any.
|
||||
func (c *silences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.Silence, err error) {
|
||||
result = &v2beta2.Silence{}
|
||||
err = c.client.Get().
|
||||
Resource("silences").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Silences that match those selectors.
|
||||
func (c *silences) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.SilenceList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v2beta2.SilenceList{}
|
||||
err = c.client.Get().
|
||||
Resource("silences").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested silences.
|
||||
func (c *silences) Watch(ctx context.Context, opts v1.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().
|
||||
Resource("silences").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a silence and creates it. Returns the server's representation of the silence, and an error, if there is any.
|
||||
func (c *silences) Create(ctx context.Context, silence *v2beta2.Silence, opts v1.CreateOptions) (result *v2beta2.Silence, err error) {
|
||||
result = &v2beta2.Silence{}
|
||||
err = c.client.Post().
|
||||
Resource("silences").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(silence).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a silence and updates it. Returns the server's representation of the silence, and an error, if there is any.
|
||||
func (c *silences) Update(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (result *v2beta2.Silence, err error) {
|
||||
result = &v2beta2.Silence{}
|
||||
err = c.client.Put().
|
||||
Resource("silences").
|
||||
Name(silence.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(silence).
|
||||
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 *silences) UpdateStatus(ctx context.Context, silence *v2beta2.Silence, opts v1.UpdateOptions) (result *v2beta2.Silence, err error) {
|
||||
result = &v2beta2.Silence{}
|
||||
err = c.client.Put().
|
||||
Resource("silences").
|
||||
Name(silence.Name).
|
||||
SubResource("status").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(silence).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the silence and deletes it. Returns an error if one occurs.
|
||||
func (c *silences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("silences").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *silences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Resource("silences").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched silence.
|
||||
func (c *silences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.Silence, err error) {
|
||||
result = &v2beta2.Silence{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("silences").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
20
pkg/client/clientset/versioned/typed/types/v1beta2/doc.go
Normal file
20
pkg/client/clientset/versioned/typed/types/v1beta2/doc.go
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v1beta2
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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,35 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 (
|
||||
rest "k8s.io/client-go/rest"
|
||||
testing "k8s.io/client-go/testing"
|
||||
)
|
||||
|
||||
type FakeTypesV1beta2 struct {
|
||||
*testing.Fake
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeTypesV1beta2) RESTClient() rest.Interface {
|
||||
var ret *rest.RESTClient
|
||||
return ret
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v1beta2
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 v1beta2
|
||||
|
||||
import (
|
||||
rest "k8s.io/client-go/rest"
|
||||
v1beta2 "kubesphere.io/api/types/v1beta2"
|
||||
"kubesphere.io/kubesphere/pkg/client/clientset/versioned/scheme"
|
||||
)
|
||||
|
||||
type TypesV1beta2Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
}
|
||||
|
||||
// TypesV1beta2Client is used to interact with features provided by the types.kubefed.io group.
|
||||
type TypesV1beta2Client struct {
|
||||
restClient rest.Interface
|
||||
}
|
||||
|
||||
// NewForConfig creates a new TypesV1beta2Client for the given config.
|
||||
func NewForConfig(c *rest.Config) (*TypesV1beta2Client, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := rest.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &TypesV1beta2Client{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new TypesV1beta2Client for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *rest.Config) *TypesV1beta2Client {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new TypesV1beta2Client for the given RESTClient.
|
||||
func New(c rest.Interface) *TypesV1beta2Client {
|
||||
return &TypesV1beta2Client{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *rest.Config) error {
|
||||
gv := v1beta2.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 *TypesV1beta2Client) RESTClient() rest.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import (
|
||||
v1alpha2 "kubesphere.io/api/iam/v1alpha2"
|
||||
networkv1alpha1 "kubesphere.io/api/network/v1alpha1"
|
||||
v2beta1 "kubesphere.io/api/notification/v2beta1"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
quotav1alpha2 "kubesphere.io/api/quota/v1alpha2"
|
||||
servicemeshv1alpha2 "kubesphere.io/api/servicemesh/v1alpha2"
|
||||
storagev1alpha1 "kubesphere.io/api/storage/v1alpha1"
|
||||
@@ -139,6 +140,16 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
case v2beta1.SchemeGroupVersion.WithResource("receivers"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2beta1().Receivers().Informer()}, nil
|
||||
|
||||
// Group=notification.kubesphere.io, Version=v2beta2
|
||||
case v2beta2.SchemeGroupVersion.WithResource("configs"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2beta2().Configs().Informer()}, nil
|
||||
case v2beta2.SchemeGroupVersion.WithResource("receivers"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2beta2().Receivers().Informer()}, nil
|
||||
case v2beta2.SchemeGroupVersion.WithResource("routers"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2beta2().Routers().Informer()}, nil
|
||||
case v2beta2.SchemeGroupVersion.WithResource("silences"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Notification().V2beta2().Silences().Informer()}, nil
|
||||
|
||||
// Group=quota.kubesphere.io, Version=v1alpha2
|
||||
case quotav1alpha2.SchemeGroupVersion.WithResource("resourcequotas"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Quota().V1alpha2().ResourceQuotas().Informer()}, nil
|
||||
|
||||
@@ -21,12 +21,15 @@ package notification
|
||||
import (
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2beta1 "kubesphere.io/kubesphere/pkg/client/informers/externalversions/notification/v2beta1"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/informers/externalversions/notification/v2beta2"
|
||||
)
|
||||
|
||||
// Interface provides access to each of this group's versions.
|
||||
type Interface interface {
|
||||
// V2beta1 provides access to shared informers for resources in V2beta1.
|
||||
V2beta1() v2beta1.Interface
|
||||
// V2beta2 provides access to shared informers for resources in V2beta2.
|
||||
V2beta2() v2beta2.Interface
|
||||
}
|
||||
|
||||
type group struct {
|
||||
@@ -44,3 +47,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
||||
func (g *group) V2beta1() v2beta1.Interface {
|
||||
return v2beta1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
// V2beta2 returns a new v2beta2.Interface.
|
||||
func (g *group) V2beta2() v2beta2.Interface {
|
||||
return v2beta2.New(g.factory, g.namespace, g.tweakListOptions)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2beta2"
|
||||
)
|
||||
|
||||
// ConfigInformer provides access to a shared informer and lister for
|
||||
// Configs.
|
||||
type ConfigInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v2beta2.ConfigLister
|
||||
}
|
||||
|
||||
type configInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewConfigInformer constructs a new informer for Config type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredConfigInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredConfigInformer constructs a new informer for Config type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredConfigInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Configs().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Configs().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
¬ificationv2beta2.Config{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *configInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredConfigInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *configInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(¬ificationv2beta2.Config{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *configInformer) Lister() v2beta2.ConfigLister {
|
||||
return v2beta2.NewConfigLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
)
|
||||
|
||||
// Interface provides access to all the informers in this group version.
|
||||
type Interface interface {
|
||||
// Configs returns a ConfigInformer.
|
||||
Configs() ConfigInformer
|
||||
// Receivers returns a ReceiverInformer.
|
||||
Receivers() ReceiverInformer
|
||||
// Routers returns a RouterInformer.
|
||||
Routers() RouterInformer
|
||||
// Silences returns a SilenceInformer.
|
||||
Silences() SilenceInformer
|
||||
}
|
||||
|
||||
type version struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
namespace string
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// New returns a new Interface.
|
||||
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||
}
|
||||
|
||||
// Configs returns a ConfigInformer.
|
||||
func (v *version) Configs() ConfigInformer {
|
||||
return &configInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Receivers returns a ReceiverInformer.
|
||||
func (v *version) Receivers() ReceiverInformer {
|
||||
return &receiverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Routers returns a RouterInformer.
|
||||
func (v *version) Routers() RouterInformer {
|
||||
return &routerInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// Silences returns a SilenceInformer.
|
||||
func (v *version) Silences() SilenceInformer {
|
||||
return &silenceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2beta2"
|
||||
)
|
||||
|
||||
// ReceiverInformer provides access to a shared informer and lister for
|
||||
// Receivers.
|
||||
type ReceiverInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v2beta2.ReceiverLister
|
||||
}
|
||||
|
||||
type receiverInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewReceiverInformer constructs a new informer for Receiver type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewReceiverInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredReceiverInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredReceiverInformer constructs a new informer for Receiver type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredReceiverInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Receivers().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Receivers().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
¬ificationv2beta2.Receiver{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *receiverInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredReceiverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *receiverInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(¬ificationv2beta2.Receiver{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *receiverInformer) Lister() v2beta2.ReceiverLister {
|
||||
return v2beta2.NewReceiverLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2beta2"
|
||||
)
|
||||
|
||||
// RouterInformer provides access to a shared informer and lister for
|
||||
// Routers.
|
||||
type RouterInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v2beta2.RouterLister
|
||||
}
|
||||
|
||||
type routerInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewRouterInformer constructs a new informer for Router type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewRouterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredRouterInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredRouterInformer constructs a new informer for Router type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredRouterInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Routers().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Routers().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
¬ificationv2beta2.Router{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *routerInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredRouterInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *routerInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(¬ificationv2beta2.Router{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *routerInformer) Lister() v2beta2.RouterLister {
|
||||
return v2beta2.NewRouterLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 informer-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
watch "k8s.io/apimachinery/pkg/watch"
|
||||
cache "k8s.io/client-go/tools/cache"
|
||||
notificationv2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
versioned "kubesphere.io/kubesphere/pkg/client/clientset/versioned"
|
||||
internalinterfaces "kubesphere.io/kubesphere/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v2beta2 "kubesphere.io/kubesphere/pkg/client/listers/notification/v2beta2"
|
||||
)
|
||||
|
||||
// SilenceInformer provides access to a shared informer and lister for
|
||||
// Silences.
|
||||
type SilenceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v2beta2.SilenceLister
|
||||
}
|
||||
|
||||
type silenceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
}
|
||||
|
||||
// NewSilenceInformer constructs a new informer for Silence type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewSilenceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredSilenceInformer(client, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredSilenceInformer constructs a new informer for Silence type.
|
||||
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||
// one. This reduces memory footprint and number of connections to the server.
|
||||
func NewFilteredSilenceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Silences().List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.NotificationV2beta2().Silences().Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
¬ificationv2beta2.Silence{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *silenceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredSilenceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *silenceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(¬ificationv2beta2.Silence{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *silenceInformer) Lister() v2beta2.SilenceLister {
|
||||
return v2beta2.NewSilenceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
68
pkg/client/listers/notification/v2beta2/config.go
Normal file
68
pkg/client/listers/notification/v2beta2/config.go
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 lister-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// ConfigLister helps list Configs.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type ConfigLister interface {
|
||||
// List lists all Configs in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v2beta2.Config, err error)
|
||||
// Get retrieves the Config from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v2beta2.Config, error)
|
||||
ConfigListerExpansion
|
||||
}
|
||||
|
||||
// configLister implements the ConfigLister interface.
|
||||
type configLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewConfigLister returns a new ConfigLister.
|
||||
func NewConfigLister(indexer cache.Indexer) ConfigLister {
|
||||
return &configLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Configs in the indexer.
|
||||
func (s *configLister) List(selector labels.Selector) (ret []*v2beta2.Config, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v2beta2.Config))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Config from the index for a given name.
|
||||
func (s *configLister) Get(name string) (*v2beta2.Config, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v2beta2.Resource("config"), name)
|
||||
}
|
||||
return obj.(*v2beta2.Config), nil
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 lister-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
// ConfigListerExpansion allows custom methods to be added to
|
||||
// ConfigLister.
|
||||
type ConfigListerExpansion interface{}
|
||||
|
||||
// ReceiverListerExpansion allows custom methods to be added to
|
||||
// ReceiverLister.
|
||||
type ReceiverListerExpansion interface{}
|
||||
|
||||
// RouterListerExpansion allows custom methods to be added to
|
||||
// RouterLister.
|
||||
type RouterListerExpansion interface{}
|
||||
|
||||
// SilenceListerExpansion allows custom methods to be added to
|
||||
// SilenceLister.
|
||||
type SilenceListerExpansion interface{}
|
||||
68
pkg/client/listers/notification/v2beta2/receiver.go
Normal file
68
pkg/client/listers/notification/v2beta2/receiver.go
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 lister-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// ReceiverLister helps list Receivers.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type ReceiverLister interface {
|
||||
// List lists all Receivers in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v2beta2.Receiver, err error)
|
||||
// Get retrieves the Receiver from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v2beta2.Receiver, error)
|
||||
ReceiverListerExpansion
|
||||
}
|
||||
|
||||
// receiverLister implements the ReceiverLister interface.
|
||||
type receiverLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewReceiverLister returns a new ReceiverLister.
|
||||
func NewReceiverLister(indexer cache.Indexer) ReceiverLister {
|
||||
return &receiverLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Receivers in the indexer.
|
||||
func (s *receiverLister) List(selector labels.Selector) (ret []*v2beta2.Receiver, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v2beta2.Receiver))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Receiver from the index for a given name.
|
||||
func (s *receiverLister) Get(name string) (*v2beta2.Receiver, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v2beta2.Resource("receiver"), name)
|
||||
}
|
||||
return obj.(*v2beta2.Receiver), nil
|
||||
}
|
||||
68
pkg/client/listers/notification/v2beta2/router.go
Normal file
68
pkg/client/listers/notification/v2beta2/router.go
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 lister-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// RouterLister helps list Routers.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type RouterLister interface {
|
||||
// List lists all Routers in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v2beta2.Router, err error)
|
||||
// Get retrieves the Router from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v2beta2.Router, error)
|
||||
RouterListerExpansion
|
||||
}
|
||||
|
||||
// routerLister implements the RouterLister interface.
|
||||
type routerLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewRouterLister returns a new RouterLister.
|
||||
func NewRouterLister(indexer cache.Indexer) RouterLister {
|
||||
return &routerLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Routers in the indexer.
|
||||
func (s *routerLister) List(selector labels.Selector) (ret []*v2beta2.Router, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v2beta2.Router))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Router from the index for a given name.
|
||||
func (s *routerLister) Get(name string) (*v2beta2.Router, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v2beta2.Resource("router"), name)
|
||||
}
|
||||
return obj.(*v2beta2.Router), nil
|
||||
}
|
||||
68
pkg/client/listers/notification/v2beta2/silence.go
Normal file
68
pkg/client/listers/notification/v2beta2/silence.go
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
Copyright 2020 The KubeSphere 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 lister-gen. DO NOT EDIT.
|
||||
|
||||
package v2beta2
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
v2beta2 "kubesphere.io/api/notification/v2beta2"
|
||||
)
|
||||
|
||||
// SilenceLister helps list Silences.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type SilenceLister interface {
|
||||
// List lists all Silences in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v2beta2.Silence, err error)
|
||||
// Get retrieves the Silence from the index for a given name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v2beta2.Silence, error)
|
||||
SilenceListerExpansion
|
||||
}
|
||||
|
||||
// silenceLister implements the SilenceLister interface.
|
||||
type silenceLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewSilenceLister returns a new SilenceLister.
|
||||
func NewSilenceLister(indexer cache.Indexer) SilenceLister {
|
||||
return &silenceLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all Silences in the indexer.
|
||||
func (s *silenceLister) List(selector labels.Selector) (ret []*v2beta2.Silence, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v2beta2.Silence))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the Silence from the index for a given name.
|
||||
func (s *silenceLister) Get(name string) (*v2beta2.Silence, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v2beta2.Resource("silence"), name)
|
||||
}
|
||||
return obj.(*v2beta2.Silence), nil
|
||||
}
|
||||
Reference in New Issue
Block a user