1
0
mirror of https://github.com/rancher/types.git synced 2025-08-31 21:00:16 +00:00

generated code

This commit is contained in:
Craig Jellick
2018-02-02 17:32:11 -07:00
committed by Darren Shepherd
parent 5cc3e0bed2
commit f95b1eede3
25 changed files with 1023 additions and 110 deletions

View File

@@ -211,10 +211,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*GithubConfigTestInput).DeepCopyInto(out.(*GithubConfigTestInput))
return nil
}, InType: reflect.TypeOf(&GithubConfigTestInput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GithubCredential).DeepCopyInto(out.(*GithubCredential))
return nil
}, InType: reflect.TypeOf(&GithubCredential{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GlobalRole).DeepCopyInto(out.(*GlobalRole))
return nil
@@ -299,10 +295,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*LocalConfig).DeepCopyInto(out.(*LocalConfig))
return nil
}, InType: reflect.TypeOf(&LocalConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*LocalCredential).DeepCopyInto(out.(*LocalCredential))
return nil
}, InType: reflect.TypeOf(&LocalCredential{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*LoggingCommonSpec).DeepCopyInto(out.(*LoggingCommonSpec))
return nil
@@ -315,10 +307,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*LoggingStatus).DeepCopyInto(out.(*LoggingStatus))
return nil
}, InType: reflect.TypeOf(&LoggingStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*LoginInput).DeepCopyInto(out.(*LoginInput))
return nil
}, InType: reflect.TypeOf(&LoginInput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*Machine).DeepCopyInto(out.(*Machine))
return nil
@@ -1848,7 +1836,6 @@ func (in *GithubConfig) DeepCopyObject() runtime.Object {
func (in *GithubConfigApplyInput) DeepCopyInto(out *GithubConfigApplyInput) {
*out = *in
in.GithubConfig.DeepCopyInto(&out.GithubConfig)
out.GithubCredential = in.GithubCredential
return
}
@@ -1879,22 +1866,6 @@ func (in *GithubConfigTestInput) DeepCopy() *GithubConfigTestInput {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GithubCredential) DeepCopyInto(out *GithubCredential) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubCredential.
func (in *GithubCredential) DeepCopy() *GithubCredential {
if in == nil {
return nil
}
out := new(GithubCredential)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GlobalRole) DeepCopyInto(out *GlobalRole) {
*out = *in
@@ -2474,22 +2445,6 @@ func (in *LocalConfig) DeepCopyObject() runtime.Object {
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalCredential) DeepCopyInto(out *LocalCredential) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalCredential.
func (in *LocalCredential) DeepCopy() *LocalCredential {
if in == nil {
return nil
}
out := new(LocalCredential)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoggingCommonSpec) DeepCopyInto(out *LoggingCommonSpec) {
*out = *in
@@ -2586,24 +2541,6 @@ func (in *LoggingStatus) DeepCopy() *LoggingStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LoginInput) DeepCopyInto(out *LoginInput) {
*out = *in
out.LocalCredential = in.LocalCredential
out.GithubCredential = in.GithubCredential
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoginInput.
func (in *LoginInput) DeepCopy() *LoginInput {
if in == nil {
return nil
}
out := new(LoginInput)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Machine) DeepCopyInto(out *Machine) {
*out = *in

View File

@@ -0,0 +1,251 @@
package v3public
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 (
AuthProviderGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "AuthProvider",
}
AuthProviderResource = metav1.APIResource{
Name: "authproviders",
SingularName: "authprovider",
Namespaced: false,
Kind: AuthProviderGroupVersionKind.Kind,
}
)
type AuthProviderList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AuthProvider
}
type AuthProviderHandlerFunc func(key string, obj *AuthProvider) error
type AuthProviderLister interface {
List(namespace string, selector labels.Selector) (ret []*AuthProvider, err error)
Get(namespace, name string) (*AuthProvider, error)
}
type AuthProviderController interface {
Informer() cache.SharedIndexInformer
Lister() AuthProviderLister
AddHandler(name string, handler AuthProviderHandlerFunc)
AddClusterScopedHandler(name, clusterName string, handler AuthProviderHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type AuthProviderInterface interface {
ObjectClient() *clientbase.ObjectClient
Create(*AuthProvider) (*AuthProvider, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthProvider, error)
Get(name string, opts metav1.GetOptions) (*AuthProvider, error)
Update(*AuthProvider) (*AuthProvider, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*AuthProviderList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() AuthProviderController
AddHandler(name string, sync AuthProviderHandlerFunc)
AddLifecycle(name string, lifecycle AuthProviderLifecycle)
AddClusterScopedHandler(name, clusterName string, sync AuthProviderHandlerFunc)
AddClusterScopedLifecycle(name, clusterName string, lifecycle AuthProviderLifecycle)
}
type authProviderLister struct {
controller *authProviderController
}
func (l *authProviderLister) List(namespace string, selector labels.Selector) (ret []*AuthProvider, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*AuthProvider))
})
return
}
func (l *authProviderLister) Get(namespace, name string) (*AuthProvider, 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: AuthProviderGroupVersionKind.Group,
Resource: "authProvider",
}, name)
}
return obj.(*AuthProvider), nil
}
type authProviderController struct {
controller.GenericController
}
func (c *authProviderController) Lister() AuthProviderLister {
return &authProviderLister{
controller: c,
}
}
func (c *authProviderController) AddHandler(name string, handler AuthProviderHandlerFunc) {
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.(*AuthProvider))
})
}
func (c *authProviderController) AddClusterScopedHandler(name, cluster string, handler AuthProviderHandlerFunc) {
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.(*AuthProvider))
})
}
type authProviderFactory struct {
}
func (c authProviderFactory) Object() runtime.Object {
return &AuthProvider{}
}
func (c authProviderFactory) List() runtime.Object {
return &AuthProviderList{}
}
func (s *authProviderClient) Controller() AuthProviderController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.authProviderControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(AuthProviderGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &authProviderController{
GenericController: genericController,
}
s.client.authProviderControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type authProviderClient struct {
client *Client
ns string
objectClient *clientbase.ObjectClient
controller AuthProviderController
}
func (s *authProviderClient) ObjectClient() *clientbase.ObjectClient {
return s.objectClient
}
func (s *authProviderClient) Create(o *AuthProvider) (*AuthProvider, error) {
obj, err := s.objectClient.Create(o)
return obj.(*AuthProvider), err
}
func (s *authProviderClient) Get(name string, opts metav1.GetOptions) (*AuthProvider, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*AuthProvider), err
}
func (s *authProviderClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*AuthProvider, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*AuthProvider), err
}
func (s *authProviderClient) Update(o *AuthProvider) (*AuthProvider, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*AuthProvider), err
}
func (s *authProviderClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *authProviderClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *authProviderClient) List(opts metav1.ListOptions) (*AuthProviderList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*AuthProviderList), err
}
func (s *authProviderClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *authProviderClient) Patch(o *AuthProvider, data []byte, subresources ...string) (*AuthProvider, error) {
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
return obj.(*AuthProvider), err
}
func (s *authProviderClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *authProviderClient) AddHandler(name string, sync AuthProviderHandlerFunc) {
s.Controller().AddHandler(name, sync)
}
func (s *authProviderClient) AddLifecycle(name string, lifecycle AuthProviderLifecycle) {
sync := NewAuthProviderLifecycleAdapter(name, false, s, lifecycle)
s.AddHandler(name, sync)
}
func (s *authProviderClient) AddClusterScopedHandler(name, clusterName string, sync AuthProviderHandlerFunc) {
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
}
func (s *authProviderClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle AuthProviderLifecycle) {
sync := NewAuthProviderLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.AddClusterScopedHandler(name, clusterName, sync)
}

