mirror of
https://github.com/rancher/types.git
synced 2025-08-31 21:00:16 +00:00
update generated code for alerting
This commit is contained in:
@@ -0,0 +1,252 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterAlertGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterAlert",
|
||||
}
|
||||
ClusterAlertResource = metav1.APIResource{
|
||||
Name: "clusteralerts",
|
||||
SingularName: "clusteralert",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: ClusterAlertGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ClusterAlertList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterAlert
|
||||
}
|
||||
|
||||
type ClusterAlertHandlerFunc func(key string, obj *ClusterAlert) error
|
||||
|
||||
type ClusterAlertLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*ClusterAlert, err error)
|
||||
Get(namespace, name string) (*ClusterAlert, error)
|
||||
}
|
||||
|
||||
type ClusterAlertController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ClusterAlertLister
|
||||
AddHandler(name string, handler ClusterAlertHandlerFunc)
|
||||
AddClusterScopedHandler(name, clusterName string, handler ClusterAlertHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterAlertInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*ClusterAlert) (*ClusterAlert, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterAlert, error)
|
||||
Update(*ClusterAlert) (*ClusterAlert, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterAlertList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterAlertController
|
||||
AddHandler(name string, sync ClusterAlertHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ClusterAlertLifecycle)
|
||||
AddClusterScopedHandler(name, clusterName string, sync ClusterAlertHandlerFunc)
|
||||
AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterAlertLifecycle)
|
||||
}
|
||||
|
||||
type clusterAlertLister struct {
|
||||
controller *clusterAlertController
|
||||
}
|
||||
|
||||
func (l *clusterAlertLister) List(namespace string, selector labels.Selector) (ret []*ClusterAlert, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*ClusterAlert))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *clusterAlertLister) Get(namespace, name string) (*ClusterAlert, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: ClusterAlertGroupVersionKind.Group,
|
||||
Resource: "clusterAlert",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*ClusterAlert), nil
|
||||
}
|
||||
|
||||
type clusterAlertController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterAlertController) Lister() ClusterAlertLister {
|
||||
return &clusterAlertLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *clusterAlertController) AddHandler(name string, handler ClusterAlertHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ClusterAlert))
|
||||
})
|
||||
}
|
||||
|
||||
func (c *clusterAlertController) AddClusterScopedHandler(name, cluster string, handler ClusterAlertHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
|
||||
if !controller.ObjectInCluster(cluster, obj) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return handler(key, obj.(*ClusterAlert))
|
||||
})
|
||||
}
|
||||
|
||||
type clusterAlertFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterAlertFactory) Object() runtime.Object {
|
||||
return &ClusterAlert{}
|
||||
}
|
||||
|
||||
func (c clusterAlertFactory) List() runtime.Object {
|
||||
return &ClusterAlertList{}
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Controller() ClusterAlertController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterAlertControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterAlertGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterAlertController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterAlertControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterAlertClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ClusterAlertController
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Create(o *ClusterAlert) (*ClusterAlert, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterAlert), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Get(name string, opts metav1.GetOptions) (*ClusterAlert, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterAlert), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAlert, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*ClusterAlert), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Update(o *ClusterAlert) (*ClusterAlert, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterAlert), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) List(opts metav1.ListOptions) (*ClusterAlertList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterAlertList), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *clusterAlertClient) Patch(o *ClusterAlert, data []byte, subresources ...string) (*ClusterAlert, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
|
||||
return obj.(*ClusterAlert), err
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) AddHandler(name string, sync ClusterAlertHandlerFunc) {
|
||||
s.Controller().AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) AddLifecycle(name string, lifecycle ClusterAlertLifecycle) {
|
||||
sync := NewClusterAlertLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) AddClusterScopedHandler(name, clusterName string, sync ClusterAlertHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAlertClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterAlertLifecycle) {
|
||||
sync := NewClusterAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type ClusterAlertLifecycle interface {
|
||||
Create(obj *ClusterAlert) (*ClusterAlert, error)
|
||||
Remove(obj *ClusterAlert) (*ClusterAlert, error)
|
||||
Updated(obj *ClusterAlert) (*ClusterAlert, error)
|
||||
}
|
||||
|
||||
type clusterAlertLifecycleAdapter struct {
|
||||
lifecycle ClusterAlertLifecycle
|
||||
}
|
||||
|
||||
func (w *clusterAlertLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*ClusterAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterAlertLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*ClusterAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterAlertLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*ClusterAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewClusterAlertLifecycleAdapter(name string, clusterScoped bool, client ClusterAlertInterface, l ClusterAlertLifecycle) ClusterAlertHandlerFunc {
|
||||
adapter := &clusterAlertLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterAlert) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@@ -23,6 +23,14 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*Action).DeepCopyInto(out.(*Action))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Action{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AlertCommonSpec).DeepCopyInto(out.(*AlertCommonSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&AlertCommonSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AlertStatus).DeepCopyInto(out.(*AlertStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&AlertStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*AuthConfig).DeepCopyInto(out.(*AuthConfig))
|
||||
return nil
|
||||
@@ -71,6 +79,18 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*Cluster).DeepCopyInto(out.(*Cluster))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Cluster{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterAlert).DeepCopyInto(out.(*ClusterAlert))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterAlert{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterAlertList).DeepCopyInto(out.(*ClusterAlertList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterAlertList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterAlertSpec).DeepCopyInto(out.(*ClusterAlertSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ClusterAlertSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ClusterComponentStatus).DeepCopyInto(out.(*ClusterComponentStatus))
|
||||
return nil
|
||||
@@ -359,6 +379,30 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*NetworkConfig).DeepCopyInto(out.(*NetworkConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&NetworkConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Notification).DeepCopyInto(out.(*Notification))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Notification{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Notifier).DeepCopyInto(out.(*Notifier))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Notifier{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*NotifierList).DeepCopyInto(out.(*NotifierList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&NotifierList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*NotifierSpec).DeepCopyInto(out.(*NotifierSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&NotifierSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*NotifierStatus).DeepCopyInto(out.(*NotifierStatus))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&NotifierStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PagerdutyConfig).DeepCopyInto(out.(*PagerdutyConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&PagerdutyConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*PodSecurityPolicyTemplate).DeepCopyInto(out.(*PodSecurityPolicyTemplate))
|
||||
return nil
|
||||
@@ -391,6 +435,18 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*Project).DeepCopyInto(out.(*Project))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Project{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectAlert).DeepCopyInto(out.(*ProjectAlert))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectAlert{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectAlertList).DeepCopyInto(out.(*ProjectAlertList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectAlertList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectAlertSpec).DeepCopyInto(out.(*ProjectAlertSpec))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&ProjectAlertSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*ProjectCondition).DeepCopyInto(out.(*ProjectCondition))
|
||||
return nil
|
||||
@@ -447,6 +503,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*RancherKubernetesEngineConfig).DeepCopyInto(out.(*RancherKubernetesEngineConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RancherKubernetesEngineConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Recipient).DeepCopyInto(out.(*Recipient))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&Recipient{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*RoleTemplate).DeepCopyInto(out.(*RoleTemplate))
|
||||
return nil
|
||||
@@ -455,6 +515,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*RoleTemplateList).DeepCopyInto(out.(*RoleTemplateList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&RoleTemplateList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*SMTPConfig).DeepCopyInto(out.(*SMTPConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&SMTPConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*SchedulerService).DeepCopyInto(out.(*SchedulerService))
|
||||
return nil
|
||||
@@ -475,6 +539,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*SettingList).DeepCopyInto(out.(*SettingList))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&SettingList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*SlackConfig).DeepCopyInto(out.(*SlackConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&SlackConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*SplunkConfig).DeepCopyInto(out.(*SplunkConfig))
|
||||
return nil
|
||||
@@ -483,6 +551,26 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*SyslogConfig).DeepCopyInto(out.(*SyslogConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&SyslogConfig{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TargetEvent).DeepCopyInto(out.(*TargetEvent))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TargetEvent{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TargetNode).DeepCopyInto(out.(*TargetNode))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TargetNode{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TargetPod).DeepCopyInto(out.(*TargetPod))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TargetPod{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TargetSystemService).DeepCopyInto(out.(*TargetSystemService))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TargetSystemService{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*TargetWorkload).DeepCopyInto(out.(*TargetWorkload))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&TargetWorkload{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*Template).DeepCopyInto(out.(*Template))
|
||||
return nil
|
||||
@@ -539,6 +627,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
in.(*VersionCommits).DeepCopyInto(out.(*VersionCommits))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&VersionCommits{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
in.(*WebhookConfig).DeepCopyInto(out.(*WebhookConfig))
|
||||
return nil
|
||||
}, InType: reflect.TypeOf(&WebhookConfig{})},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -558,6 +650,43 @@ func (in *Action) DeepCopy() *Action {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AlertCommonSpec) DeepCopyInto(out *AlertCommonSpec) {
|
||||
*out = *in
|
||||
if in.Recipients != nil {
|
||||
in, out := &in.Recipients, &out.Recipients
|
||||
*out = make([]Recipient, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertCommonSpec.
|
||||
func (in *AlertCommonSpec) DeepCopy() *AlertCommonSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AlertCommonSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AlertStatus) DeepCopyInto(out *AlertStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertStatus.
|
||||
func (in *AlertStatus) DeepCopy() *AlertStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AlertStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuthConfig) DeepCopyInto(out *AuthConfig) {
|
||||
*out = *in
|
||||
@@ -858,6 +987,90 @@ func (in *Cluster) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterAlert) DeepCopyInto(out *ClusterAlert) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlert.
|
||||
func (in *ClusterAlert) DeepCopy() *ClusterAlert {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterAlert)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterAlert) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterAlertList) DeepCopyInto(out *ClusterAlertList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterAlert, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertList.
|
||||
func (in *ClusterAlertList) DeepCopy() *ClusterAlertList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterAlertList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterAlertList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterAlertSpec) DeepCopyInto(out *ClusterAlertSpec) {
|
||||
*out = *in
|
||||
in.AlertCommonSpec.DeepCopyInto(&out.AlertCommonSpec)
|
||||
in.TargetNode.DeepCopyInto(&out.TargetNode)
|
||||
out.TargetSystemService = in.TargetSystemService
|
||||
out.TargetEvent = in.TargetEvent
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAlertSpec.
|
||||
func (in *ClusterAlertSpec) DeepCopy() *ClusterAlertSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterAlertSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterComponentStatus) DeepCopyInto(out *ClusterComponentStatus) {
|
||||
*out = *in
|
||||
@@ -2892,6 +3105,206 @@ func (in *NetworkConfig) DeepCopy() *NetworkConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Notification) DeepCopyInto(out *Notification) {
|
||||
*out = *in
|
||||
if in.SMTPConfig != nil {
|
||||
in, out := &in.SMTPConfig, &out.SMTPConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(SMTPConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.SlackConfig != nil {
|
||||
in, out := &in.SlackConfig, &out.SlackConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(SlackConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.PagerdutyConfig != nil {
|
||||
in, out := &in.PagerdutyConfig, &out.PagerdutyConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PagerdutyConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.WebhookConfig != nil {
|
||||
in, out := &in.WebhookConfig, &out.WebhookConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(WebhookConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Notification.
|
||||
func (in *Notification) DeepCopy() *Notification {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Notification)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Notifier) DeepCopyInto(out *Notifier) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Notifier.
|
||||
func (in *Notifier) DeepCopy() *Notifier {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Notifier)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *Notifier) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NotifierList) DeepCopyInto(out *NotifierList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Notifier, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierList.
|
||||
func (in *NotifierList) DeepCopy() *NotifierList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NotifierList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *NotifierList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NotifierSpec) DeepCopyInto(out *NotifierSpec) {
|
||||
*out = *in
|
||||
if in.SMTPConfig != nil {
|
||||
in, out := &in.SMTPConfig, &out.SMTPConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(SMTPConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.SlackConfig != nil {
|
||||
in, out := &in.SlackConfig, &out.SlackConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(SlackConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.PagerdutyConfig != nil {
|
||||
in, out := &in.PagerdutyConfig, &out.PagerdutyConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(PagerdutyConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
if in.WebhookConfig != nil {
|
||||
in, out := &in.WebhookConfig, &out.WebhookConfig
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(WebhookConfig)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierSpec.
|
||||
func (in *NotifierSpec) DeepCopy() *NotifierSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NotifierSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *NotifierStatus) DeepCopyInto(out *NotifierStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotifierStatus.
|
||||
func (in *NotifierStatus) DeepCopy() *NotifierStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(NotifierStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PagerdutyConfig) DeepCopyInto(out *PagerdutyConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerdutyConfig.
|
||||
func (in *PagerdutyConfig) DeepCopy() *PagerdutyConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PagerdutyConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PodSecurityPolicyTemplate) DeepCopyInto(out *PodSecurityPolicyTemplate) {
|
||||
*out = *in
|
||||
@@ -3130,6 +3543,89 @@ func (in *Project) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectAlert) DeepCopyInto(out *ProjectAlert) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlert.
|
||||
func (in *ProjectAlert) DeepCopy() *ProjectAlert {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectAlert)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectAlert) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectAlertList) DeepCopyInto(out *ProjectAlertList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ProjectAlert, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertList.
|
||||
func (in *ProjectAlertList) DeepCopy() *ProjectAlertList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectAlertList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProjectAlertList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectAlertSpec) DeepCopyInto(out *ProjectAlertSpec) {
|
||||
*out = *in
|
||||
in.AlertCommonSpec.DeepCopyInto(&out.AlertCommonSpec)
|
||||
in.TargetWorkload.DeepCopyInto(&out.TargetWorkload)
|
||||
out.TargetPod = in.TargetPod
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectAlertSpec.
|
||||
func (in *ProjectAlertSpec) DeepCopy() *ProjectAlertSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectAlertSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectCondition) DeepCopyInto(out *ProjectCondition) {
|
||||
*out = *in
|
||||
@@ -3481,6 +3977,22 @@ func (in *RancherKubernetesEngineConfig) DeepCopy() *RancherKubernetesEngineConf
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Recipient) DeepCopyInto(out *Recipient) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Recipient.
|
||||
func (in *Recipient) DeepCopy() *Recipient {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(Recipient)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *RoleTemplate) DeepCopyInto(out *RoleTemplate) {
|
||||
*out = *in
|
||||
@@ -3554,6 +4066,22 @@ func (in *RoleTemplateList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SMTPConfig) DeepCopyInto(out *SMTPConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SMTPConfig.
|
||||
func (in *SMTPConfig) DeepCopy() *SMTPConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SMTPConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SchedulerService) DeepCopyInto(out *SchedulerService) {
|
||||
*out = *in
|
||||
@@ -3664,6 +4192,22 @@ func (in *SettingList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SlackConfig) DeepCopyInto(out *SlackConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfig.
|
||||
func (in *SlackConfig) DeepCopy() *SlackConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SlackConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SplunkConfig) DeepCopyInto(out *SplunkConfig) {
|
||||
*out = *in
|
||||
@@ -3696,6 +4240,100 @@ func (in *SyslogConfig) DeepCopy() *SyslogConfig {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetEvent) DeepCopyInto(out *TargetEvent) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetEvent.
|
||||
func (in *TargetEvent) DeepCopy() *TargetEvent {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetEvent)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetNode) DeepCopyInto(out *TargetNode) {
|
||||
*out = *in
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetNode.
|
||||
func (in *TargetNode) DeepCopy() *TargetNode {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetNode)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetPod) DeepCopyInto(out *TargetPod) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetPod.
|
||||
func (in *TargetPod) DeepCopy() *TargetPod {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetPod)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetSystemService) DeepCopyInto(out *TargetSystemService) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetSystemService.
|
||||
func (in *TargetSystemService) DeepCopy() *TargetSystemService {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetSystemService)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TargetWorkload) DeepCopyInto(out *TargetWorkload) {
|
||||
*out = *in
|
||||
if in.Selector != nil {
|
||||
in, out := &in.Selector, &out.Selector
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetWorkload.
|
||||
func (in *TargetWorkload) DeepCopy() *TargetWorkload {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(TargetWorkload)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Template) DeepCopyInto(out *Template) {
|
||||
*out = *in
|
||||
@@ -4111,3 +4749,19 @@ func (in *VersionCommits) DeepCopy() *VersionCommits {
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *WebhookConfig) DeepCopyInto(out *WebhookConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookConfig.
|
||||
func (in *WebhookConfig) DeepCopy() *WebhookConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(WebhookConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
@@ -42,6 +42,9 @@ type Interface interface {
|
||||
ProjectLoggingsGetter
|
||||
ListenConfigsGetter
|
||||
SettingsGetter
|
||||
NotifiersGetter
|
||||
ClusterAlertsGetter
|
||||
ProjectAlertsGetter
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@@ -77,6 +80,9 @@ type Client struct {
|
||||
projectLoggingControllers map[string]ProjectLoggingController
|
||||
listenConfigControllers map[string]ListenConfigController
|
||||
settingControllers map[string]SettingController
|
||||
notifierControllers map[string]NotifierController
|
||||
clusterAlertControllers map[string]ClusterAlertController
|
||||
projectAlertControllers map[string]ProjectAlertController
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
@@ -121,6 +127,9 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
projectLoggingControllers: map[string]ProjectLoggingController{},
|
||||
listenConfigControllers: map[string]ListenConfigController{},
|
||||
settingControllers: map[string]SettingController{},
|
||||
notifierControllers: map[string]NotifierController{},
|
||||
clusterAlertControllers: map[string]ClusterAlertController{},
|
||||
projectAlertControllers: map[string]ProjectAlertController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -499,3 +508,42 @@ func (c *Client) Settings(namespace string) SettingInterface {
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type NotifiersGetter interface {
|
||||
Notifiers(namespace string) NotifierInterface
|
||||
}
|
||||
|
||||
func (c *Client) Notifiers(namespace string) NotifierInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NotifierResource, NotifierGroupVersionKind, notifierFactory{})
|
||||
return ¬ifierClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterAlertsGetter interface {
|
||||
ClusterAlerts(namespace string) ClusterAlertInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterAlerts(namespace string) ClusterAlertInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterAlertResource, ClusterAlertGroupVersionKind, clusterAlertFactory{})
|
||||
return &clusterAlertClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ProjectAlertsGetter interface {
|
||||
ProjectAlerts(namespace string) ProjectAlertInterface
|
||||
}
|
||||
|
||||
func (c *Client) ProjectAlerts(namespace string) ProjectAlertInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ProjectAlertResource, ProjectAlertGroupVersionKind, projectAlertFactory{})
|
||||
return &projectAlertClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
252
apis/management.cattle.io/v3/zz_generated_notifier_controller.go
Normal file
252
apis/management.cattle.io/v3/zz_generated_notifier_controller.go
Normal file
@@ -0,0 +1,252 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
NotifierGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "Notifier",
|
||||
}
|
||||
NotifierResource = metav1.APIResource{
|
||||
Name: "notifiers",
|
||||
SingularName: "notifier",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: NotifierGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type NotifierList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []Notifier
|
||||
}
|
||||
|
||||
type NotifierHandlerFunc func(key string, obj *Notifier) error
|
||||
|
||||
type NotifierLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*Notifier, err error)
|
||||
Get(namespace, name string) (*Notifier, error)
|
||||
}
|
||||
|
||||
type NotifierController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() NotifierLister
|
||||
AddHandler(name string, handler NotifierHandlerFunc)
|
||||
AddClusterScopedHandler(name, clusterName string, handler NotifierHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type NotifierInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*Notifier) (*Notifier, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error)
|
||||
Get(name string, opts metav1.GetOptions) (*Notifier, error)
|
||||
Update(*Notifier) (*Notifier, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*NotifierList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() NotifierController
|
||||
AddHandler(name string, sync NotifierHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle NotifierLifecycle)
|
||||
AddClusterScopedHandler(name, clusterName string, sync NotifierHandlerFunc)
|
||||
AddClusterScopedLifecycle(name, clusterName string, lifecycle NotifierLifecycle)
|
||||
}
|
||||
|
||||
type notifierLister struct {
|
||||
controller *notifierController
|
||||
}
|
||||
|
||||
func (l *notifierLister) List(namespace string, selector labels.Selector) (ret []*Notifier, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*Notifier))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *notifierLister) Get(namespace, name string) (*Notifier, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: NotifierGroupVersionKind.Group,
|
||||
Resource: "notifier",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*Notifier), nil
|
||||
}
|
||||
|
||||
type notifierController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *notifierController) Lister() NotifierLister {
|
||||
return ¬ifierLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *notifierController) AddHandler(name string, handler NotifierHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*Notifier))
|
||||
})
|
||||
}
|
||||
|
||||
func (c *notifierController) AddClusterScopedHandler(name, cluster string, handler NotifierHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
|
||||
if !controller.ObjectInCluster(cluster, obj) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return handler(key, obj.(*Notifier))
|
||||
})
|
||||
}
|
||||
|
||||
type notifierFactory struct {
|
||||
}
|
||||
|
||||
func (c notifierFactory) Object() runtime.Object {
|
||||
return &Notifier{}
|
||||
}
|
||||
|
||||
func (c notifierFactory) List() runtime.Object {
|
||||
return &NotifierList{}
|
||||
}
|
||||
|
||||
func (s *notifierClient) Controller() NotifierController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.notifierControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(NotifierGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = ¬ifierController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.notifierControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type notifierClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller NotifierController
|
||||
}
|
||||
|
||||
func (s *notifierClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *notifierClient) Create(o *Notifier) (*Notifier, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*Notifier), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) Get(name string, opts metav1.GetOptions) (*Notifier, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*Notifier), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Notifier, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*Notifier), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) Update(o *Notifier) (*Notifier, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*Notifier), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *notifierClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *notifierClient) List(opts metav1.ListOptions) (*NotifierList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*NotifierList), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *notifierClient) Patch(o *Notifier, data []byte, subresources ...string) (*Notifier, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
|
||||
return obj.(*Notifier), err
|
||||
}
|
||||
|
||||
func (s *notifierClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *notifierClient) AddHandler(name string, sync NotifierHandlerFunc) {
|
||||
s.Controller().AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *notifierClient) AddLifecycle(name string, lifecycle NotifierLifecycle) {
|
||||
sync := NewNotifierLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *notifierClient) AddClusterScopedHandler(name, clusterName string, sync NotifierHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *notifierClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle NotifierLifecycle) {
|
||||
sync := NewNotifierLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type NotifierLifecycle interface {
|
||||
Create(obj *Notifier) (*Notifier, error)
|
||||
Remove(obj *Notifier) (*Notifier, error)
|
||||
Updated(obj *Notifier) (*Notifier, error)
|
||||
}
|
||||
|
||||
type notifierLifecycleAdapter struct {
|
||||
lifecycle NotifierLifecycle
|
||||
}
|
||||
|
||||
func (w *notifierLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*Notifier))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *notifierLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*Notifier))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *notifierLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*Notifier))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewNotifierLifecycleAdapter(name string, clusterScoped bool, client NotifierInterface, l NotifierLifecycle) NotifierHandlerFunc {
|
||||
adapter := ¬ifierLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *Notifier) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@@ -0,0 +1,252 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ProjectAlertGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ProjectAlert",
|
||||
}
|
||||
ProjectAlertResource = metav1.APIResource{
|
||||
Name: "projectalerts",
|
||||
SingularName: "projectalert",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: ProjectAlertGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ProjectAlertList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ProjectAlert
|
||||
}
|
||||
|
||||
type ProjectAlertHandlerFunc func(key string, obj *ProjectAlert) error
|
||||
|
||||
type ProjectAlertLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*ProjectAlert, err error)
|
||||
Get(namespace, name string) (*ProjectAlert, error)
|
||||
}
|
||||
|
||||
type ProjectAlertController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ProjectAlertLister
|
||||
AddHandler(name string, handler ProjectAlertHandlerFunc)
|
||||
AddClusterScopedHandler(name, clusterName string, handler ProjectAlertHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ProjectAlertInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*ProjectAlert) (*ProjectAlert, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ProjectAlert, error)
|
||||
Update(*ProjectAlert) (*ProjectAlert, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ProjectAlertList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ProjectAlertController
|
||||
AddHandler(name string, sync ProjectAlertHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ProjectAlertLifecycle)
|
||||
AddClusterScopedHandler(name, clusterName string, sync ProjectAlertHandlerFunc)
|
||||
AddClusterScopedLifecycle(name, clusterName string, lifecycle ProjectAlertLifecycle)
|
||||
}
|
||||
|
||||
type projectAlertLister struct {
|
||||
controller *projectAlertController
|
||||
}
|
||||
|
||||
func (l *projectAlertLister) List(namespace string, selector labels.Selector) (ret []*ProjectAlert, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*ProjectAlert))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *projectAlertLister) Get(namespace, name string) (*ProjectAlert, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: ProjectAlertGroupVersionKind.Group,
|
||||
Resource: "projectAlert",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*ProjectAlert), nil
|
||||
}
|
||||
|
||||
type projectAlertController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *projectAlertController) Lister() ProjectAlertLister {
|
||||
return &projectAlertLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *projectAlertController) AddHandler(name string, handler ProjectAlertHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ProjectAlert))
|
||||
})
|
||||
}
|
||||
|
||||
func (c *projectAlertController) AddClusterScopedHandler(name, cluster string, handler ProjectAlertHandlerFunc) {
|
||||
c.GenericController.AddHandler(name, func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
|
||||
if !controller.ObjectInCluster(cluster, obj) {
|
||||
return nil
|
||||
}
|
||||
|
||||
return handler(key, obj.(*ProjectAlert))
|
||||
})
|
||||
}
|
||||
|
||||
type projectAlertFactory struct {
|
||||
}
|
||||
|
||||
func (c projectAlertFactory) Object() runtime.Object {
|
||||
return &ProjectAlert{}
|
||||
}
|
||||
|
||||
func (c projectAlertFactory) List() runtime.Object {
|
||||
return &ProjectAlertList{}
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Controller() ProjectAlertController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.projectAlertControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ProjectAlertGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &projectAlertController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.projectAlertControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type projectAlertClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ProjectAlertController
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Create(o *ProjectAlert) (*ProjectAlert, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ProjectAlert), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Get(name string, opts metav1.GetOptions) (*ProjectAlert, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ProjectAlert), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ProjectAlert, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*ProjectAlert), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Update(o *ProjectAlert) (*ProjectAlert, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ProjectAlert), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) List(opts metav1.ListOptions) (*ProjectAlertList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ProjectAlertList), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *projectAlertClient) Patch(o *ProjectAlert, data []byte, subresources ...string) (*ProjectAlert, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
|
||||
return obj.(*ProjectAlert), err
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) AddHandler(name string, sync ProjectAlertHandlerFunc) {
|
||||
s.Controller().AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) AddLifecycle(name string, lifecycle ProjectAlertLifecycle) {
|
||||
sync := NewProjectAlertLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) AddClusterScopedHandler(name, clusterName string, sync ProjectAlertHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *projectAlertClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ProjectAlertLifecycle) {
|
||||
sync := NewProjectAlertLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type ProjectAlertLifecycle interface {
|
||||
Create(obj *ProjectAlert) (*ProjectAlert, error)
|
||||
Remove(obj *ProjectAlert) (*ProjectAlert, error)
|
||||
Updated(obj *ProjectAlert) (*ProjectAlert, error)
|
||||
}
|
||||
|
||||
type projectAlertLifecycleAdapter struct {
|
||||
lifecycle ProjectAlertLifecycle
|
||||
}
|
||||
|
||||
func (w *projectAlertLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*ProjectAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *projectAlertLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*ProjectAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *projectAlertLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*ProjectAlert))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewProjectAlertLifecycleAdapter(name string, clusterScoped bool, client ProjectAlertInterface, l ProjectAlertLifecycle) ProjectAlertHandlerFunc {
|
||||
adapter := &projectAlertLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ProjectAlert) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@@ -89,6 +89,12 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&ListenConfigList{},
|
||||
&Setting{},
|
||||
&SettingList{},
|
||||
&Notifier{},
|
||||
&NotifierList{},
|
||||
&ClusterAlert{},
|
||||
&ClusterAlertList{},
|
||||
&ProjectAlert{},
|
||||
&ProjectAlertList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user