1
0
mirror of https://github.com/rancher/types.git synced 2025-07-15 22:15:49 +00:00

Update generated code

This commit is contained in:
Darren Shepherd 2017-12-12 08:27:55 -07:00
parent 4936f617e6
commit b00b71962e
12 changed files with 482 additions and 6 deletions

View File

@ -0,0 +1,193 @@
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 (
ClusterRegistrationTokenGroupVersionKind = schema.GroupVersionKind{
Version: "v3",
Group: "management.cattle.io",
Kind: "ClusterRegistrationToken",
}
ClusterRegistrationTokenResource = metav1.APIResource{
Name: "clusterregistrationtokens",
SingularName: "clusterregistrationtoken",
Namespaced: false,
Kind: ClusterRegistrationTokenGroupVersionKind.Kind,
}
)
type ClusterRegistrationTokenList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterRegistrationToken
}
type ClusterRegistrationTokenHandlerFunc func(key string, obj *ClusterRegistrationToken) error
type ClusterRegistrationTokenLister interface {
List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error)
Get(namespace, name string) (*ClusterRegistrationToken, error)
}
type ClusterRegistrationTokenController interface {
Informer() cache.SharedIndexInformer
Lister() ClusterRegistrationTokenLister
AddHandler(handler ClusterRegistrationTokenHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ClusterRegistrationTokenInterface interface {
ObjectClient() *clientbase.ObjectClient
Create(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
Update(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
Delete(name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ClusterRegistrationTokenController
}
type clusterRegistrationTokenLister struct {
controller *clusterRegistrationTokenController
}
func (l *clusterRegistrationTokenLister) List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*ClusterRegistrationToken))
})
return
}
func (l *clusterRegistrationTokenLister) Get(namespace, name string) (*ClusterRegistrationToken, 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: ClusterRegistrationTokenGroupVersionKind.Group,
Resource: "clusterRegistrationToken",
}, name)
}
return obj.(*ClusterRegistrationToken), nil
}
type clusterRegistrationTokenController struct {
controller.GenericController
}
func (c *clusterRegistrationTokenController) Lister() ClusterRegistrationTokenLister {
return &clusterRegistrationTokenLister{
controller: c,
}
}
func (c *clusterRegistrationTokenController) AddHandler(handler ClusterRegistrationTokenHandlerFunc) {
c.GenericController.AddHandler(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.(*ClusterRegistrationToken))
})
}
type clusterRegistrationTokenFactory struct {
}
func (c clusterRegistrationTokenFactory) Object() runtime.Object {
return &ClusterRegistrationToken{}
}
func (c clusterRegistrationTokenFactory) List() runtime.Object {
return &ClusterRegistrationTokenList{}
}
func (s *clusterRegistrationTokenClient) Controller() ClusterRegistrationTokenController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.clusterRegistrationTokenControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ClusterRegistrationTokenGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &clusterRegistrationTokenController{
GenericController: genericController,
}
s.client.clusterRegistrationTokenControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type clusterRegistrationTokenClient struct {
client *Client
ns string
objectClient *clientbase.ObjectClient
controller ClusterRegistrationTokenController
}
func (s *clusterRegistrationTokenClient) ObjectClient() *clientbase.ObjectClient {
return s.objectClient
}
func (s *clusterRegistrationTokenClient) Create(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) {
obj, err := s.objectClient.Create(o)
return obj.(*ClusterRegistrationToken), err
}
func (s *clusterRegistrationTokenClient) Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*ClusterRegistrationToken), err
}
func (s *clusterRegistrationTokenClient) Update(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*ClusterRegistrationToken), err
}
func (s *clusterRegistrationTokenClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *clusterRegistrationTokenClient) List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ClusterRegistrationTokenList), err
}
func (s *clusterRegistrationTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
func (s *clusterRegistrationTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}

View File

@ -0,0 +1,39 @@
package v3
import (
"github.com/rancher/norman/lifecycle"
"k8s.io/apimachinery/pkg/runtime"
)
type ClusterRegistrationTokenLifecycle interface {
Create(obj *ClusterRegistrationToken) error
Remove(obj *ClusterRegistrationToken) error
Updated(obj *ClusterRegistrationToken) error
}
type clusterRegistrationTokenLifecycleAdapter struct {
lifecycle ClusterRegistrationTokenLifecycle
}
func (w *clusterRegistrationTokenLifecycleAdapter) Create(obj runtime.Object) error {
return w.lifecycle.Create(obj.(*ClusterRegistrationToken))
}
func (w *clusterRegistrationTokenLifecycleAdapter) Finalize(obj runtime.Object) error {
return w.lifecycle.Remove(obj.(*ClusterRegistrationToken))
}
func (w *clusterRegistrationTokenLifecycleAdapter) Updated(obj runtime.Object) error {
return w.lifecycle.Updated(obj.(*ClusterRegistrationToken))
}
func NewClusterRegistrationTokenLifecycleAdapter(name string, client ClusterRegistrationTokenInterface, l ClusterRegistrationTokenLifecycle) ClusterRegistrationTokenHandlerFunc {
adapter := &clusterRegistrationTokenLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
return func(key string, obj *ClusterRegistrationToken) error {
if obj == nil {
return syncFn(key, nil)
}
return syncFn(key, obj)
}
}

View File

@ -386,6 +386,101 @@ func (in *ClusterList) DeepCopyObject() runtime.Object {
}
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterRegistrationToken) DeepCopyInto(out *ClusterRegistrationToken) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationToken.
func (in *ClusterRegistrationToken) DeepCopy() *ClusterRegistrationToken {
if in == nil {
return nil
}
out := new(ClusterRegistrationToken)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterRegistrationToken) 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 *ClusterRegistrationTokenList) DeepCopyInto(out *ClusterRegistrationTokenList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterRegistrationToken, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenList.
func (in *ClusterRegistrationTokenList) DeepCopy() *ClusterRegistrationTokenList {
if in == nil {
return nil
}
out := new(ClusterRegistrationTokenList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterRegistrationTokenList) 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 *ClusterRegistrationTokenSpec) DeepCopyInto(out *ClusterRegistrationTokenSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenSpec.
func (in *ClusterRegistrationTokenSpec) DeepCopy() *ClusterRegistrationTokenSpec {
if in == nil {
return nil
}
out := new(ClusterRegistrationTokenSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterRegistrationTokenStatus) DeepCopyInto(out *ClusterRegistrationTokenStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenStatus.
func (in *ClusterRegistrationTokenStatus) DeepCopy() *ClusterRegistrationTokenStatus {
if in == nil {
return nil
}
out := new(ClusterRegistrationTokenStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterRoleTemplateBinding) DeepCopyInto(out *ClusterRoleTemplateBinding) {
*out = *in

View File

@ -24,6 +24,7 @@ type Interface interface {
ProjectRoleTemplateBindingsGetter
ClustersGetter
ClusterEventsGetter
ClusterRegistrationTokensGetter
CatalogsGetter
TemplatesGetter
TemplateVersionsGetter
@ -53,6 +54,7 @@ type Client struct {
projectRoleTemplateBindingControllers map[string]ProjectRoleTemplateBindingController
clusterControllers map[string]ClusterController
clusterEventControllers map[string]ClusterEventController
clusterRegistrationTokenControllers map[string]ClusterRegistrationTokenController
catalogControllers map[string]CatalogController
templateControllers map[string]TemplateController
templateVersionControllers map[string]TemplateVersionController
@ -91,6 +93,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
projectRoleTemplateBindingControllers: map[string]ProjectRoleTemplateBindingController{},
clusterControllers: map[string]ClusterController{},
clusterEventControllers: map[string]ClusterEventController{},
clusterRegistrationTokenControllers: map[string]ClusterRegistrationTokenController{},
catalogControllers: map[string]CatalogController{},
templateControllers: map[string]TemplateController{},
templateVersionControllers: map[string]TemplateVersionController{},
@ -248,6 +251,19 @@ func (c *Client) ClusterEvents(namespace string) ClusterEventInterface {
}
}
type ClusterRegistrationTokensGetter interface {
ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface
}
func (c *Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface {
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRegistrationTokenResource, ClusterRegistrationTokenGroupVersionKind, clusterRegistrationTokenFactory{})
return &clusterRegistrationTokenClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type CatalogsGetter interface {
Catalogs(namespace string) CatalogInterface
}

View File

@ -7,8 +7,8 @@ import (
type Client struct {
clientbase.APIBaseClient
Node NodeOperations
Namespace NamespaceOperations
Node NodeOperations
}
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
@ -21,8 +21,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
APIBaseClient: baseClient,
}
client.Node = newNodeClient(client)
client.Namespace = newNamespaceClient(client)
client.Node = newNodeClient(client)
return client, nil
}

View File

@ -0,0 +1,8 @@
package client
const (
NamespaceSpecType = "namespaceSpec"
)
type NamespaceSpec struct {
}

View File

@ -18,6 +18,7 @@ type Client struct {
ProjectRoleTemplateBinding ProjectRoleTemplateBindingOperations
Cluster ClusterOperations
ClusterEvent ClusterEventOperations
ClusterRegistrationToken ClusterRegistrationTokenOperations
Catalog CatalogOperations
Template TemplateOperations
TemplateVersion TemplateVersionOperations
@ -53,6 +54,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
client.ProjectRoleTemplateBinding = newProjectRoleTemplateBindingClient(client)
client.Cluster = newClusterClient(client)
client.ClusterEvent = newClusterEventClient(client)
client.ClusterRegistrationToken = newClusterRegistrationTokenClient(client)
client.Catalog = newCatalogClient(client)
client.Template = newTemplateClient(client)
client.TemplateVersion = newTemplateVersionClient(client)

View File

@ -18,7 +18,7 @@ const (
ClusterFieldDescription = "description"
ClusterFieldFinalizers = "finalizers"
ClusterFieldGoogleKubernetesEngineConfig = "googleKubernetesEngineConfig"
ClusterFieldId = "id"
ClusterFieldInternal = "internal"
ClusterFieldLabels = "labels"
ClusterFieldLimits = "limits"
ClusterFieldName = "name"
@ -48,7 +48,7 @@ type Cluster struct {
Description string `json:"description,omitempty"`
Finalizers []string `json:"finalizers,omitempty"`
GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"`
Id string `json:"id,omitempty"`
Internal *bool `json:"internal,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Limits map[string]string `json:"limits,omitempty"`
Name string `json:"name,omitempty"`

View File

@ -0,0 +1,101 @@
package client
import (
"github.com/rancher/norman/types"
)
const (
ClusterRegistrationTokenType = "clusterRegistrationToken"
ClusterRegistrationTokenFieldAnnotations = "annotations"
ClusterRegistrationTokenFieldCreated = "created"
ClusterRegistrationTokenFieldFinalizers = "finalizers"
ClusterRegistrationTokenFieldLabels = "labels"
ClusterRegistrationTokenFieldName = "name"
ClusterRegistrationTokenFieldOwnerReferences = "ownerReferences"
ClusterRegistrationTokenFieldRemoved = "removed"
ClusterRegistrationTokenFieldResourcePath = "resourcePath"
ClusterRegistrationTokenFieldState = "state"
ClusterRegistrationTokenFieldStatus = "status"
ClusterRegistrationTokenFieldTransitioning = "transitioning"
ClusterRegistrationTokenFieldTransitioningMessage = "transitioningMessage"
ClusterRegistrationTokenFieldUuid = "uuid"
)
type ClusterRegistrationToken struct {
types.Resource
Annotations map[string]string `json:"annotations,omitempty"`
Created string `json:"created,omitempty"`
Finalizers []string `json:"finalizers,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Name string `json:"name,omitempty"`
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty"`
Removed string `json:"removed,omitempty"`
ResourcePath string `json:"resourcePath,omitempty"`
State string `json:"state,omitempty"`
Status *ClusterRegistrationTokenStatus `json:"status,omitempty"`
Transitioning string `json:"transitioning,omitempty"`
TransitioningMessage string `json:"transitioningMessage,omitempty"`
Uuid string `json:"uuid,omitempty"`
}
type ClusterRegistrationTokenCollection struct {
types.Collection
Data []ClusterRegistrationToken `json:"data,omitempty"`
client *ClusterRegistrationTokenClient
}
type ClusterRegistrationTokenClient struct {
apiClient *Client
}
type ClusterRegistrationTokenOperations interface {
List(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error)
Create(opts *ClusterRegistrationToken) (*ClusterRegistrationToken, error)
Update(existing *ClusterRegistrationToken, updates interface{}) (*ClusterRegistrationToken, error)
ByID(id string) (*ClusterRegistrationToken, error)
Delete(container *ClusterRegistrationToken) error
}
func newClusterRegistrationTokenClient(apiClient *Client) *ClusterRegistrationTokenClient {
return &ClusterRegistrationTokenClient{
apiClient: apiClient,
}
}
func (c *ClusterRegistrationTokenClient) Create(container *ClusterRegistrationToken) (*ClusterRegistrationToken, error) {
resp := &ClusterRegistrationToken{}
err := c.apiClient.Ops.DoCreate(ClusterRegistrationTokenType, container, resp)
return resp, err
}
func (c *ClusterRegistrationTokenClient) Update(existing *ClusterRegistrationToken, updates interface{}) (*ClusterRegistrationToken, error) {
resp := &ClusterRegistrationToken{}
err := c.apiClient.Ops.DoUpdate(ClusterRegistrationTokenType, &existing.Resource, updates, resp)
return resp, err
}
func (c *ClusterRegistrationTokenClient) List(opts *types.ListOpts) (*ClusterRegistrationTokenCollection, error) {
resp := &ClusterRegistrationTokenCollection{}
err := c.apiClient.Ops.DoList(ClusterRegistrationTokenType, opts, resp)
resp.client = c
return resp, err
}
func (cc *ClusterRegistrationTokenCollection) Next() (*ClusterRegistrationTokenCollection, error) {
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
resp := &ClusterRegistrationTokenCollection{}
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
resp.client = cc.client
return resp, err
}
return nil, nil
}
func (c *ClusterRegistrationTokenClient) ByID(id string) (*ClusterRegistrationToken, error) {
resp := &ClusterRegistrationToken{}
err := c.apiClient.Ops.DoByID(ClusterRegistrationTokenType, id, resp)
return resp, err
}
func (c *ClusterRegistrationTokenClient) Delete(container *ClusterRegistrationToken) error {
return c.apiClient.Ops.DoResourceDelete(ClusterRegistrationTokenType, &container.Resource)
}

View File

@ -0,0 +1,8 @@
package client
const (
ClusterRegistrationTokenSpecType = "clusterRegistrationTokenSpec"
)
type ClusterRegistrationTokenSpec struct {
}

View File

@ -0,0 +1,14 @@
package client
const (
ClusterRegistrationTokenStatusType = "clusterRegistrationTokenStatus"
ClusterRegistrationTokenStatusFieldCommand = "command"
ClusterRegistrationTokenStatusFieldManifestURL = "manifestUrl"
ClusterRegistrationTokenStatusFieldToken = "token"
)
type ClusterRegistrationTokenStatus struct {
Command string `json:"command,omitempty"`
ManifestURL string `json:"manifestUrl,omitempty"`
Token string `json:"token,omitempty"`
}

View File

@ -4,15 +4,15 @@ const (
ClusterSpecType = "clusterSpec"
ClusterSpecFieldAzureKubernetesServiceConfig = "azureKubernetesServiceConfig"
ClusterSpecFieldDescription = "description"
ClusterSpecFieldDisplayName = "displayName"
ClusterSpecFieldGoogleKubernetesEngineConfig = "googleKubernetesEngineConfig"
ClusterSpecFieldInternal = "internal"
ClusterSpecFieldRancherKubernetesEngineConfig = "rancherKubernetesEngineConfig"
)
type ClusterSpec struct {
AzureKubernetesServiceConfig *AzureKubernetesServiceConfig `json:"azureKubernetesServiceConfig,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"displayName,omitempty"`
GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"`
Internal *bool `json:"internal,omitempty"`
RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty"`
}