View File

@@ -0,0 +1,51 @@
package v3public
import (
"github.com/rancher/norman/lifecycle"
"k8s.io/apimachinery/pkg/runtime"
)
type AuthProviderLifecycle interface {
Create(obj *AuthProvider) (*AuthProvider, error)
Remove(obj *AuthProvider) (*AuthProvider, error)
Updated(obj *AuthProvider) (*AuthProvider, error)
}
type authProviderLifecycleAdapter struct {
lifecycle AuthProviderLifecycle
}
func (w *authProviderLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*AuthProvider))
if o == nil {
return nil, err
}
return o, err
}
func (w *authProviderLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*AuthProvider))
if o == nil {
return nil, err
}
return o, err
}
func (w *authProviderLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*AuthProvider))
if o == nil {
return nil, err
}
return o, err
}
func NewAuthProviderLifecycleAdapter(name string, clusterScoped bool, client AuthProviderInterface, l AuthProviderLifecycle) AuthProviderHandlerFunc {
adapter := &authProviderLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *AuthProvider) error {
if obj == nil {
return syncFn(key, nil)
}
return syncFn(key, obj)
}
}

View File

@@ -0,0 +1,216 @@
package v3public
import (
reflect "reflect"
conversion "k8s.io/apimachinery/pkg/conversion"
runtime "k8s.io/apimachinery/pkg/runtime"
)
func init() {
SchemeBuilder.Register(RegisterDeepCopies)
}
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
// to allow building arbitrary schemes.
//
// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.
func RegisterDeepCopies(scheme *runtime.Scheme) error {
return scheme.AddGeneratedDeepCopyFuncs(
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*AuthProvider).DeepCopyInto(out.(*AuthProvider))
return nil
}, InType: reflect.TypeOf(&AuthProvider{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*AuthProviderList).DeepCopyInto(out.(*AuthProviderList))
return nil
}, InType: reflect.TypeOf(&AuthProviderList{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GenericLogin).DeepCopyInto(out.(*GenericLogin))
return nil
}, InType: reflect.TypeOf(&GenericLogin{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GithubLogin).DeepCopyInto(out.(*GithubLogin))
return nil
}, InType: reflect.TypeOf(&GithubLogin{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GithubProvider).DeepCopyInto(out.(*GithubProvider))
return nil
}, InType: reflect.TypeOf(&GithubProvider{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*LocalLogin).DeepCopyInto(out.(*LocalLogin))
return nil
}, InType: reflect.TypeOf(&LocalLogin{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*LocalProvider).DeepCopyInto(out.(*LocalProvider))
return nil
}, InType: reflect.TypeOf(&LocalProvider{})},
)
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AuthProvider) DeepCopyInto(out *AuthProvider) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthProvider.
func (in *AuthProvider) DeepCopy() *AuthProvider {
if in == nil {
return nil
}
out := new(AuthProvider)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AuthProvider) 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 *AuthProviderList) DeepCopyInto(out *AuthProviderList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]AuthProvider, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthProviderList.
func (in *AuthProviderList) DeepCopy() *AuthProviderList {
if in == nil {
return nil
}
out := new(AuthProviderList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AuthProviderList) 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 *GenericLogin) DeepCopyInto(out *GenericLogin) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericLogin.
func (in *GenericLogin) DeepCopy() *GenericLogin {
if in == nil {
return nil
}
out := new(GenericLogin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GithubLogin) DeepCopyInto(out *GithubLogin) {
*out = *in
out.GenericLogin = in.GenericLogin
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubLogin.
func (in *GithubLogin) DeepCopy() *GithubLogin {
if in == nil {
return nil
}
out := new(GithubLogin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GithubProvider) DeepCopyInto(out *GithubProvider) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.AuthProvider.DeepCopyInto(&out.AuthProvider)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GithubProvider.
func (in *GithubProvider) DeepCopy() *GithubProvider {
if in == nil {
return nil
}
out := new(GithubProvider)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GithubProvider) 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 *LocalLogin) DeepCopyInto(out *LocalLogin) {
*out = *in
out.GenericLogin = in.GenericLogin
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalLogin.
func (in *LocalLogin) DeepCopy() *LocalLogin {
if in == nil {
return nil
}
out := new(LocalLogin)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LocalProvider) DeepCopyInto(out *LocalProvider) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.AuthProvider.DeepCopyInto(&out.AuthProvider)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalProvider.
func (in *LocalProvider) DeepCopy() *LocalProvider {
if in == nil {
return nil
}
out := new(LocalProvider)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *LocalProvider) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil
}
}

View File

@@ -0,0 +1,69 @@
package v3public
import (
"context"
"sync"
"github.com/rancher/norman/clientbase"
"github.com/rancher/norman/controller"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/rest"
)
type Interface interface {
RESTClient() rest.Interface
controller.Starter
AuthProvidersGetter
}
type Client struct {
sync.Mutex
restClient rest.Interface
starters []controller.Starter
authProviderControllers map[string]AuthProviderController
}
func NewForConfig(config rest.Config) (Interface, error) {
if config.NegotiatedSerializer == nil {
configConfig := dynamic.ContentConfig()
config.NegotiatedSerializer = configConfig.NegotiatedSerializer
}
restClient, err := rest.UnversionedRESTClientFor(&config)
if err != nil {
return nil, err
}
return &Client{
restClient: restClient,
authProviderControllers: map[string]AuthProviderController{},
}, nil
}
func (c *Client) RESTClient() rest.Interface {
return c.restClient
}
func (c *Client) Sync(ctx context.Context) error {
return controller.Sync(ctx, c.starters...)
}
func (c *Client) Start(ctx context.Context, threadiness int) error {
return controller.Start(ctx, threadiness, c.starters...)
}
type AuthProvidersGetter interface {
AuthProviders(namespace string) AuthProviderInterface
}
func (c *Client) AuthProviders(namespace string) AuthProviderInterface {
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &AuthProviderResource, AuthProviderGroupVersionKind, authProviderFactory{})
return &authProviderClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}

View File

@@ -0,0 +1,40 @@
package v3public
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
GroupName = "management.cattle.io"
Version = "v3public"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this gets cleaned up when the types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&AuthProvider{},
&AuthProviderList{},
)
return nil
}