1
0
mirror of https://github.com/rancher/types.git synced 2025-06-21 03:11:54 +00:00

Update generated code

This commit is contained in:
Darren Shepherd 2020-01-31 09:35:13 -07:00
parent 8b60834be8
commit cd3f5475fc
10 changed files with 18 additions and 2613 deletions

View File

@ -3594,6 +3594,20 @@ func (in *GithubConfig) DeepCopyInto(out *GithubConfig) {
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.AuthConfig.DeepCopyInto(&out.AuthConfig)
if in.AdditionalClientIDs != nil {
in, out := &in.AdditionalClientIDs, &out.AdditionalClientIDs
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.HostnameToClientID != nil {
in, out := &in.HostnameToClientID, &out.HostnameToClientID
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
@ -4819,92 +4833,6 @@ func (in *ListOpts) DeepCopy() *ListOpts {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ListenConfig) DeepCopyInto(out *ListenConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
if in.Domains != nil {
in, out := &in.Domains, &out.Domains
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.TOS != nil {
in, out := &in.TOS, &out.TOS
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.KnownIPs != nil {
in, out := &in.KnownIPs, &out.KnownIPs
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.GeneratedCerts != nil {
in, out := &in.GeneratedCerts, &out.GeneratedCerts
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
if in.SubjectAlternativeNames != nil {
in, out := &in.SubjectAlternativeNames, &out.SubjectAlternativeNames
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenConfig.
func (in *ListenConfig) DeepCopy() *ListenConfig {
if in == nil {
return nil
}
out := new(ListenConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ListenConfig) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ListenConfigList) DeepCopyInto(out *ListenConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ListenConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenConfigList.
func (in *ListenConfigList) DeepCopy() *ListenConfigList {
if in == nil {
return nil
}
out := new(ListenConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ListenConfigList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoadBalancerCapabilities) DeepCopyInto(out *LoadBalancerCapabilities) {
*out = *in

View File

@ -53,7 +53,6 @@ type Interface interface {
ProjectNetworkPoliciesGetter
ClusterLoggingsGetter
ProjectLoggingsGetter
ListenConfigsGetter
SettingsGetter
FeaturesGetter
ClusterAlertsGetter
@ -122,7 +121,6 @@ type Clients struct {
ProjectNetworkPolicy ProjectNetworkPolicyClient
ClusterLogging ClusterLoggingClient
ProjectLogging ProjectLoggingClient
ListenConfig ListenConfigClient
Setting SettingClient
Feature FeatureClient
ClusterAlert ClusterAlertClient
@ -193,7 +191,6 @@ type Client struct {
projectNetworkPolicyControllers map[string]ProjectNetworkPolicyController
clusterLoggingControllers map[string]ClusterLoggingController
projectLoggingControllers map[string]ProjectLoggingController
listenConfigControllers map[string]ListenConfigController
settingControllers map[string]SettingController
featureControllers map[string]FeatureController
clusterAlertControllers map[string]ClusterAlertController
@ -358,9 +355,6 @@ func NewClientsFromInterface(iface Interface) *Clients {
ProjectLogging: &projectLoggingClient2{
iface: iface.ProjectLoggings(""),
},
ListenConfig: &listenConfigClient2{
iface: iface.ListenConfigs(""),
},
Setting: &settingClient2{
iface: iface.Settings(""),
},
@ -500,7 +494,6 @@ func NewForConfig(config rest.Config) (Interface, error) {
projectNetworkPolicyControllers: map[string]ProjectNetworkPolicyController{},
clusterLoggingControllers: map[string]ClusterLoggingController{},
projectLoggingControllers: map[string]ProjectLoggingController{},
listenConfigControllers: map[string]ListenConfigController{},
settingControllers: map[string]SettingController{},
featureControllers: map[string]FeatureController{},
clusterAlertControllers: map[string]ClusterAlertController{},
@ -975,19 +968,6 @@ func (c *Client) ProjectLoggings(namespace string) ProjectLoggingInterface {
}
}
type ListenConfigsGetter interface {
ListenConfigs(namespace string) ListenConfigInterface
}
func (c *Client) ListenConfigs(namespace string) ListenConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ListenConfigResource, ListenConfigGroupVersionKind, listenConfigFactory{})
return &listenConfigClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type SettingsGetter interface {
Settings(namespace string) SettingInterface
}

View File

@ -1,508 +0,0 @@
package v3
import (
"context"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/resource"
"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/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache"
)
var (
ListenConfigGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "ListenConfig",
}
ListenConfigResource = metav1.APIResource{
Name: "listenconfigs",
SingularName: "listenconfig",
Namespaced: false,
Kind: ListenConfigGroupVersionKind.Kind,
}
ListenConfigGroupVersionResource = schema.GroupVersionResource{
Group: GroupName,
Version: Version,
Resource: "listenconfigs",
}
)
func init() {
resource.Put(ListenConfigGroupVersionResource)
}
func NewListenConfig(namespace, name string, obj ListenConfig) *ListenConfig {
obj.APIVersion, obj.Kind = ListenConfigGroupVersionKind.ToAPIVersionAndKind()
obj.Name = name
obj.Namespace = namespace
return &obj
}
type ListenConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ListenConfig `json:"items"`
}
type ListenConfigHandlerFunc func(key string, obj *ListenConfig) (runtime.Object, error)
type ListenConfigChangeHandlerFunc func(obj *ListenConfig) (runtime.Object, error)
type ListenConfigLister interface {
List(namespace string, selector labels.Selector) (ret []*ListenConfig, err error)
Get(namespace, name string) (*ListenConfig, error)
}
type ListenConfigController interface {
Generic() controller.GenericController
Informer() cache.SharedIndexInformer
Lister() ListenConfigLister
AddHandler(ctx context.Context, name string, handler ListenConfigHandlerFunc)
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ListenConfigHandlerFunc)
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ListenConfigHandlerFunc)
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, handler ListenConfigHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ListenConfigInterface interface {
ObjectClient() *objectclient.ObjectClient
Create(*ListenConfig) (*ListenConfig, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error)
Get(name string, opts metav1.GetOptions) (*ListenConfig, error)
Update(*ListenConfig) (*ListenConfig, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ListenConfigList, error)
ListNamespaced(namespace string, opts metav1.ListOptions) (*ListenConfigList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ListenConfigController
AddHandler(ctx context.Context, name string, sync ListenConfigHandlerFunc)
AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ListenConfigHandlerFunc)
AddLifecycle(ctx context.Context, name string, lifecycle ListenConfigLifecycle)
AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ListenConfigLifecycle)
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ListenConfigHandlerFunc)
AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ListenConfigHandlerFunc)
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ListenConfigLifecycle)
AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ListenConfigLifecycle)
}
type listenConfigLister struct {
controller *listenConfigController
}
func (l *listenConfigLister) List(namespace string, selector labels.Selector) (ret []*ListenConfig, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*ListenConfig))
})
return
}
func (l *listenConfigLister) Get(namespace, name string) (*ListenConfig, 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: ListenConfigGroupVersionKind.Group,
Resource: "listenConfig",
}, key)
}
return obj.(*ListenConfig), nil
}
type listenConfigController struct {
controller.GenericController
}
func (c *listenConfigController) Generic() controller.GenericController {
return c.GenericController
}
func (c *listenConfigController) Lister() ListenConfigLister {
return &listenConfigLister{
controller: c,
}
}
func (c *listenConfigController) AddHandler(ctx context.Context, name string, handler ListenConfigHandlerFunc) {
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ListenConfig); ok {
return handler(key, v)
} else {
return nil, nil
}
})
}
func (c *listenConfigController) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, handler ListenConfigHandlerFunc) {
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if !enabled() {
return nil, nil
} else if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ListenConfig); ok {
return handler(key, v)
} else {
return nil, nil
}
})
}
func (c *listenConfigController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ListenConfigHandlerFunc) {
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ListenConfig); ok && controller.ObjectInCluster(cluster, obj) {
return handler(key, v)
} else {
return nil, nil
}
})
}
func (c *listenConfigController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ListenConfigHandlerFunc) {
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if !enabled() {
return nil, nil
} else if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ListenConfig); ok && controller.ObjectInCluster(cluster, obj) {
return handler(key, v)
} else {
return nil, nil
}
})
}
type listenConfigFactory struct {
}
func (c listenConfigFactory) Object() runtime.Object {
return &ListenConfig{}
}
func (c listenConfigFactory) List() runtime.Object {
return &ListenConfigList{}
}
func (s *listenConfigClient) Controller() ListenConfigController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.listenConfigControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ListenConfigGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &listenConfigController{
GenericController: genericController,
}
s.client.listenConfigControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type listenConfigClient struct {
client *Client
ns string
objectClient *objectclient.ObjectClient
controller ListenConfigController
}
func (s *listenConfigClient) ObjectClient() *objectclient.ObjectClient {
return s.objectClient
}
func (s *listenConfigClient) Create(o *ListenConfig) (*ListenConfig, error) {
obj, err := s.objectClient.Create(o)
return obj.(*ListenConfig), err
}
func (s *listenConfigClient) Get(name string, opts metav1.GetOptions) (*ListenConfig, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*ListenConfig), err
}
func (s *listenConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*ListenConfig), err
}
func (s *listenConfigClient) Update(o *ListenConfig) (*ListenConfig, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*ListenConfig), err
}
func (s *listenConfigClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *listenConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *listenConfigClient) List(opts metav1.ListOptions) (*ListenConfigList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ListenConfigList), err
}
func (s *listenConfigClient) ListNamespaced(namespace string, opts metav1.ListOptions) (*ListenConfigList, error) {
obj, err := s.objectClient.ListNamespaced(namespace, opts)
return obj.(*ListenConfigList), err
}
func (s *listenConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *listenConfigClient) Patch(o *ListenConfig, patchType types.PatchType, data []byte, subresources ...string) (*ListenConfig, error) {
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
return obj.(*ListenConfig), err
}
func (s *listenConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *listenConfigClient) AddHandler(ctx context.Context, name string, sync ListenConfigHandlerFunc) {
s.Controller().AddHandler(ctx, name, sync)
}
func (s *listenConfigClient) AddFeatureHandler(ctx context.Context, enabled func() bool, name string, sync ListenConfigHandlerFunc) {
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
}
func (s *listenConfigClient) AddLifecycle(ctx context.Context, name string, lifecycle ListenConfigLifecycle) {
sync := NewListenConfigLifecycleAdapter(name, false, s, lifecycle)
s.Controller().AddHandler(ctx, name, sync)
}
func (s *listenConfigClient) AddFeatureLifecycle(ctx context.Context, enabled func() bool, name string, lifecycle ListenConfigLifecycle) {
sync := NewListenConfigLifecycleAdapter(name, false, s, lifecycle)
s.Controller().AddFeatureHandler(ctx, enabled, name, sync)
}
func (s *listenConfigClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ListenConfigHandlerFunc) {
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
}
func (s *listenConfigClient) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, clusterName string, sync ListenConfigHandlerFunc) {
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
}
func (s *listenConfigClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ListenConfigLifecycle) {
sync := NewListenConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
}
func (s *listenConfigClient) AddClusterScopedFeatureLifecycle(ctx context.Context, enabled func() bool, name, clusterName string, lifecycle ListenConfigLifecycle) {
sync := NewListenConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.Controller().AddClusterScopedFeatureHandler(ctx, enabled, name, clusterName, sync)
}
type ListenConfigIndexer func(obj *ListenConfig) ([]string, error)
type ListenConfigClientCache interface {
Get(namespace, name string) (*ListenConfig, error)
List(namespace string, selector labels.Selector) ([]*ListenConfig, error)
Index(name string, indexer ListenConfigIndexer)
GetIndexed(name, key string) ([]*ListenConfig, error)
}
type ListenConfigClient interface {
Create(*ListenConfig) (*ListenConfig, error)
Get(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error)
Update(*ListenConfig) (*ListenConfig, error)
Delete(namespace, name string, options *metav1.DeleteOptions) error
List(namespace string, opts metav1.ListOptions) (*ListenConfigList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Cache() ListenConfigClientCache
OnCreate(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc)
OnChange(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc)
OnRemove(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc)
Enqueue(namespace, name string)
Generic() controller.GenericController
ObjectClient() *objectclient.ObjectClient
Interface() ListenConfigInterface
}
type listenConfigClientCache struct {
client *listenConfigClient2
}
type listenConfigClient2 struct {
iface ListenConfigInterface
controller ListenConfigController
}
func (n *listenConfigClient2) Interface() ListenConfigInterface {
return n.iface
}
func (n *listenConfigClient2) Generic() controller.GenericController {
return n.iface.Controller().Generic()
}
func (n *listenConfigClient2) ObjectClient() *objectclient.ObjectClient {
return n.Interface().ObjectClient()
}
func (n *listenConfigClient2) Enqueue(namespace, name string) {
n.iface.Controller().Enqueue(namespace, name)
}
func (n *listenConfigClient2) Create(obj *ListenConfig) (*ListenConfig, error) {
return n.iface.Create(obj)
}
func (n *listenConfigClient2) Get(namespace, name string, opts metav1.GetOptions) (*ListenConfig, error) {
return n.iface.GetNamespaced(namespace, name, opts)
}
func (n *listenConfigClient2) Update(obj *ListenConfig) (*ListenConfig, error) {
return n.iface.Update(obj)
}
func (n *listenConfigClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
return n.iface.DeleteNamespaced(namespace, name, options)
}
func (n *listenConfigClient2) List(namespace string, opts metav1.ListOptions) (*ListenConfigList, error) {
return n.iface.List(opts)
}
func (n *listenConfigClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return n.iface.Watch(opts)
}
func (n *listenConfigClientCache) Get(namespace, name string) (*ListenConfig, error) {
return n.client.controller.Lister().Get(namespace, name)
}
func (n *listenConfigClientCache) List(namespace string, selector labels.Selector) ([]*ListenConfig, error) {
return n.client.controller.Lister().List(namespace, selector)
}
func (n *listenConfigClient2) Cache() ListenConfigClientCache {
n.loadController()
return &listenConfigClientCache{
client: n,
}
}
func (n *listenConfigClient2) OnCreate(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name+"-create", &listenConfigLifecycleDelegate{create: sync})
}
func (n *listenConfigClient2) OnChange(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name+"-change", &listenConfigLifecycleDelegate{update: sync})
}
func (n *listenConfigClient2) OnRemove(ctx context.Context, name string, sync ListenConfigChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name, &listenConfigLifecycleDelegate{remove: sync})
}
func (n *listenConfigClientCache) Index(name string, indexer ListenConfigIndexer) {
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
name: func(obj interface{}) ([]string, error) {
if v, ok := obj.(*ListenConfig); ok {
return indexer(v)
}
return nil, nil
},
})
if err != nil {
panic(err)
}
}
func (n *listenConfigClientCache) GetIndexed(name, key string) ([]*ListenConfig, error) {
var result []*ListenConfig
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
if err != nil {
return nil, err
}
for _, obj := range objs {
if v, ok := obj.(*ListenConfig); ok {
result = append(result, v)
}
}
return result, nil
}
func (n *listenConfigClient2) loadController() {
if n.controller == nil {
n.controller = n.iface.Controller()
}
}
type listenConfigLifecycleDelegate struct {
create ListenConfigChangeHandlerFunc
update ListenConfigChangeHandlerFunc
remove ListenConfigChangeHandlerFunc
}
func (n *listenConfigLifecycleDelegate) HasCreate() bool {
return n.create != nil
}
func (n *listenConfigLifecycleDelegate) Create(obj *ListenConfig) (runtime.Object, error) {
if n.create == nil {
return obj, nil
}
return n.create(obj)
}
func (n *listenConfigLifecycleDelegate) HasFinalize() bool {
return n.remove != nil
}
func (n *listenConfigLifecycleDelegate) Remove(obj *ListenConfig) (runtime.Object, error) {
if n.remove == nil {
return obj, nil
}
return n.remove(obj)
}
func (n *listenConfigLifecycleDelegate) Updated(obj *ListenConfig) (runtime.Object, error) {
if n.update == nil {
return obj, nil
}
return n.update(obj)
}

