mirror of
https://github.com/rancher/rke.git
synced 2025-09-21 11:27:32 +00:00
Merge pull request #308 from galal-hussein/fail_swap_on
Fail swap on option for kubelet
This commit is contained in:
@@ -3,6 +3,7 @@ package services
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
"github.com/docker/docker/api/types/container"
|
"github.com/docker/docker/api/types/container"
|
||||||
"github.com/rancher/rke/docker"
|
"github.com/rancher/rke/docker"
|
||||||
@@ -44,6 +45,7 @@ func buildKubeletConfig(host *hosts.Host, kubeletService v3.KubeletService) (*co
|
|||||||
"--cloud-provider=",
|
"--cloud-provider=",
|
||||||
"--kubeconfig=" + pki.GetConfigPath(pki.KubeNodeCertName),
|
"--kubeconfig=" + pki.GetConfigPath(pki.KubeNodeCertName),
|
||||||
"--require-kubeconfig=True",
|
"--require-kubeconfig=True",
|
||||||
|
"--fail-swap-on=" + strconv.FormatBool(kubeletService.FailSwapOn),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
hostCfg := &container.HostConfig{
|
hostCfg := &container.HostConfig{
|
||||||
|
@@ -24,4 +24,4 @@ github.com/coreos/go-semver e214231b295a8ea9479f11b70b35d5acf3556d9
|
|||||||
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869dc
|
||||||
|
|
||||||
github.com/rancher/norman 151aa66e3e99de7e0d195e2d5ca96b1f95544555
|
github.com/rancher/norman 151aa66e3e99de7e0d195e2d5ca96b1f95544555
|
||||||
github.com/rancher/types 8775720ab65d46b52e2ae14e93ebe18a2cca509b
|
github.com/rancher/types bfd6a6afc4202269a90d2621f5a7f7593b250f91
|
||||||
|
6
vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go
generated
vendored
6
vendor/github.com/rancher/types/apis/management.cattle.io/v3/catalog_types.go
generated
vendored
@@ -25,6 +25,12 @@ type CatalogSpec struct {
|
|||||||
type CatalogStatus struct {
|
type CatalogStatus struct {
|
||||||
LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty"`
|
LastRefreshTimestamp string `json:"lastRefreshTimestamp,omitempty"`
|
||||||
Commit string `json:"commit,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 {
|
type Template struct {
|
||||||
|
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
3
vendor/github.com/rancher/types/apis/management.cattle.io/v3/machine_types.go
generated
vendored
@@ -71,8 +71,8 @@ type MachineStatus struct {
|
|||||||
MachineDriverConfig string `json:"machineDriverConfig,omitempty"`
|
MachineDriverConfig string `json:"machineDriverConfig,omitempty"`
|
||||||
NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty"`
|
NodeAnnotations map[string]string `json:"nodeAnnotations,omitempty"`
|
||||||
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
|
NodeLabels map[string]string `json:"nodeLabels,omitempty"`
|
||||||
Token string `json:"token"`
|
|
||||||
NodeTaints []v1.Taint `json:"nodeTaints,omitempty"`
|
NodeTaints []v1.Taint `json:"nodeTaints,omitempty"`
|
||||||
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -119,6 +119,7 @@ type CustomConfig struct {
|
|||||||
type MachineSpec struct {
|
type MachineSpec struct {
|
||||||
NodeSpec v1.NodeSpec `json:"nodeSpec"`
|
NodeSpec v1.NodeSpec `json:"nodeSpec"`
|
||||||
CustomConfig *CustomConfig `json:"customConfig"`
|
CustomConfig *CustomConfig `json:"customConfig"`
|
||||||
|
Imported bool `json:"imported"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
DisplayName string `json:"displayName"`
|
DisplayName string `json:"displayName"`
|
||||||
RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=dnsLabel,nullable,noupdate"`
|
RequestedHostname string `json:"requestedHostname,omitempty" norman:"type=dnsLabel,nullable,noupdate"`
|
||||||
|
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
2
vendor/github.com/rancher/types/apis/management.cattle.io/v3/rke_types.go
generated
vendored
@@ -129,6 +129,8 @@ type KubeletService struct {
|
|||||||
InfraContainerImage string `yaml:"infra_container_image" json:"infraContainerImage,omitempty"`
|
InfraContainerImage string `yaml:"infra_container_image" json:"infraContainerImage,omitempty"`
|
||||||
// Cluster DNS service ip
|
// Cluster DNS service ip
|
||||||
ClusterDNSServer string `yaml:"cluster_dns_server" json:"clusterDnsServer,omitempty"`
|
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 {
|
type KubeproxyService struct {
|
||||||
|
10
vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go
generated
vendored
10
vendor/github.com/rancher/types/apis/management.cattle.io/v3/stack_types.go
generated
vendored
@@ -5,16 +5,16 @@ import (
|
|||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Stack struct {
|
type App struct {
|
||||||
types.Namespaced
|
types.Namespaced
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||||
|
|
||||||
Spec StackSpec `json:"spec,omitempty"`
|
Spec AppSpec `json:"spec,omitempty"`
|
||||||
Status StackStatus `json:"status,omitempty"`
|
Status AppStatus `json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StackSpec struct {
|
type AppSpec struct {
|
||||||
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"`
|
ProjectName string `json:"projectName,omitempty" norman:"type=reference[project]"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
InstallNamespace string `json:"installNamespace,omitempty"`
|
InstallNamespace string `json:"installNamespace,omitempty"`
|
||||||
@@ -27,7 +27,7 @@ type StackSpec struct {
|
|||||||
Groups []string `json:"groups,omitempty"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StackStatus struct {
|
type AppStatus struct {
|
||||||
Releases []ReleaseInfo `json:"releases,omitempty"`
|
Releases []ReleaseInfo `json:"releases,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
252
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go
generated
vendored
Normal file
252
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_controller.go
generated
vendored
Normal file
@@ -0,0 +1,252 @@
|
|||||||
|
package v3
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/rancher/norman/clientbase"
|
||||||
|
"github.com/rancher/norman/controller"
|
||||||
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
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)
|
||||||
|
}
|
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go
generated
vendored
Normal file
51
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_app_lifecycle_adapter.go
generated
vendored
Normal file
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
322
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
322
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_deepcopy.go
generated
vendored
@@ -23,6 +23,22 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
|||||||
in.(*Action).DeepCopyInto(out.(*Action))
|
in.(*Action).DeepCopyInto(out.(*Action))
|
||||||
return nil
|
return nil
|
||||||
}, InType: reflect.TypeOf(&Action{})},
|
}, 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 {
|
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||||
in.(*AuthConfig).DeepCopyInto(out.(*AuthConfig))
|
in.(*AuthConfig).DeepCopyInto(out.(*AuthConfig))
|
||||||
return nil
|
return nil
|
||||||
@@ -495,22 +511,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
|||||||
in.(*SplunkConfig).DeepCopyInto(out.(*SplunkConfig))
|
in.(*SplunkConfig).DeepCopyInto(out.(*SplunkConfig))
|
||||||
return nil
|
return nil
|
||||||
}, InType: reflect.TypeOf(&SplunkConfig{})},
|
}, 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 {
|
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||||
in.(*SyslogConfig).DeepCopyInto(out.(*SyslogConfig))
|
in.(*SyslogConfig).DeepCopyInto(out.(*SyslogConfig))
|
||||||
return nil
|
return nil
|
||||||
@@ -567,6 +567,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
|||||||
in.(*Values).DeepCopyInto(out.(*Values))
|
in.(*Values).DeepCopyInto(out.(*Values))
|
||||||
return nil
|
return nil
|
||||||
}, InType: reflect.TypeOf(&Values{})},
|
}, 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 {
|
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||||
in.(*Zookeeper).DeepCopyInto(out.(*Zookeeper))
|
in.(*Zookeeper).DeepCopyInto(out.(*Zookeeper))
|
||||||
return nil
|
return nil
|
||||||
@@ -590,6 +594,133 @@ func (in *Action) DeepCopy() *Action {
|
|||||||
return out
|
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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *AuthConfig) DeepCopyInto(out *AuthConfig) {
|
func (in *AuthConfig) DeepCopyInto(out *AuthConfig) {
|
||||||
*out = *in
|
*out = *in
|
||||||
@@ -770,7 +901,7 @@ func (in *Catalog) DeepCopyInto(out *Catalog) {
|
|||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
out.Spec = in.Spec
|
out.Spec = in.Spec
|
||||||
out.Status = in.Status
|
in.Status.DeepCopyInto(&out.Status)
|
||||||
return
|
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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *CatalogStatus) DeepCopyInto(out *CatalogStatus) {
|
func (in *CatalogStatus) DeepCopyInto(out *CatalogStatus) {
|
||||||
*out = *in
|
*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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3774,133 +3912,6 @@ func (in *SplunkConfig) DeepCopy() *SplunkConfig {
|
|||||||
return out
|
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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *SyslogConfig) DeepCopyInto(out *SyslogConfig) {
|
func (in *SyslogConfig) DeepCopyInto(out *SyslogConfig) {
|
||||||
*out = *in
|
*out = *in
|
||||||
@@ -4310,6 +4321,29 @@ func (in *Values) DeepCopy() *Values {
|
|||||||
return out
|
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.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *Zookeeper) DeepCopyInto(out *Zookeeper) {
|
func (in *Zookeeper) DeepCopyInto(out *Zookeeper) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
16
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
16
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_k8s_client.go
generated
vendored
@@ -37,7 +37,7 @@ type Interface interface {
|
|||||||
AuthConfigsGetter
|
AuthConfigsGetter
|
||||||
TokensGetter
|
TokensGetter
|
||||||
DynamicSchemasGetter
|
DynamicSchemasGetter
|
||||||
StacksGetter
|
AppsGetter
|
||||||
PreferencesGetter
|
PreferencesGetter
|
||||||
ClusterLoggingsGetter
|
ClusterLoggingsGetter
|
||||||
ProjectLoggingsGetter
|
ProjectLoggingsGetter
|
||||||
@@ -73,7 +73,7 @@ type Client struct {
|
|||||||
authConfigControllers map[string]AuthConfigController
|
authConfigControllers map[string]AuthConfigController
|
||||||
tokenControllers map[string]TokenController
|
tokenControllers map[string]TokenController
|
||||||
dynamicSchemaControllers map[string]DynamicSchemaController
|
dynamicSchemaControllers map[string]DynamicSchemaController
|
||||||
stackControllers map[string]StackController
|
appControllers map[string]AppController
|
||||||
preferenceControllers map[string]PreferenceController
|
preferenceControllers map[string]PreferenceController
|
||||||
clusterLoggingControllers map[string]ClusterLoggingController
|
clusterLoggingControllers map[string]ClusterLoggingController
|
||||||
projectLoggingControllers map[string]ProjectLoggingController
|
projectLoggingControllers map[string]ProjectLoggingController
|
||||||
@@ -118,7 +118,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
|||||||
authConfigControllers: map[string]AuthConfigController{},
|
authConfigControllers: map[string]AuthConfigController{},
|
||||||
tokenControllers: map[string]TokenController{},
|
tokenControllers: map[string]TokenController{},
|
||||||
dynamicSchemaControllers: map[string]DynamicSchemaController{},
|
dynamicSchemaControllers: map[string]DynamicSchemaController{},
|
||||||
stackControllers: map[string]StackController{},
|
appControllers: map[string]AppController{},
|
||||||
preferenceControllers: map[string]PreferenceController{},
|
preferenceControllers: map[string]PreferenceController{},
|
||||||
clusterLoggingControllers: map[string]ClusterLoggingController{},
|
clusterLoggingControllers: map[string]ClusterLoggingController{},
|
||||||
projectLoggingControllers: map[string]ProjectLoggingController{},
|
projectLoggingControllers: map[string]ProjectLoggingController{},
|
||||||
@@ -438,13 +438,13 @@ func (c *Client) DynamicSchemas(namespace string) DynamicSchemaInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type StacksGetter interface {
|
type AppsGetter interface {
|
||||||
Stacks(namespace string) StackInterface
|
Apps(namespace string) AppInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Stacks(namespace string) StackInterface {
|
func (c *Client) Apps(namespace string) AppInterface {
|
||||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &StackResource, StackGroupVersionKind, stackFactory{})
|
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &AppResource, AppGroupVersionKind, appFactory{})
|
||||||
return &stackClient{
|
return &appClient{
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
client: c,
|
client: c,
|
||||||
objectClient: objectClient,
|
objectClient: objectClient,
|
||||||
|
4
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go
generated
vendored
4
vendor/github.com/rancher/types/apis/management.cattle.io/v3/zz_generated_scheme.go
generated
vendored
@@ -79,8 +79,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
|||||||
&TokenList{},
|
&TokenList{},
|
||||||
&DynamicSchema{},
|
&DynamicSchema{},
|
||||||
&DynamicSchemaList{},
|
&DynamicSchemaList{},
|
||||||
&Stack{},
|
&App{},
|
||||||
&StackList{},
|
&AppList{},
|
||||||
&Preference{},
|
&Preference{},
|
||||||
&PreferenceList{},
|
&PreferenceList{},
|
||||||
&ClusterLogging{},
|
&ClusterLogging{},
|
||||||
|
@@ -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)
|
|
||||||
}
|
|
@@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user