1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-16 05:53:00 +00:00

Vendor Update for types

This commit is contained in:
galal-hussein 2018-06-02 00:28:18 +02:00 committed by Denise
parent 3c906a9ed2
commit f11f4a08f7
18 changed files with 455 additions and 919 deletions

View File

@ -25,4 +25,4 @@ github.com/ugorji/go/codec ccfe18359b55b97855cee1d3f74e5efbda4869d
github.com/Microsoft/go-winio ab35fc04b6365e8fcb18e6e9e41ea4a02b10b175
github.com/rancher/norman ff60298f31f081b06d198815b4c178a578664f7d
github.com/rancher/types f08dc626d420185972a3bcf11504b81d7f2d37e0
github.com/rancher/types 6fc8ba1235e567395d0a1af03279d0287eb77035

View File

@ -133,7 +133,7 @@ type Notification struct {
}
type SMTPConfig struct {
Host string `json:"host,omitempty" norman:"required,type=dnsLabel"`
Host string `json:"host,omitempty" norman:"required,type=hostname"`
Port int `json:"port,omitempty" norman:"required,min=1,max=65535,default=587"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`

View File

@ -100,10 +100,10 @@ type GithubConfig struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline" mapstructure:",squash"`
Hostname string `json:"hostname,omitempty" norman:"default=github.com" norman:"noupdate"`
TLS bool `json:"tls,omitempty" norman:"notnullable,default=true" norman:"noupdate"`
ClientID string `json:"clientId,omitempty" norman:"noupdate"`
ClientSecret string `json:"clientSecret,omitempty" norman:"noupdate,type=password"`
Hostname string `json:"hostname,omitempty" norman:"default=github.com" norman:"required"`
TLS bool `json:"tls,omitempty" norman:"notnullable,default=true" norman:"required"`
ClientID string `json:"clientId,omitempty" norman:"required"`
ClientSecret string `json:"clientSecret,omitempty" norman:"required,type=password"`
}
type GithubConfigTestOutput struct {
@ -141,7 +141,7 @@ type ActiveDirectoryConfig struct {
GroupNameAttribute string `json:"groupNameAttribute,omitempty" norman:"default=name,required"`
GroupDNAttribute string `json:"groupDNAttribute,omitempty" norman:"default=distinguishedName,required"`
GroupMemberUserAttribute string `json:"groupMemberUserAttribute,omitempty" norman:"default=distinguishedName,required"`
GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty"`
GroupMemberMappingAttribute string `json:"groupMemberMappingAttribute,omitempty" norman:"default=member,required"`
ConnectionTimeout int64 `json:"connectionTimeout,omitempty" norman:"default=5000"`
}
@ -151,21 +151,3 @@ type ActiveDirectoryTestAndApplyInput struct {
Password string `json:"password"`
Enabled bool `json:"enabled,omitempty"`
}
type AzureADConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline" mapstructure:",squash"`
TenantID string `json:"tenantId,omitempty" norman:"required"`
ClientID string `json:"clientId,omitempty" norman:"required"`
Domain string `json:"domain,omitempty" norman:"required"`
ClientSecret string `json:"clientSecret,omitempty"`
}
type AzureADTestAndApplyInput struct {
AzureADConfig AzureADConfig `json:"azureAdConfig, omitempty"`
Username string `json:"username"`
Password string `json:"password"`
Enabled bool `json:"enabled,omitempty"`
}

View File