View File

@ -1,66 +0,0 @@
package v3
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/apimachinery/pkg/runtime"
)
type ListenConfigLifecycle interface {
Create(obj *ListenConfig) (runtime.Object, error)
Remove(obj *ListenConfig) (runtime.Object, error)
Updated(obj *ListenConfig) (runtime.Object, error)
}
type listenConfigLifecycleAdapter struct {
lifecycle ListenConfigLifecycle
}
func (w *listenConfigLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *listenConfigLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *listenConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*ListenConfig))
if o == nil {
return nil, err
}
return o, err
}
func (w *listenConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*ListenConfig))
if o == nil {
return nil, err
}
return o, err
}
func (w *listenConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*ListenConfig))
if o == nil {
return nil, err
}
return o, err
}
func NewListenConfigLifecycleAdapter(name string, clusterScoped bool, client ListenConfigInterface, l ListenConfigLifecycle) ListenConfigHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(ListenConfigGroupVersionResource)
}
adapter := &listenConfigLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *ListenConfig) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}

View File

@ -99,8 +99,6 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&ClusterLoggingList{},
&ProjectLogging{},
&ProjectLoggingList{},
&ListenConfig{},
&ListenConfigList{},
&Setting{},
&SettingList{},
&Feature{},

View File

@ -39,7 +39,6 @@ type Client struct {
ProjectNetworkPolicy ProjectNetworkPolicyOperations
ClusterLogging ClusterLoggingOperations
ProjectLogging ProjectLoggingOperations
ListenConfig ListenConfigOperations
Setting SettingOperations
Feature FeatureOperations
ClusterAlert ClusterAlertOperations
@ -115,7 +114,6 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
client.ProjectNetworkPolicy = newProjectNetworkPolicyClient(client)
client.ClusterLogging = newClusterLoggingClient(client)
client.ProjectLogging = newProjectLoggingClient(client)
client.ListenConfig = newListenConfigClient(client)
client.Setting = newSettingClient(client)
client.Feature = newFeatureClient(client)
client.ClusterAlert = newClusterAlertClient(client)

View File

@ -3,6 +3,7 @@ package client
const (
GithubConfigType = "githubConfig"
GithubConfigFieldAccessMode = "accessMode"
GithubConfigFieldAdditionalClientIDs = "additionalClientIds"
GithubConfigFieldAllowedPrincipalIDs = "allowedPrincipalIds"
GithubConfigFieldAnnotations = "annotations"
GithubConfigFieldClientID = "clientId"
@ -11,6 +12,7 @@ const (
GithubConfigFieldCreatorID = "creatorId"
GithubConfigFieldEnabled = "enabled"
GithubConfigFieldHostname = "hostname"
GithubConfigFieldHostnameToClientID = "hostnameToClientId"
GithubConfigFieldLabels = "labels"
GithubConfigFieldName = "name"
GithubConfigFieldOwnerReferences = "ownerReferences"
@ -22,6 +24,7 @@ const (
type GithubConfig struct {
AccessMode string `json:"accessMode,omitempty" yaml:"accessMode,omitempty"`
AdditionalClientIDs map[string]string `json:"additionalClientIds,omitempty" yaml:"additionalClientIds,omitempty"`
AllowedPrincipalIDs []string `json:"allowedPrincipalIds,omitempty" yaml:"allowedPrincipalIds,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"`
@ -30,6 +33,7 @@ type GithubConfig struct {
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
Hostname string `json:"hostname,omitempty" yaml:"hostname,omitempty"`
HostnameToClientID map[string]string `json:"hostnameToClientId,omitempty" yaml:"hostnameToClientId,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`

View File

@ -1,139 +0,0 @@
package client
import (
"github.com/rancher/norman/types"
)
const (
ListenConfigType = "listenConfig"
ListenConfigFieldAlgorithm = "algorithm"
ListenConfigFieldAnnotations = "annotations"
ListenConfigFieldCACerts = "caCerts"
ListenConfigFieldCN = "cn"
ListenConfigFieldCert = "cert"
ListenConfigFieldCertFingerprint = "certFingerprint"
ListenConfigFieldCreated = "created"
ListenConfigFieldCreatorID = "creatorId"
ListenConfigFieldDescription = "description"
ListenConfigFieldDomains = "domains"
ListenConfigFieldEnabled = "enabled"
ListenConfigFieldExpiresAt = "expiresAt"
ListenConfigFieldGeneratedCerts = "generatedCerts"
ListenConfigFieldIssuedAt = "issuedAt"
ListenConfigFieldIssuer = "issuer"
ListenConfigFieldKey = "key"
ListenConfigFieldKeySize = "keySize"
ListenConfigFieldKnownIPs = "knownIps"
ListenConfigFieldLabels = "labels"
ListenConfigFieldMode = "mode"
ListenConfigFieldName = "name"
ListenConfigFieldOwnerReferences = "ownerReferences"
ListenConfigFieldRemoved = "removed"
ListenConfigFieldSerialNumber = "serialNumber"
ListenConfigFieldSubjectAlternativeNames = "subjectAlternativeNames"
ListenConfigFieldTOS = "tos"
ListenConfigFieldUUID = "uuid"
ListenConfigFieldVersion = "version"
)
type ListenConfig struct {
types.Resource
Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
CACerts string `json:"caCerts,omitempty" yaml:"caCerts,omitempty"`
CN string `json:"cn,omitempty" yaml:"cn,omitempty"`
Cert string `json:"cert,omitempty" yaml:"cert,omitempty"`
CertFingerprint string `json:"certFingerprint,omitempty" yaml:"certFingerprint,omitempty"`
Created string `json:"created,omitempty" yaml:"created,omitempty"`
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Domains []string `json:"domains,omitempty" yaml:"domains,omitempty"`
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"`
GeneratedCerts map[string]string `json:"generatedCerts,omitempty" yaml:"generatedCerts,omitempty"`
IssuedAt string `json:"issuedAt,omitempty" yaml:"issuedAt,omitempty"`
Issuer string `json:"issuer,omitempty" yaml:"issuer,omitempty"`
Key string `json:"key,omitempty" yaml:"key,omitempty"`
KeySize int64 `json:"keySize,omitempty" yaml:"keySize,omitempty"`
KnownIPs []string `json:"knownIps,omitempty" yaml:"knownIps,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
SerialNumber string `json:"serialNumber,omitempty" yaml:"serialNumber,omitempty"`
SubjectAlternativeNames []string `json:"subjectAlternativeNames,omitempty" yaml:"subjectAlternativeNames,omitempty"`
TOS []string `json:"tos,omitempty" yaml:"tos,omitempty"`
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
Version int64 `json:"version,omitempty" yaml:"version,omitempty"`
}
type ListenConfigCollection struct {
types.Collection
Data []ListenConfig `json:"data,omitempty"`
client *ListenConfigClient
}
type ListenConfigClient struct {
apiClient *Client
}
type ListenConfigOperations interface {
List(opts *types.ListOpts) (*ListenConfigCollection, error)
Create(opts *ListenConfig) (*ListenConfig, error)
Update(existing *ListenConfig, updates interface{}) (*ListenConfig, error)
Replace(existing *ListenConfig) (*ListenConfig, error)
ByID(id string) (*ListenConfig, error)
Delete(container *ListenConfig) error
}
func newListenConfigClient(apiClient *Client) *ListenConfigClient {
return &ListenConfigClient{
apiClient: apiClient,
}
}
func (c *ListenConfigClient) Create(container *ListenConfig) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoCreate(ListenConfigType, container, resp)
return resp, err
}
func (c *ListenConfigClient) Update(existing *ListenConfig, updates interface{}) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoUpdate(ListenConfigType, &existing.Resource, updates, resp)
return resp, err
}
func (c *ListenConfigClient) Replace(obj *ListenConfig) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoReplace(ListenConfigType, &obj.Resource, obj, resp)
return resp, err
}
func (c *ListenConfigClient) List(opts *types.ListOpts) (*ListenConfigCollection, error) {
resp := &ListenConfigCollection{}
err := c.apiClient.Ops.DoList(ListenConfigType, opts, resp)
resp.client = c
return resp, err
}
func (cc *ListenConfigCollection) Next() (*ListenConfigCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &ListenConfigCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *ListenConfigClient) ByID(id string) (*ListenConfig, error) {
resp := &ListenConfig{}
err := c.apiClient.Ops.DoByID(ListenConfigType, id, resp)
return resp, err
}
func (c *ListenConfigClient) Delete(container *ListenConfig) error {
return c.apiClient.Ops.DoResourceDelete(ListenConfigType, &container.Resource)
}

View File

@ -39,7 +39,6 @@ type Config struct {
Preferences map[string]managementClient.Preference `json:"preferences,omitempty" yaml:"preferences,omitempty"`
ClusterLoggings map[string]managementClient.ClusterLogging `json:"clusterLoggings,omitempty" yaml:"clusterLoggings,omitempty"`
ProjectLoggings map[string]managementClient.ProjectLogging `json:"projectLoggings,omitempty" yaml:"projectLoggings,omitempty"`
ListenConfigs map[string]managementClient.ListenConfig `json:"listenConfigs,omitempty" yaml:"listenConfigs,omitempty"`
Settings map[string]managementClient.Setting `json:"settings,omitempty" yaml:"settings,omitempty"`
Features map[string]managementClient.Feature `json:"features,omitempty" yaml:"features,omitempty"`
ClusterAlerts map[string]managementClient.ClusterAlert `json:"clusterAlerts,omitempty" yaml:"clusterAlerts,omitempty"`