From bdf0a9b413f670b12810ed47fe3cd55c557f6bcf Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Sat, 3 Feb 2018 04:32:50 +0200 Subject: [PATCH 1/2] Vendor update --- vendor.conf | 2 +- .../management.cattle.io/v3/catalog_types.go | 6 + .../management.cattle.io/v3/machine_types.go | 3 +- .../apis/management.cattle.io/v3/rke_types.go | 2 + .../management.cattle.io/v3/stack_types.go | 10 +- .../v3/zz_generated_app_controller.go | 252 ++++++++++++++ .../v3/zz_generated_app_lifecycle_adapter.go | 51 +++ .../v3/zz_generated_deepcopy.go | 322 ++++++++++-------- .../v3/zz_generated_k8s_client.go | 16 +- .../v3/zz_generated_scheme.go | 4 +- .../v3/zz_generated_stack_controller.go | 252 -------------- .../zz_generated_stack_lifecycle_adapter.go | 51 --- 12 files changed, 507 insertions(+), 464 deletions(-) create mode 100644 vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go create mode 100644 vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go delete mode 100644 vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_controller.go delete mode 100644 vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_lifecycle_adapter.go diff --git a/vendor.conf b/vendor.conf index ed54166a..4b9df6a9 100644 --- a/vendor.conf +++ b/vendor.conf @@ -24,4 +24,4 @@ github.com/coreos/go-semver e214231b295a8ea9479f11b70b35d5acf3556d9 github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc github.com/rancher/norman 151aa66e3e99de7e0d195e2d5ca96b1f95544555 -github.com/rancher/types 8775720ab65d46b52e2ae14e93ebe18a2cca509b +github.com/rancher/types bfd6a6afc4202269a90d2621f5a7f7593b250f91 diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go index f0295b4f..ef098346 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go @@ -25,6 +25,12 @@ type CatalogSpec struct { type CatalogStatus struct { LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty"` Commit string `json:"commit,omitempty"` + // helmVersionCommits records hash of each helm template version + HelmVersionCommits map[string]VersionCommits `json:"helmVersionCommits,omitempty"` +} + +type VersionCommits struct { + Value map[string]string `json:"Value,omitempty"` } type Template struct { diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go index 220953d7..b5be56f0 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go @@ -71,8 +71,8 @@ type MachineStatus struct { MachineDriverConfig string `json:"machineDriverConfig,omitempty"` NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty"` NodeLabels map[string]string `json:"nodeLabels,omitempty"` - Token string `json:"token"` NodeTaints []v1.Taint `json:"nodeTaints,omitempty"` + ExternalID string `json:"externalId,omitempty"` } var ( @@ -119,6 +119,7 @@ type CustomConfig struct { type MachineSpec struct { NodeSpec v1.NodeSpec `json:"nodeSpec"` CustomConfig *CustomConfig `json:"customConfig"` + Imported bool `json:"imported"` Description string `json:"description,omitempty"` DisplayName string `json:"displayName"` RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=dnsLabel,nullable,noupdate"` diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go index dd3eb6d0..dee5182f 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go @@ -129,6 +129,8 @@ type KubeletService struct { InfraContainerImage string `yaml:"infra_container_image" json:"infraContainerImage,omitempty"` // Cluster DNS service ip ClusterDNSServer string `yaml:"cluster_dns_server" json:"clusterDnsServer,omitempty"` + // Fail if swap is enabled + FailSwapOn bool `yaml:"fail_swap_on" json:"failSwapOn,omitempty"` } type KubeproxyService struct { diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go index d42ee034..0d9ef8db 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go @@ -5,16 +5,16 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -type Stack struct { +type App struct { types.Namespaced metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec StackSpec `json:"spec,omitempty"` - Status StackStatus `json:"status,omitempty"` + Spec AppSpec `json:"spec,omitempty"` + Status AppStatus `json:"status,omitempty"` } -type StackSpec struct { +type AppSpec struct { ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"` Description string `json:"description,omitempty"` InstallNamespace string `json:"installNamespace,omitempty"` @@ -27,7 +27,7 @@ type StackSpec struct { Groups []string `json:"groups,omitempty"` } -type StackStatus struct { +type AppStatus struct { Releases []ReleaseInfo `json:"releases,omitempty"` } diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go new file mode 100644 index 00000000..90e71cbe --- /dev/null +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go @@ -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 ( + AppGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "App", + } + AppResource = metav1.APIResource{ + Name: "apps", + SingularName: "app", + Namespaced: true, + + Kind: AppGroupVersionKind.Kind, + } +) + +type AppList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []App +} + +type AppHandlerFunc func(key string, obj *App) error + +type AppLister interface { + List(namespace string, selector labels.Selector) (ret []*App, err error) + Get(namespace, name string) (*App, error) +} + +type AppController interface { + Informer() cache.SharedIndexInformer + Lister() AppLister + AddHandler(name string, handler AppHandlerFunc) + AddClusterScopedHandler(name, clusterName string, handler AppHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type AppInterface interface { + ObjectClient() *clientbase.ObjectClient + Create(*App) (*App, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*App, error) + Get(name string, opts metav1.GetOptions) (*App, error) + Update(*App) (*App, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*AppList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() AppController + AddHandler(name string, sync AppHandlerFunc) + AddLifecycle(name string, lifecycle AppLifecycle) + AddClusterScopedHandler(name, clusterName string, sync AppHandlerFunc) + AddClusterScopedLifecycle(name, clusterName string, lifecycle AppLifecycle) +} + +type appLister struct { + controller *appController +} + +func (l *appLister) List(namespace string, selector labels.Selector) (ret []*App, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*App)) + }) + return +} + +func (l *appLister) Get(namespace, name string) (*App, 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: AppGroupVersionKind.Group, + Resource: "app", + }, name) + } + return obj.(*App), nil +} + +type appController struct { + controller.GenericController +} + +func (c *appController) Lister() AppLister { + return &appLister{ + controller: c, + } +} + +func (c *appController) AddHandler(name string, handler AppHandlerFunc) { + 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.(*App)) + }) +} + +func (c *appController) AddClusterScopedHandler(name, cluster string, handler AppHandlerFunc) { + 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.(*App)) + }) +} + +type appFactory struct { +} + +func (c appFactory) Object() runtime.Object { + return &App{} +} + +func (c appFactory) List() runtime.Object { + return &AppList{} +} + +func (s *appClient) Controller() AppController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.appControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(AppGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &appController{ + GenericController: genericController, + } + + s.client.appControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type appClient struct { + client *Client + ns string + objectClient *clientbase.ObjectClient + controller AppController +} + +func (s *appClient) ObjectClient() *clientbase.ObjectClient { + return s.objectClient +} + +func (s *appClient) Create(o *App) (*App, error) { + obj, err := s.objectClient.Create(o) + return obj.(*App), err +} + +func (s *appClient) Get(name string, opts metav1.GetOptions) (*App, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*App), err +} + +func (s *appClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*App, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*App), err +} + +func (s *appClient) Update(o *App) (*App, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*App), err +} + +func (s *appClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *appClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *appClient) List(opts metav1.ListOptions) (*AppList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*AppList), err +} + +func (s *appClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *appClient) Patch(o *App, data []byte, subresources ...string) (*App, error) { + obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) + return obj.(*App), err +} + +func (s *appClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *appClient) AddHandler(name string, sync AppHandlerFunc) { + s.Controller().AddHandler(name, sync) +} + +func (s *appClient) AddLifecycle(name string, lifecycle AppLifecycle) { + sync := NewAppLifecycleAdapter(name, false, s, lifecycle) + s.AddHandler(name, sync) +} + +func (s *appClient) AddClusterScopedHandler(name, clusterName string, sync AppHandlerFunc) { + s.Controller().AddClusterScopedHandler(name, clusterName, sync) +} + +func (s *appClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle AppLifecycle) { + sync := NewAppLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.AddClusterScopedHandler(name, clusterName, sync) +} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go new file mode 100644 index 00000000..e341af24 --- /dev/null +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go @@ -0,0 +1,51 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type AppLifecycle interface { + Create(obj *App) (*App, error) + Remove(obj *App) (*App, error) + Updated(obj *App) (*App, error) +} + +type appLifecycleAdapter struct { + lifecycle AppLifecycle +} + +func (w *appLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*App)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *appLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*App)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *appLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*App)) + if o == nil { + return nil, err + } + return o, err +} + +func NewAppLifecycleAdapter(name string, clusterScoped bool, client AppInterface, l AppLifecycle) AppHandlerFunc { + adapter := &appLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *App) error { + if obj == nil { + return syncFn(key, nil) + } + return syncFn(key, obj) + } +} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go index 020ca91d..f670621a 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -23,6 +23,22 @@ 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.(*App).DeepCopyInto(out.(*App)) + return nil + }, InType: reflect.TypeOf(&App{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*AppList).DeepCopyInto(out.(*AppList)) + return nil + }, InType: reflect.TypeOf(&AppList{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*AppSpec).DeepCopyInto(out.(*AppSpec)) + return nil + }, InType: reflect.TypeOf(&AppSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*AppStatus).DeepCopyInto(out.(*AppStatus)) + return nil + }, InType: reflect.TypeOf(&AppStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*AuthConfig).DeepCopyInto(out.(*AuthConfig)) return nil @@ -495,22 +511,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*SplunkConfig).DeepCopyInto(out.(*SplunkConfig)) return nil }, InType: reflect.TypeOf(&SplunkConfig{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*Stack).DeepCopyInto(out.(*Stack)) - return nil - }, InType: reflect.TypeOf(&Stack{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*StackList).DeepCopyInto(out.(*StackList)) - return nil - }, InType: reflect.TypeOf(&StackList{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*StackSpec).DeepCopyInto(out.(*StackSpec)) - return nil - }, InType: reflect.TypeOf(&StackSpec{})}, - conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { - in.(*StackStatus).DeepCopyInto(out.(*StackStatus)) - return nil - }, InType: reflect.TypeOf(&StackStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*SyslogConfig).DeepCopyInto(out.(*SyslogConfig)) return nil @@ -567,6 +567,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*Values).DeepCopyInto(out.(*Values)) return nil }, InType: reflect.TypeOf(&Values{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) 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.(*Zookeeper).DeepCopyInto(out.(*Zookeeper)) return nil @@ -590,6 +594,133 @@ 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 *App) DeepCopyInto(out *App) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new App. +func (in *App) DeepCopy() *App { + if in == nil { + return nil + } + out := new(App) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *App) 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 *AppList) DeepCopyInto(out *AppList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]App, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppList. +func (in *AppList) DeepCopy() *AppList { + if in == nil { + return nil + } + out := new(AppList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AppList) 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 *AppSpec) DeepCopyInto(out *AppSpec) { + *out = *in + if in.Templates != nil { + in, out := &in.Templates, &out.Templates + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Answers != nil { + in, out := &in.Answers, &out.Answers + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tag != nil { + in, out := &in.Tag, &out.Tag + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Groups != nil { + in, out := &in.Groups, &out.Groups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppSpec. +func (in *AppSpec) DeepCopy() *AppSpec { + if in == nil { + return nil + } + out := new(AppSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppStatus) DeepCopyInto(out *AppStatus) { + *out = *in + if in.Releases != nil { + in, out := &in.Releases, &out.Releases + *out = make([]ReleaseInfo, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppStatus. +func (in *AppStatus) DeepCopy() *AppStatus { + if in == nil { + return nil + } + out := new(AppStatus) + 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 @@ -770,7 +901,7 @@ func (in *Catalog) DeepCopyInto(out *Catalog) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec - out.Status = in.Status + in.Status.DeepCopyInto(&out.Status) return } @@ -846,6 +977,13 @@ func (in *CatalogSpec) DeepCopy() *CatalogSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CatalogStatus) DeepCopyInto(out *CatalogStatus) { *out = *in + if in.HelmVersionCommits != nil { + in, out := &in.HelmVersionCommits, &out.HelmVersionCommits + *out = make(map[string]VersionCommits, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } return } @@ -3774,133 +3912,6 @@ func (in *SplunkConfig) DeepCopy() *SplunkConfig { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Stack) DeepCopyInto(out *Stack) { - *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stack. -func (in *Stack) DeepCopy() *Stack { - if in == nil { - return nil - } - out := new(Stack) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Stack) 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 *StackList) DeepCopyInto(out *StackList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Stack, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackList. -func (in *StackList) DeepCopy() *StackList { - if in == nil { - return nil - } - out := new(StackList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *StackList) 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 *StackSpec) DeepCopyInto(out *StackSpec) { - *out = *in - if in.Templates != nil { - in, out := &in.Templates, &out.Templates - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Answers != nil { - in, out := &in.Answers, &out.Answers - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Tag != nil { - in, out := &in.Tag, &out.Tag - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackSpec. -func (in *StackSpec) DeepCopy() *StackSpec { - if in == nil { - return nil - } - out := new(StackSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *StackStatus) DeepCopyInto(out *StackStatus) { - *out = *in - if in.Releases != nil { - in, out := &in.Releases, &out.Releases - *out = make([]ReleaseInfo, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StackStatus. -func (in *StackStatus) DeepCopy() *StackStatus { - if in == nil { - return nil - } - out := new(StackStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SyslogConfig) DeepCopyInto(out *SyslogConfig) { *out = *in @@ -4310,6 +4321,29 @@ func (in *Values) DeepCopy() *Values { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VersionCommits) DeepCopyInto(out *VersionCommits) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *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 VersionCommits. +func (in *VersionCommits) DeepCopy() *VersionCommits { + if in == nil { + return nil + } + out := new(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 *Zookeeper) DeepCopyInto(out *Zookeeper) { *out = *in diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go index 7a8f28ad..72c76325 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -37,7 +37,7 @@ type Interface interface { AuthConfigsGetter TokensGetter DynamicSchemasGetter - StacksGetter + AppsGetter PreferencesGetter ClusterLoggingsGetter ProjectLoggingsGetter @@ -73,7 +73,7 @@ type Client struct { authConfigControllers map[string]AuthConfigController tokenControllers map[string]TokenController dynamicSchemaControllers map[string]DynamicSchemaController - stackControllers map[string]StackController + appControllers map[string]AppController preferenceControllers map[string]PreferenceController clusterLoggingControllers map[string]ClusterLoggingController projectLoggingControllers map[string]ProjectLoggingController @@ -118,7 +118,7 @@ func NewForConfig(config rest.Config) (Interface, error) { authConfigControllers: map[string]AuthConfigController{}, tokenControllers: map[string]TokenController{}, dynamicSchemaControllers: map[string]DynamicSchemaController{}, - stackControllers: map[string]StackController{}, + appControllers: map[string]AppController{}, preferenceControllers: map[string]PreferenceController{}, clusterLoggingControllers: map[string]ClusterLoggingController{}, projectLoggingControllers: map[string]ProjectLoggingController{}, @@ -438,13 +438,13 @@ func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface { } } -type StacksGetter interface { - Stacks(namespace string) StackInterface +type AppsGetter interface { + Apps(namespace string) AppInterface } -func (c *Client) Stacks(namespace string) StackInterface { - objectClient := clientbase.NewObjectClient(namespace, c.restClient, &StackResource, StackGroupVersionKind, stackFactory{}) - return &stackClient{ +func (c *Client) Apps(namespace string) AppInterface { + objectClient := clientbase.NewObjectClient(namespace, c.restClient, &AppResource, AppGroupVersionKind, appFactory{}) + return &appClient{ ns: namespace, client: c, objectClient: objectClient, diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go index a9fd7cc3..5ef914f5 100644 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go +++ b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go @@ -79,8 +79,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &TokenList{}, &DynamicSchema{}, &DynamicSchemaList{}, - &Stack{}, - &StackList{}, + &App{}, + &AppList{}, &Preference{}, &PreferenceList{}, &ClusterLogging{}, diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_controller.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_controller.go deleted file mode 100644 index a5a5e674..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_controller.go +++ /dev/null @@ -1,252 +0,0 @@ -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 ( - StackGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "Stack", - } - StackResource = metav1.APIResource{ - Name: "stacks", - SingularName: "stack", - Namespaced: true, - - Kind: StackGroupVersionKind.Kind, - } -) - -type StackList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Stack -} - -type StackHandlerFunc func(key string, obj *Stack) error - -type StackLister interface { - List(namespace string, selector labels.Selector) (ret []*Stack, err error) - Get(namespace, name string) (*Stack, error) -} - -type StackController interface { - Informer() cache.SharedIndexInformer - Lister() StackLister - AddHandler(name string, handler StackHandlerFunc) - AddClusterScopedHandler(name, clusterName string, handler StackHandlerFunc) - Enqueue(namespace, name string) - Sync(ctx context.Context) error - Start(ctx context.Context, threadiness int) error -} - -type StackInterface interface { - ObjectClient() *clientbase.ObjectClient - Create(*Stack) (*Stack, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Stack, error) - Get(name string, opts metav1.GetOptions) (*Stack, error) - Update(*Stack) (*Stack, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*StackList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() StackController - AddHandler(name string, sync StackHandlerFunc) - AddLifecycle(name string, lifecycle StackLifecycle) - AddClusterScopedHandler(name, clusterName string, sync StackHandlerFunc) - AddClusterScopedLifecycle(name, clusterName string, lifecycle StackLifecycle) -} - -type stackLister struct { - controller *stackController -} - -func (l *stackLister) List(namespace string, selector labels.Selector) (ret []*Stack, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*Stack)) - }) - return -} - -func (l *stackLister) Get(namespace, name string) (*Stack, 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: StackGroupVersionKind.Group, - Resource: "stack", - }, name) - } - return obj.(*Stack), nil -} - -type stackController struct { - controller.GenericController -} - -func (c *stackController) Lister() StackLister { - return &stackLister{ - controller: c, - } -} - -func (c *stackController) AddHandler(name string, handler StackHandlerFunc) { - 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.(*Stack)) - }) -} - -func (c *stackController) AddClusterScopedHandler(name, cluster string, handler StackHandlerFunc) { - 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.(*Stack)) - }) -} - -type stackFactory struct { -} - -func (c stackFactory) Object() runtime.Object { - return &Stack{} -} - -func (c stackFactory) List() runtime.Object { - return &StackList{} -} - -func (s *stackClient) Controller() StackController { - s.client.Lock() - defer s.client.Unlock() - - c, ok := s.client.stackControllers[s.ns] - if ok { - return c - } - - genericController := controller.NewGenericController(StackGroupVersionKind.Kind+"Controller", - s.objectClient) - - c = &stackController{ - GenericController: genericController, - } - - s.client.stackControllers[s.ns] = c - s.client.starters = append(s.client.starters, c) - - return c -} - -type stackClient struct { - client *Client - ns string - objectClient *clientbase.ObjectClient - controller StackController -} - -func (s *stackClient) ObjectClient() *clientbase.ObjectClient { - return s.objectClient -} - -func (s *stackClient) Create(o *Stack) (*Stack, error) { - obj, err := s.objectClient.Create(o) - return obj.(*Stack), err -} - -func (s *stackClient) Get(name string, opts metav1.GetOptions) (*Stack, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*Stack), err -} - -func (s *stackClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*Stack, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*Stack), err -} - -func (s *stackClient) Update(o *Stack) (*Stack, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*Stack), err -} - -func (s *stackClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *stackClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *stackClient) List(opts metav1.ListOptions) (*StackList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*StackList), err -} - -func (s *stackClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *stackClient) Patch(o *Stack, data []byte, subresources ...string) (*Stack, error) { - obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) - return obj.(*Stack), err -} - -func (s *stackClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *stackClient) AddHandler(name string, sync StackHandlerFunc) { - s.Controller().AddHandler(name, sync) -} - -func (s *stackClient) AddLifecycle(name string, lifecycle StackLifecycle) { - sync := NewStackLifecycleAdapter(name, false, s, lifecycle) - s.AddHandler(name, sync) -} - -func (s *stackClient) AddClusterScopedHandler(name, clusterName string, sync StackHandlerFunc) { - s.Controller().AddClusterScopedHandler(name, clusterName, sync) -} - -func (s *stackClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle StackLifecycle) { - sync := NewStackLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.AddClusterScopedHandler(name, clusterName, sync) -} diff --git a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_lifecycle_adapter.go b/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_lifecycle_adapter.go deleted file mode 100644 index a38f28cb..00000000 --- a/vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_stack_lifecycle_adapter.go +++ /dev/null @@ -1,51 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "k8s.io/apimachinery/pkg/runtime" -) - -type StackLifecycle interface { - Create(obj *Stack) (*Stack, error) - Remove(obj *Stack) (*Stack, error) - Updated(obj *Stack) (*Stack, error) -} - -type stackLifecycleAdapter struct { - lifecycle StackLifecycle -} - -func (w *stackLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*Stack)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *stackLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*Stack)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *stackLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*Stack)) - if o == nil { - return nil, err - } - return o, err -} - -func NewStackLifecycleAdapter(name string, clusterScoped bool, client StackInterface, l StackLifecycle) StackHandlerFunc { - adapter := &stackLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *Stack) error { - if obj == nil { - return syncFn(key, nil) - } - return syncFn(key, obj) - } -} From 5f5b1a51a9bde8e825fa12c7112df22624b3a13e Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Sat, 3 Feb 2018 04:33:18 +0200 Subject: [PATCH 2/2] Add kubelet fail-swap-on option --- services/kubelet.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/kubelet.go b/services/kubelet.go index 7fdb34d8..ba6492dd 100644 --- a/services/kubelet.go +++ b/services/kubelet.go @@ -3,6 +3,7 @@ package services import ( "context" "fmt" + "strconv" "github.com/docker/docker/api/types/container" "github.com/rancher/rke/docker" @@ -44,6 +45,7 @@ func buildKubeletConfig(host *hosts.Host, kubeletService v3.KubeletService) (*co "--cloud-provider=", "--kubeconfig=" + pki.GetConfigPath(pki.KubeNodeCertName), "--require-kubeconfig=True", + "--fail-swap-on=" + strconv.FormatBool(kubeletService.FailSwapOn), }, } hostCfg := &container.HostConfig{