@ -73,18 +73,15 @@ type RoleTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
DisplayName string `json:"displayName,omitempty" norman:"required"`
Description string `json:"description"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
Builtin bool `json:"builtin" norman:"nocreate,noupdate"`
External bool `json:"external"`
Hidden bool `json:"hidden"`
// Enabled is a bool pointer so that it will be backwards compatible with previous versions of rancher. This field
// did not always exist. If it were a normal bool, old resources would default to false. With a pointer we can
// interpret the absence (nil) of the field to mean true.
Enabled *bool `json:"enabled,omitempty" norman:"type=boolean,default=true"`
Context string `json:"context" norman:"type=string,options=project|cluster"`
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
DisplayName string `json:"displayName,omitempty" norman:"required"`
Description string `json:"description"`
Rules []rbacv1.PolicyRule `json:"rules,omitempty"`
Builtin bool `json:"builtin" norman:"nocreate,noupdate"`
External bool `json:"external"`
Hidden bool `json:"hidden"`
Locked bool `json:"locked,omitempty" norman:"type=boolean"`
Context string `json:"context" norman:"type=string,options=project|cluster"`
RoleTemplateNames []string `json:"roleTemplateNames,omitempty" norman:"type=array[reference[roleTemplate]]"`
}
type PodSecurityPolicyTemplate struct {

View File

@ -112,8 +112,9 @@ type TemplateVersionSpec struct {
UpgradeVersionLinks map[string]string `json:"upgradeVersionLinks,omitempty"`
Digest string `json:"digest,omitempty"`
Files map[string]string `json:"files,omitempty"`
Questions []Question `json:"questions,omitempty"`
Files map[string]string `json:"files,omitempty"`
Questions []Question `json:"questions,omitempty"`
RequiredNamespace string `json:"requiredNamespace,omitempty"`
}
type TemplateVersionStatus struct {

View File

@ -56,7 +56,7 @@ type Cluster struct {
}
type ClusterSpec struct {
DisplayName string `json:"displayName"`
DisplayName string `json:"displayName" norman:"required"`
Description string `json:"description"`
Internal bool `json:"internal" norman:"nocreate,noupdate"`
DesiredAgentImage string `json:"desiredAgentImage"`
@ -240,6 +240,10 @@ type GenerateKubeConfigOutput struct {
Config string `json:"config"`
}
type ExportOutput struct {
YAMLOutput string `json:"yamlOutput"`
}
type ImportClusterYamlInput struct {
YAML string `json:"yaml,omitempty"`
DefaultNamespace string `json:"defaultNamespace,omitempty"`

View File

@ -2,12 +2,11 @@ package v3
import (
"github.com/rancher/norman/condition"
"github.com/rancher/norman/types"
"k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type GlobalComposeConfig struct {
type ComposeConfig struct {
metav1.TypeMeta `json:",inline"`
// Standard objects metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
@ -44,20 +43,3 @@ type ComposeCondition struct {
// Human-readable message indicating details about last transition
Message string `json:"message,omitempty"`
}
type ClusterComposeConfig struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
// Standard objects metadata. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#metadata
metav1.ObjectMeta `json:"metadata,omitempty"`
// Specification of the desired behavior of the the cluster. More info:
// https://github.com/kubernetes/community/blob/master/contributors/devel/api-conventions.md#spec-and-status
Spec ClusterComposeSpec `json:"spec,omitempty"`
Status ComposeStatus `json:"status,omitempty"`
}
type ClusterComposeSpec struct {
ClusterName string `json:"clusterName" norman:"type=reference[cluster]"`
RancherCompose string `json:"rancherCompose,omitempty"`
}

View File

@ -3,7 +3,7 @@ package v3
import "github.com/rancher/types/image"
const (
DefaultK8s = "v1.10.1-rancher2-1"
DefaultK8s = "v1.10.3-rancher2-1"
)
var (
@ -236,6 +236,31 @@ var (
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
},
"v1.10.3-rancher2-1": {
Etcd: m("quay.io/coreos/etcd:v3.1.12"),
Kubernetes: m("rancher/hyperkube:v1.10.3-rancher2"),
Alpine: m("rancher/rke-tools:v0.1.9"),
NginxProxy: m("rancher/rke-tools:v0.1.9"),
CertDownloader: m("rancher/rke-tools:v0.1.9"),
KubernetesServicesSidecar: m("rancher/rke-tools:v0.1.9"),
KubeDNS: m("gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.8"),
DNSmasq: m("gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.8"),
KubeDNSSidecar: m("gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.8"),
KubeDNSAutoscaler: m("gcr.io/google_containers/cluster-proportional-autoscaler-amd64:1.0.0"),
Flannel: m("quay.io/coreos/flannel:v0.9.1"),
FlannelCNI: m("quay.io/coreos/flannel-cni:v0.2.0"),
CalicoNode: m("quay.io/calico/node:v3.1.1"),
CalicoCNI: m("quay.io/calico/cni:v3.1.1"),
CalicoCtl: m("quay.io/calico/ctl:v2.0.0"),
CanalNode: m("quay.io/calico/node:v3.1.1"),
CanalCNI: m("quay.io/calico/cni:v3.1.1"),
CanalFlannel: m("quay.io/coreos/flannel:v0.9.1"),
WeaveNode: m("weaveworks/weave-kube:2.1.2"),
WeaveCNI: m("weaveworks/weave-npc:2.1.2"),
PodInfraContainer: m("gcr.io/google_containers/pause-amd64:3.1"),
Ingress: m("rancher/nginx-ingress-controller:0.10.2-rancher3"),
IngressBackend: m("k8s.gcr.io/defaultbackend:1.4"),
},
}
// K8sVersionServiceOptions - service options per k8s version

View File

@ -1,252 +0,0 @@
package v3
import (
"context"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"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 (
ClusterComposeConfigGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "ClusterComposeConfig",
}
ClusterComposeConfigResource = metav1.APIResource{
Name: "clustercomposeconfigs",
SingularName: "clustercomposeconfig",
Namespaced: true,
Kind: ClusterComposeConfigGroupVersionKind.Kind,
}
)
type ClusterComposeConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterComposeConfig
}
type ClusterComposeConfigHandlerFunc func(key string, obj *ClusterComposeConfig) error
type ClusterComposeConfigLister interface {
List(namespace string, selector labels.Selector) (ret []*ClusterComposeConfig, err error)
Get(namespace, name string) (*ClusterComposeConfig, error)
}
type ClusterComposeConfigController interface {
Informer() cache.SharedIndexInformer
Lister() ClusterComposeConfigLister
AddHandler(name string, handler ClusterComposeConfigHandlerFunc)
AddClusterScopedHandler(name, clusterName string, handler ClusterComposeConfigHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ClusterComposeConfigInterface interface {
ObjectClient() *objectclient.ObjectClient
Create(*ClusterComposeConfig) (*ClusterComposeConfig, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error)
Update(*ClusterComposeConfig) (*ClusterComposeConfig, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ClusterComposeConfigList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ClusterComposeConfigController
AddHandler(name string, sync ClusterComposeConfigHandlerFunc)
AddLifecycle(name string, lifecycle ClusterComposeConfigLifecycle)
AddClusterScopedHandler(name, clusterName string, sync ClusterComposeConfigHandlerFunc)
AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterComposeConfigLifecycle)
}
type clusterComposeConfigLister struct {
controller *clusterComposeConfigController
}
func (l *clusterComposeConfigLister) List(namespace string, selector labels.Selector) (ret []*ClusterComposeConfig, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*ClusterComposeConfig))
})
return
}
func (l *clusterComposeConfigLister) Get(namespace, name string) (*ClusterComposeConfig, 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: ClusterComposeConfigGroupVersionKind.Group,
Resource: "clusterComposeConfig",
}, name)
}
return obj.(*ClusterComposeConfig), nil
}
type clusterComposeConfigController struct {
controller.GenericController
}
func (c *clusterComposeConfigController) Lister() ClusterComposeConfigLister {
return &clusterComposeConfigLister{
controller: c,
}
}
func (c *clusterComposeConfigController) AddHandler(name string, handler ClusterComposeConfigHandlerFunc) {
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.(*ClusterComposeConfig))
})
}
func (c *clusterComposeConfigController) AddClusterScopedHandler(name, cluster string, handler ClusterComposeConfigHandlerFunc) {
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.(*ClusterComposeConfig))
})
}
type clusterComposeConfigFactory struct {
}
func (c clusterComposeConfigFactory) Object() runtime.Object {
return &ClusterComposeConfig{}
}
func (c clusterComposeConfigFactory) List() runtime.Object {
return &ClusterComposeConfigList{}
}
func (s *clusterComposeConfigClient) Controller() ClusterComposeConfigController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.clusterComposeConfigControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ClusterComposeConfigGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &clusterComposeConfigController{
GenericController: genericController,
}
s.client.clusterComposeConfigControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type clusterComposeConfigClient struct {
client *Client
ns string
objectClient *objectclient.ObjectClient
controller ClusterComposeConfigController
}
func (s *clusterComposeConfigClient) ObjectClient() *objectclient.ObjectClient {
return s.objectClient
}
func (s *clusterComposeConfigClient) Create(o *ClusterComposeConfig) (*ClusterComposeConfig, error) {
obj, err := s.objectClient.Create(o)
return obj.(*ClusterComposeConfig), err
}
func (s *clusterComposeConfigClient) Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*ClusterComposeConfig), err
}
func (s *clusterComposeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*ClusterComposeConfig), err
}
func (s *clusterComposeConfigClient) Update(o *ClusterComposeConfig) (*ClusterComposeConfig, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*ClusterComposeConfig), err
}
func (s *clusterComposeConfigClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *clusterComposeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *clusterComposeConfigClient) List(opts metav1.ListOptions) (*ClusterComposeConfigList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ClusterComposeConfigList), err
}
func (s *clusterComposeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *clusterComposeConfigClient) Patch(o *ClusterComposeConfig, data []byte, subresources ...string) (*ClusterComposeConfig, error) {
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
return obj.(*ClusterComposeConfig), err
}
func (s *clusterComposeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *clusterComposeConfigClient) AddHandler(name string, sync ClusterComposeConfigHandlerFunc) {
s.Controller().AddHandler(name, sync)
}
func (s *clusterComposeConfigClient) AddLifecycle(name string, lifecycle ClusterComposeConfigLifecycle) {
sync := NewClusterComposeConfigLifecycleAdapter(name, false, s, lifecycle)
s.AddHandler(name, sync)
}
func (s *clusterComposeConfigClient) AddClusterScopedHandler(name, clusterName string, sync ClusterComposeConfigHandlerFunc) {
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
}
func (s *clusterComposeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterComposeConfigLifecycle) {
sync := NewClusterComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.AddClusterScopedHandler(name, clusterName, sync)
}

View File

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

View File

@ -0,0 +1,251 @@
package v3
import (
"context"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"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 (
ComposeConfigGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "ComposeConfig",
}
ComposeConfigResource = metav1.APIResource{
Name: "composeconfigs",
SingularName: "composeconfig",
Namespaced: false,
Kind: ComposeConfigGroupVersionKind.Kind,
}
)
type ComposeConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ComposeConfig
}
type ComposeConfigHandlerFunc func(key string, obj *ComposeConfig) error
type ComposeConfigLister interface {
List(namespace string, selector labels.Selector) (ret []*ComposeConfig, err error)
Get(namespace, name string) (*ComposeConfig, error)
}
type ComposeConfigController interface {
Informer() cache.SharedIndexInformer
Lister() ComposeConfigLister
AddHandler(name string, handler ComposeConfigHandlerFunc)
AddClusterScopedHandler(name, clusterName string, handler ComposeConfigHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ComposeConfigInterface interface {
ObjectClient() *objectclient.ObjectClient
Create(*ComposeConfig) (*ComposeConfig, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ComposeConfig, error)
Get(name string, opts metav1.GetOptions) (*ComposeConfig, error)
Update(*ComposeConfig) (*ComposeConfig, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ComposeConfigList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ComposeConfigController
AddHandler(name string, sync ComposeConfigHandlerFunc)
AddLifecycle(name string, lifecycle ComposeConfigLifecycle)
AddClusterScopedHandler(name, clusterName string, sync ComposeConfigHandlerFunc)
AddClusterScopedLifecycle(name, clusterName string, lifecycle ComposeConfigLifecycle)
}
type composeConfigLister struct {
controller *composeConfigController
}
func (l *composeConfigLister) List(namespace string, selector labels.Selector) (ret []*ComposeConfig, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*ComposeConfig))
})
return
}
func (l *composeConfigLister) Get(namespace, name string) (*ComposeConfig, 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: ComposeConfigGroupVersionKind.Group,
Resource: "composeConfig",
}, name)
}
return obj.(*ComposeConfig), nil
}
type composeConfigController struct {
controller.GenericController
}
func (c *composeConfigController) Lister() ComposeConfigLister {
return &composeConfigLister{
controller: c,
}
}
func (c *composeConfigController) AddHandler(name string, handler ComposeConfigHandlerFunc) {
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.(*ComposeConfig))
})
}
func (c *composeConfigController) AddClusterScopedHandler(name, cluster string, handler ComposeConfigHandlerFunc) {
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.(*ComposeConfig))
})
}
type composeConfigFactory struct {
}
func (c composeConfigFactory) Object() runtime.Object {
return &ComposeConfig{}
}
func (c composeConfigFactory) List() runtime.Object {
return &ComposeConfigList{}
}
func (s *composeConfigClient) Controller() ComposeConfigController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.composeConfigControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ComposeConfigGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &composeConfigController{
GenericController: genericController,
}
s.client.composeConfigControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type composeConfigClient struct {
client *Client
ns string
objectClient *objectclient.ObjectClient
controller ComposeConfigController
}
func (s *composeConfigClient) ObjectClient() *objectclient.ObjectClient {
return s.objectClient
}
func (s *composeConfigClient) Create(o *ComposeConfig) (*ComposeConfig, error) {
obj, err := s.objectClient.Create(o)
return obj.(*ComposeConfig), err
}
func (s *composeConfigClient) Get(name string, opts metav1.GetOptions) (*ComposeConfig, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*ComposeConfig), err
}
func (s *composeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ComposeConfig, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*ComposeConfig), err
}
func (s *composeConfigClient) Update(o *ComposeConfig) (*ComposeConfig, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*ComposeConfig), err
}
func (s *composeConfigClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *composeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *composeConfigClient) List(opts metav1.ListOptions) (*ComposeConfigList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ComposeConfigList), err
}
func (s *composeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *composeConfigClient) Patch(o *ComposeConfig, data []byte, subresources ...string) (*ComposeConfig, error) {
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
return obj.(*ComposeConfig), err
}
func (s *composeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *composeConfigClient) AddHandler(name string, sync ComposeConfigHandlerFunc) {
s.Controller().AddHandler(name, sync)
}
func (s *composeConfigClient) AddLifecycle(name string, lifecycle ComposeConfigLifecycle) {
sync := NewComposeConfigLifecycleAdapter(name, false, s, lifecycle)
s.AddHandler(name, sync)
}
func (s *composeConfigClient) AddClusterScopedHandler(name, clusterName string, sync ComposeConfigHandlerFunc) {
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
}
func (s *composeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ComposeConfigLifecycle) {
sync := NewComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.AddClusterScopedHandler(name, clusterName, sync)
}

View File

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

View File

@ -76,14 +76,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*AuthzConfig).DeepCopyInto(out.(*AuthzConfig))
return nil
}, InType: reflect.TypeOf(&AuthzConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*AzureADConfig).DeepCopyInto(out.(*AzureADConfig))
return nil
}, InType: reflect.TypeOf(&AzureADConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*AzureADTestAndApplyInput).DeepCopyInto(out.(*AzureADTestAndApplyInput))
return nil
}, InType: reflect.TypeOf(&AzureADTestAndApplyInput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*AzureCloudProvider).DeepCopyInto(out.(*AzureCloudProvider))
return nil
@ -156,18 +148,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*ClusterComponentStatus).DeepCopyInto(out.(*ClusterComponentStatus))
return nil
}, InType: reflect.TypeOf(&ClusterComponentStatus{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ClusterComposeConfig).DeepCopyInto(out.(*ClusterComposeConfig))
return nil
}, InType: reflect.TypeOf(&ClusterComposeConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ClusterComposeConfigList).DeepCopyInto(out.(*ClusterComposeConfigList))
return nil
}, InType: reflect.TypeOf(&ClusterComposeConfigList{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ClusterComposeSpec).DeepCopyInto(out.(*ClusterComposeSpec))
return nil
}, InType: reflect.TypeOf(&ClusterComposeSpec{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ClusterCondition).DeepCopyInto(out.(*ClusterCondition))
return nil
@ -252,6 +232,14 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*ComposeCondition).DeepCopyInto(out.(*ComposeCondition))
return nil
}, InType: reflect.TypeOf(&ComposeCondition{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ComposeConfig).DeepCopyInto(out.(*ComposeConfig))
return nil
}, InType: reflect.TypeOf(&ComposeConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ComposeConfigList).DeepCopyInto(out.(*ComposeConfigList))
return nil
}, InType: reflect.TypeOf(&ComposeConfigList{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ComposeSpec).DeepCopyInto(out.(*ComposeSpec))
return nil
@ -300,6 +288,10 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*EmbeddedConfig).DeepCopyInto(out.(*EmbeddedConfig))
return nil
}, InType: reflect.TypeOf(&EmbeddedConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*ExportOutput).DeepCopyInto(out.(*ExportOutput))
return nil
}, InType: reflect.TypeOf(&ExportOutput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*Field).DeepCopyInto(out.(*Field))
return nil
@ -336,14 +328,6 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error {
in.(*GithubConfigTestOutput).DeepCopyInto(out.(*GithubConfigTestOutput))
return nil
}, InType: reflect.TypeOf(&GithubConfigTestOutput{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GlobalComposeConfig).DeepCopyInto(out.(*GlobalComposeConfig))
return nil
}, InType: reflect.TypeOf(&GlobalComposeConfig{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GlobalComposeConfigList).DeepCopyInto(out.(*GlobalComposeConfigList))
return nil
}, InType: reflect.TypeOf(&GlobalComposeConfigList{})},
conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
in.(*GlobalRole).DeepCopyInto(out.(*GlobalRole))
return nil
@ -1271,51 +1255,6 @@ func (in *AuthzConfig) DeepCopy() *AuthzConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AzureADConfig) DeepCopyInto(out *AzureADConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.AuthConfig.DeepCopyInto(&out.AuthConfig)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureADConfig.
func (in *AzureADConfig) DeepCopy() *AzureADConfig {
if in == nil {
return nil
}
out := new(AzureADConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *AzureADConfig) 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 *AzureADTestAndApplyInput) DeepCopyInto(out *AzureADTestAndApplyInput) {
*out = *in
in.AzureADConfig.DeepCopyInto(&out.AzureADConfig)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureADTestAndApplyInput.
func (in *AzureADTestAndApplyInput) DeepCopy() *AzureADTestAndApplyInput {
if in == nil {
return nil
}
out := new(AzureADTestAndApplyInput)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AzureCloudProvider) DeepCopyInto(out *AzureCloudProvider) {
*out = *in
@ -1770,86 +1709,6 @@ func (in *ClusterComponentStatus) DeepCopy() *ClusterComponentStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterComposeConfig) DeepCopyInto(out *ClusterComposeConfig) {
*out = *in
out.Namespaced = in.Namespaced
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeConfig.
func (in *ClusterComposeConfig) DeepCopy() *ClusterComposeConfig {
if in == nil {
return nil
}
out := new(ClusterComposeConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterComposeConfig) 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 *ClusterComposeConfigList) DeepCopyInto(out *ClusterComposeConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterComposeConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeConfigList.
func (in *ClusterComposeConfigList) DeepCopy() *ClusterComposeConfigList {
if in == nil {
return nil
}
out := new(ClusterComposeConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterComposeConfigList) 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 *ClusterComposeSpec) DeepCopyInto(out *ClusterComposeSpec) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeSpec.
func (in *ClusterComposeSpec) DeepCopy() *ClusterComposeSpec {
if in == nil {
return nil
}
out := new(ClusterComposeSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) {
*out = *in
@ -2497,6 +2356,69 @@ func (in *ComposeCondition) DeepCopy() *ComposeCondition {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ComposeConfig) DeepCopyInto(out *ComposeConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeConfig.
func (in *ComposeConfig) DeepCopy() *ComposeConfig {
if in == nil {
return nil
}
out := new(ComposeConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ComposeConfig) 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 *ComposeConfigList) DeepCopyInto(out *ComposeConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ComposeConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeConfigList.
func (in *ComposeConfigList) DeepCopy() *ComposeConfigList {
if in == nil {
return nil
}
out := new(ComposeConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ComposeConfigList) 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 *ComposeSpec) DeepCopyInto(out *ComposeSpec) {
*out = *in
@ -2786,6 +2708,22 @@ func (in *EmbeddedConfig) DeepCopy() *EmbeddedConfig {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ExportOutput) DeepCopyInto(out *ExportOutput) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExportOutput.
func (in *ExportOutput) DeepCopy() *ExportOutput {
if in == nil {
return nil
}
out := new(ExportOutput)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Field) DeepCopyInto(out *Field) {
*out = *in
@ -2954,69 +2892,6 @@ func (in *GithubConfigTestOutput) DeepCopy() *GithubConfigTestOutput {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *GlobalComposeConfig) DeepCopyInto(out *GlobalComposeConfig) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalComposeConfig.
func (in *GlobalComposeConfig) DeepCopy() *GlobalComposeConfig {
if in == nil {
return nil
}
out := new(GlobalComposeConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GlobalComposeConfig) 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 *GlobalComposeConfigList) DeepCopyInto(out *GlobalComposeConfigList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]GlobalComposeConfig, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalComposeConfigList.
func (in *GlobalComposeConfigList) DeepCopy() *GlobalComposeConfigList {
if in == nil {
return nil
}
out := new(GlobalComposeConfigList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *GlobalComposeConfigList) 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 *GlobalRole) DeepCopyInto(out *GlobalRole) {
*out = *in
@ -6058,15 +5933,6 @@ func (in *RoleTemplate) DeepCopyInto(out *RoleTemplate) {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Enabled != nil {
in, out := &in.Enabled, &out.Enabled
if *in == nil {
*out = nil
} else {
*out = new(bool)
**out = **in
}
}
if in.RoleTemplateNames != nil {
in, out := &in.RoleTemplateNames, &out.RoleTemplateNames
*out = make([]string, len(*in))

View File

@ -1,251 +0,0 @@
package v3
import (
"context"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"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 (
GlobalComposeConfigGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "GlobalComposeConfig",
}
GlobalComposeConfigResource = metav1.APIResource{
Name: "globalcomposeconfigs",
SingularName: "globalcomposeconfig",
Namespaced: false,
Kind: GlobalComposeConfigGroupVersionKind.Kind,
}
)
type GlobalComposeConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []GlobalComposeConfig
}
type GlobalComposeConfigHandlerFunc func(key string, obj *GlobalComposeConfig) error
type GlobalComposeConfigLister interface {
List(namespace string, selector labels.Selector) (ret []*GlobalComposeConfig, err error)
Get(namespace, name string) (*GlobalComposeConfig, error)
}
type GlobalComposeConfigController interface {
Informer() cache.SharedIndexInformer
Lister() GlobalComposeConfigLister
AddHandler(name string, handler GlobalComposeConfigHandlerFunc)
AddClusterScopedHandler(name, clusterName string, handler GlobalComposeConfigHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type GlobalComposeConfigInterface interface {
ObjectClient() *objectclient.ObjectClient
Create(*GlobalComposeConfig) (*GlobalComposeConfig, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error)
Update(*GlobalComposeConfig) (*GlobalComposeConfig, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*GlobalComposeConfigList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() GlobalComposeConfigController
AddHandler(name string, sync GlobalComposeConfigHandlerFunc)
AddLifecycle(name string, lifecycle GlobalComposeConfigLifecycle)
AddClusterScopedHandler(name, clusterName string, sync GlobalComposeConfigHandlerFunc)
AddClusterScopedLifecycle(name, clusterName string, lifecycle GlobalComposeConfigLifecycle)
}
type globalComposeConfigLister struct {
controller *globalComposeConfigController
}
func (l *globalComposeConfigLister) List(namespace string, selector labels.Selector) (ret []*GlobalComposeConfig, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*GlobalComposeConfig))
})
return
}
func (l *globalComposeConfigLister) Get(namespace, name string) (*GlobalComposeConfig, 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: GlobalComposeConfigGroupVersionKind.Group,
Resource: "globalComposeConfig",
}, name)
}
return obj.(*GlobalComposeConfig), nil
}
type globalComposeConfigController struct {
controller.GenericController
}
func (c *globalComposeConfigController) Lister() GlobalComposeConfigLister {
return &globalComposeConfigLister{
controller: c,
}
}
func (c *globalComposeConfigController) AddHandler(name string, handler GlobalComposeConfigHandlerFunc) {
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.(*GlobalComposeConfig))
})
}
func (c *globalComposeConfigController) AddClusterScopedHandler(name, cluster string, handler GlobalComposeConfigHandlerFunc) {
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.(*GlobalComposeConfig))
})
}
type globalComposeConfigFactory struct {
}
func (c globalComposeConfigFactory) Object() runtime.Object {
return &GlobalComposeConfig{}
}
func (c globalComposeConfigFactory) List() runtime.Object {
return &GlobalComposeConfigList{}
}
func (s *globalComposeConfigClient) Controller() GlobalComposeConfigController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.globalComposeConfigControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(GlobalComposeConfigGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &globalComposeConfigController{
GenericController: genericController,
}
s.client.globalComposeConfigControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type globalComposeConfigClient struct {
client *Client
ns string
objectClient *objectclient.ObjectClient
controller GlobalComposeConfigController
}
func (s *globalComposeConfigClient) ObjectClient() *objectclient.ObjectClient {
return s.objectClient
}
func (s *globalComposeConfigClient) Create(o *GlobalComposeConfig) (*GlobalComposeConfig, error) {
obj, err := s.objectClient.Create(o)
return obj.(*GlobalComposeConfig), err
}
func (s *globalComposeConfigClient) Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*GlobalComposeConfig), err
}
func (s *globalComposeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*GlobalComposeConfig), err
}
func (s *globalComposeConfigClient) Update(o *GlobalComposeConfig) (*GlobalComposeConfig, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*GlobalComposeConfig), err
}
func (s *globalComposeConfigClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *globalComposeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *globalComposeConfigClient) List(opts metav1.ListOptions) (*GlobalComposeConfigList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*GlobalComposeConfigList), err
}
func (s *globalComposeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *globalComposeConfigClient) Patch(o *GlobalComposeConfig, data []byte, subresources ...string) (*GlobalComposeConfig, error) {
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
return obj.(*GlobalComposeConfig), err
}
func (s *globalComposeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *globalComposeConfigClient) AddHandler(name string, sync GlobalComposeConfigHandlerFunc) {
s.Controller().AddHandler(name, sync)
}
func (s *globalComposeConfigClient) AddLifecycle(name string, lifecycle GlobalComposeConfigLifecycle) {
sync := NewGlobalComposeConfigLifecycleAdapter(name, false, s, lifecycle)
s.AddHandler(name, sync)
}
func (s *globalComposeConfigClient) AddClusterScopedHandler(name, clusterName string, sync GlobalComposeConfigHandlerFunc) {
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
}
func (s *globalComposeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle GlobalComposeConfigLifecycle) {
sync := NewGlobalComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.AddClusterScopedHandler(name, clusterName, sync)
}

View File

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

View File

@ -56,8 +56,7 @@ type Interface interface {
PipelineExecutionsGetter
PipelineExecutionLogsGetter
SourceCodeRepositoriesGetter
GlobalComposeConfigsGetter
ClusterComposeConfigsGetter
ComposeConfigsGetter
}
type Client struct {
@ -106,8 +105,7 @@ type Client struct {
pipelineExecutionControllers map[string]PipelineExecutionController
pipelineExecutionLogControllers map[string]PipelineExecutionLogController
sourceCodeRepositoryControllers map[string]SourceCodeRepositoryController
globalComposeConfigControllers map[string]GlobalComposeConfigController
clusterComposeConfigControllers map[string]ClusterComposeConfigController
composeConfigControllers map[string]ComposeConfigController
}
func NewForConfig(config rest.Config) (Interface, error) {
@ -165,8 +163,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
pipelineExecutionControllers: map[string]PipelineExecutionController{},
pipelineExecutionLogControllers: map[string]PipelineExecutionLogController{},
sourceCodeRepositoryControllers: map[string]SourceCodeRepositoryController{},
globalComposeConfigControllers: map[string]GlobalComposeConfigController{},
clusterComposeConfigControllers: map[string]ClusterComposeConfigController{},
composeConfigControllers: map[string]ComposeConfigController{},
}, nil
}
@ -715,26 +712,13 @@ func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryIn
}
}
type GlobalComposeConfigsGetter interface {
GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface
type ComposeConfigsGetter interface {
ComposeConfigs(namespace string) ComposeConfigInterface
}
func (c *Client) GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &GlobalComposeConfigResource, GlobalComposeConfigGroupVersionKind, globalComposeConfigFactory{})
return &globalComposeConfigClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type ClusterComposeConfigsGetter interface {
ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface
}
func (c *Client) ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterComposeConfigResource, ClusterComposeConfigGroupVersionKind, clusterComposeConfigFactory{})
return &clusterComposeConfigClient{
func (c *Client) ComposeConfigs(namespace string) ComposeConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ComposeConfigResource, ComposeConfigGroupVersionKind, composeConfigFactory{})
return &composeConfigClient{
ns: namespace,
client: c,
objectClient: objectClient,

View File

@ -115,10 +115,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&PipelineExecutionLogList{},
&SourceCodeRepository{},
&SourceCodeRepositoryList{},
&GlobalComposeConfig{},
&GlobalComposeConfigList{},
&ClusterComposeConfig{},
&ClusterComposeConfigList{},
&ComposeConfig{},
&ComposeConfigList{},
)
return nil
}

View File

@ -5,4 +5,4 @@ k8s.io/kubernetes v1.8.3
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
github.com/rancher/norman e6973cb055f2390e8814884353981ffa5496e30c
github.com/rancher/norman 79b91ea33c9ce18094018b26e86fa2577cac2bdd