Commit bd269f8d authored by Darren Shepherd's avatar Darren Shepherd

Update generated code

parent 1d666d95
// Code generated by go-bindata.
// sources:
// manifests/coredns.yaml
// manifests/nginx-ingress.yaml
// DO NOT EDIT!
package deploy
......@@ -88,6 +89,26 @@ func corednsYaml() (*asset, error) {
return a, nil
}
var _nginxIngressYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\xcc\x31\xae\xc2\x30\x0c\x87\xf1\x3d\xa7\xf0\x05\xda\xea\xe9\x6d\x5e\x59\x38\x01\xbb\x9b\xfe\x55\xac\x24\x6e\x14\x1b\x04\xb7\x47\x95\x58\x58\x3f\xe9\xf7\x49\xd7\x1b\x86\xeb\x61\x4c\xe5\xdf\xe7\x2c\x11\x15\xb3\x1e\xcb\xf3\x2f\x15\xb5\x8d\xe9\x8a\xda\x2e\x77\x19\x91\x1a\x42\x36\x09\xe1\x44\x64\xd2\xc0\x64\xbb\xda\x6b\x52\xdb\x07\xdc\xbf\xd5\xbb\x64\x30\x95\xc7\x8a\xc9\xdf\x1e\x68\xc9\x3b\xf2\x89\xf2\xb9\x61\xf2\x90\xb5\x62\xf9\xc5\x9f\x00\x00\x00\xff\xff\x2d\x6c\xb9\xb9\x8a\x00\x00\x00")
func nginxIngressYamlBytes() ([]byte, error) {
return bindataRead(
_nginxIngressYaml,
"nginx-ingress.yaml",
)
}
func nginxIngressYaml() (*asset, error) {
bytes, err := nginxIngressYamlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "nginx-ingress.yaml", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
......@@ -140,7 +161,8 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"coredns.yaml": corednsYaml,
"coredns.yaml": corednsYaml,
"nginx-ingress.yaml": nginxIngressYaml,
}
// AssetDir returns the file names below a certain
......@@ -184,7 +206,8 @@ type bintree struct {
}
var _bintree = &bintree{nil, map[string]*bintree{
"coredns.yaml": &bintree{corednsYaml, map[string]*bintree{}},
"coredns.yaml": &bintree{corednsYaml, map[string]*bintree{}},
"nginx-ingress.yaml": &bintree{nginxIngressYaml, map[string]*bintree{}},
}}
// RestoreAsset restores an asset under the given directory
......
package v1
import (
batchv1 "k8s.io/api/batch/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *JobList) DeepCopyInto(out *JobList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]batchv1.Job, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JobList.
func (in *JobList) DeepCopy() *JobList {
if in == nil {
return nil
}
out := new(JobList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *JobList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
package v1
import (
"github.com/rancher/norman/lifecycle"
v1 "k8s.io/api/batch/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type JobLifecycle interface {
Create(obj *v1.Job) (runtime.Object, error)
Remove(obj *v1.Job) (runtime.Object, error)
Updated(obj *v1.Job) (runtime.Object, error)
}
type jobLifecycleAdapter struct {
lifecycle JobLifecycle
}
func (w *jobLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *jobLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *jobLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*v1.Job))
if o == nil {
return nil, err
}
return o, err
}
func (w *jobLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*v1.Job))
if o == nil {
return nil, err
}
return o, err
}
func (w *jobLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*v1.Job))
if o == nil {
return nil, err
}
return o, err
}
func NewJobLifecycleAdapter(name string, clusterScoped bool, client JobInterface, l JobLifecycle) JobHandlerFunc {
adapter := &jobLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1.Job) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}
package v1
import (
"context"
"sync"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/objectclient/dynamic"
"github.com/rancher/norman/restwatch"
"k8s.io/client-go/rest"
)
type (
contextKeyType struct{}
contextClientsKeyType struct{}
)
type Interface interface {
RESTClient() rest.Interface
controller.Starter
JobsGetter
}
type Clients struct {
Interface Interface
Job JobClient
}
type Client struct {
sync.Mutex
restClient rest.Interface
starters []controller.Starter
jobControllers map[string]JobController
}
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
c, err := NewForConfig(config)
if err != nil {
return ctx, nil, err
}
cs := NewClientsFromInterface(c)
ctx = context.WithValue(ctx, contextKeyType{}, c)
ctx = context.WithValue(ctx, contextClientsKeyType{}, cs)
return ctx, c, nil
}
func ClientsFrom(ctx context.Context) *Clients {
return ctx.Value(contextClientsKeyType{}).(*Clients)
}
func From(ctx context.Context) Interface {
return ctx.Value(contextKeyType{}).(Interface)
}
func NewClients(config rest.Config) (*Clients, error) {
iface, err := NewForConfig(config)
if err != nil {
return nil, err
}
return NewClientsFromInterface(iface), nil
}
func NewClientsFromInterface(iface Interface) *Clients {
return &Clients{
Interface: iface,
Job: &jobClient2{
iface: iface.Jobs(""),
},
}
}
func NewForConfig(config rest.Config) (Interface, error) {
if config.NegotiatedSerializer == nil {
config.NegotiatedSerializer = dynamic.NegotiatedSerializer
}
restClient, err := restwatch.UnversionedRESTClientFor(&config)
if err != nil {
return nil, err
}
return &Client{
restClient: restClient,
jobControllers: map[string]JobController{},
}, nil
}
func (c *Client) RESTClient() rest.Interface {
return c.restClient
}
func (c *Client) Sync(ctx context.Context) error {
return controller.Sync(ctx, c.starters...)
}
func (c *Client) Start(ctx context.Context, threadiness int) error {
return controller.Start(ctx, threadiness, c.starters...)
}
type JobsGetter interface {
Jobs(namespace string) JobInterface
}
func (c *Client) Jobs(namespace string) JobInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &JobResource, JobGroupVersionKind, jobFactory{})
return &jobClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
package v1
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
GroupName = "batch"
Version = "v1"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this gets cleaned up when the types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&JobList{},
)
return nil
}
package v1
import (
"github.com/rancher/norman/lifecycle"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type ConfigMapLifecycle interface {
Create(obj *v1.ConfigMap) (runtime.Object, error)
Remove(obj *v1.ConfigMap) (runtime.Object, error)
Updated(obj *v1.ConfigMap) (runtime.Object, error)
}
type configMapLifecycleAdapter struct {
lifecycle ConfigMapLifecycle
}
func (w *configMapLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *configMapLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *configMapLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*v1.ConfigMap))
if o == nil {
return nil, err
}
return o, err
}
func (w *configMapLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*v1.ConfigMap))
if o == nil {
return nil, err
}
return o, err
}
func (w *configMapLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*v1.ConfigMap))
if o == nil {
return nil, err
}
return o, err
}
func NewConfigMapLifecycleAdapter(name string, clusterScoped bool, client ConfigMapInterface, l ConfigMapLifecycle) ConfigMapHandlerFunc {
adapter := &configMapLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1.ConfigMap) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}
......@@ -6,6 +6,39 @@ import (
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigMapList) DeepCopyInto(out *ConfigMapList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]corev1.ConfigMap, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapList.
func (in *ConfigMapList) DeepCopy() *ConfigMapList {
if in == nil {
return nil
}
out := new(ConfigMapList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ConfigMapList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeList) DeepCopyInto(out *NodeList) {
*out = *in
out.TypeMeta = in.TypeMeta
......@@ -72,6 +105,39 @@ func (in *PodList) DeepCopyObject() runtime.Object {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceAccountList) DeepCopyInto(out *ServiceAccountList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]corev1.ServiceAccount, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccountList.
func (in *ServiceAccountList) DeepCopy() *ServiceAccountList {
if in == nil {
return nil
}
out := new(ServiceAccountList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ServiceAccountList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ServiceList) DeepCopyInto(out *ServiceList) {
*out = *in
out.TypeMeta = in.TypeMeta
......
......@@ -21,16 +21,20 @@ type Interface interface {
controller.Starter
NodesGetter
ServiceAccountsGetter
ServicesGetter
PodsGetter
ConfigMapsGetter
}
type Clients struct {
Interface Interface
Node NodeClient
Service ServiceClient
Pod PodClient
Node NodeClient
ServiceAccount ServiceAccountClient
Service ServiceClient
Pod PodClient
ConfigMap ConfigMapClient
}
type Client struct {
......@@ -38,9 +42,11 @@ type Client struct {
restClient rest.Interface
starters []controller.Starter
nodeControllers map[string]NodeController
serviceControllers map[string]ServiceController
podControllers map[string]PodController
nodeControllers map[string]NodeController
serviceAccountControllers map[string]ServiceAccountController
serviceControllers map[string]ServiceController
podControllers map[string]PodController
configMapControllers map[string]ConfigMapController
}
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
......@@ -79,12 +85,18 @@ func NewClientsFromInterface(iface Interface) *Clients {
Node: &nodeClient2{
iface: iface.Nodes(""),
},
ServiceAccount: &serviceAccountClient2{
iface: iface.ServiceAccounts(""),
},
Service: &serviceClient2{
iface: iface.Services(""),
},
Pod: &podClient2{
iface: iface.Pods(""),
},
ConfigMap: &configMapClient2{
iface: iface.ConfigMaps(""),
},
}
}
......@@ -101,9 +113,11 @@ func NewForConfig(config rest.Config) (Interface, error) {
return &Client{
restClient: restClient,
nodeControllers: map[string]NodeController{},
serviceControllers: map[string]ServiceController{},
podControllers: map[string]PodController{},
nodeControllers: map[string]NodeController{},
serviceAccountControllers: map[string]ServiceAccountController{},
serviceControllers: map[string]ServiceController{},
podControllers: map[string]PodController{},
configMapControllers: map[string]ConfigMapController{},
}, nil
}
......@@ -132,6 +146,19 @@ func (c *Client) Nodes(namespace string) NodeInterface {
}
}
type ServiceAccountsGetter interface {
ServiceAccounts(namespace string) ServiceAccountInterface
}
func (c *Client) ServiceAccounts(namespace string) ServiceAccountInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ServiceAccountResource, ServiceAccountGroupVersionKind, serviceAccountFactory{})
return &serviceAccountClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type ServicesGetter interface {
Services(namespace string) ServiceInterface
}
......@@ -157,3 +184,16 @@ func (c *Client) Pods(namespace string) PodInterface {
objectClient: objectClient,
}
}
type ConfigMapsGetter interface {
ConfigMaps(namespace string) ConfigMapInterface
}
func (c *Client) ConfigMaps(namespace string) ConfigMapInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ConfigMapResource, ConfigMapGroupVersionKind, configMapFactory{})
return &configMapClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
......@@ -34,8 +34,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&NodeList{},
&ServiceAccountList{},
&ServiceList{},
&PodList{},
&ConfigMapList{},
)
return nil
}
package v1
import (
"github.com/rancher/norman/lifecycle"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type ServiceAccountLifecycle interface {
Create(obj *v1.ServiceAccount) (runtime.Object, error)
Remove(obj *v1.ServiceAccount) (runtime.Object, error)
Updated(obj *v1.ServiceAccount) (runtime.Object, error)
}
type serviceAccountLifecycleAdapter struct {
lifecycle ServiceAccountLifecycle
}
func (w *serviceAccountLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *serviceAccountLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *serviceAccountLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*v1.ServiceAccount))
if o == nil {
return nil, err
}
return o, err
}
func (w *serviceAccountLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*v1.ServiceAccount))
if o == nil {
return nil, err
}
return o, err
}
func (w *serviceAccountLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*v1.ServiceAccount))
if o == nil {
return nil, err
}
return o, err
}
func NewServiceAccountLifecycleAdapter(name string, clusterScoped bool, client ServiceAccountInterface, l ServiceAccountLifecycle) ServiceAccountHandlerFunc {
adapter := &serviceAccountLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1.ServiceAccount) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}
......@@ -3,6 +3,7 @@ package v1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
intstr "k8s.io/apimachinery/pkg/util/intstr"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
......@@ -105,6 +106,107 @@ func (in *AddonStatus) DeepCopy() *AddonStatus {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HelmChart) DeepCopyInto(out *HelmChart) {
*out = *in
out.Namespaced = in.Namespaced
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChart.
func (in *HelmChart) DeepCopy() *HelmChart {
if in == nil {
return nil
}
out := new(HelmChart)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *HelmChart) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HelmChartList) DeepCopyInto(out *HelmChartList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]HelmChart, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartList.
func (in *HelmChartList) DeepCopy() *HelmChartList {
if in == nil {
return nil
}
out := new(HelmChartList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *HelmChartList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HelmChartSpec) DeepCopyInto(out *HelmChartSpec) {
*out = *in
if in.Set != nil {
in, out := &in.Set, &out.Set
*out = make(map[string]intstr.IntOrString, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartSpec.
func (in *HelmChartSpec) DeepCopy() *HelmChartSpec {
if in == nil {
return nil
}
out := new(HelmChartSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *HelmChartStatus) DeepCopyInto(out *HelmChartStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HelmChartStatus.
func (in *HelmChartStatus) DeepCopy() *HelmChartStatus {
if in == nil {
return nil
}
out := new(HelmChartStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ListenerConfig) DeepCopyInto(out *ListenerConfig) {
*out = *in
out.Namespaced = in.Namespaced
......
package v1
import (
"github.com/rancher/norman/lifecycle"
"k8s.io/apimachinery/pkg/runtime"
)
type HelmChartLifecycle interface {
Create(obj *HelmChart) (runtime.Object, error)
Remove(obj *HelmChart) (runtime.Object, error)
Updated(obj *HelmChart) (runtime.Object, error)
}
type helmChartLifecycleAdapter struct {
lifecycle HelmChartLifecycle
}
func (w *helmChartLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *helmChartLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *helmChartLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*HelmChart))
if o == nil {
return nil, err
}
return o, err
}
func (w *helmChartLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*HelmChart))
if o == nil {
return nil, err
}
return o, err
}
func (w *helmChartLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*HelmChart))
if o == nil {
return nil, err
}
return o, err
}
func NewHelmChartLifecycleAdapter(name string, clusterScoped bool, client HelmChartInterface, l HelmChartLifecycle) HelmChartHandlerFunc {
adapter := &helmChartLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *HelmChart) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}
......@@ -20,15 +20,17 @@ type Interface interface {
RESTClient() rest.Interface
controller.Starter
ListenerConfigsGetter
AddonsGetter
HelmChartsGetter
ListenerConfigsGetter
}
type Clients struct {
Interface Interface
ListenerConfig ListenerConfigClient
Addon AddonClient
HelmChart HelmChartClient
ListenerConfig ListenerConfigClient
}
type Client struct {
......@@ -36,8 +38,9 @@ type Client struct {
restClient rest.Interface
starters []controller.Starter
listenerConfigControllers map[string]ListenerConfigController
addonControllers map[string]AddonController
helmChartControllers map[string]HelmChartController
listenerConfigControllers map[string]ListenerConfigController
}
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
......@@ -73,12 +76,15 @@ func NewClientsFromInterface(iface Interface) *Clients {
return &Clients{
Interface: iface,
ListenerConfig: &listenerConfigClient2{
iface: iface.ListenerConfigs(""),
},
Addon: &addonClient2{
iface: iface.Addons(""),
},
HelmChart: &helmChartClient2{
iface: iface.HelmCharts(""),
},
ListenerConfig: &listenerConfigClient2{
iface: iface.ListenerConfigs(""),
},
}
}
......@@ -95,8 +101,9 @@ func NewForConfig(config rest.Config) (Interface, error) {
return &Client{
restClient: restClient,
listenerConfigControllers: map[string]ListenerConfigController{},
addonControllers: map[string]AddonController{},
helmChartControllers: map[string]HelmChartController{},
listenerConfigControllers: map[string]ListenerConfigController{},
}, nil
}
......@@ -112,26 +119,39 @@ func (c *Client) Start(ctx context.Context, threadiness int) error {
return controller.Start(ctx, threadiness, c.starters...)
}
type ListenerConfigsGetter interface {
ListenerConfigs(namespace string) ListenerConfigInterface
type AddonsGetter interface {
Addons(namespace string) AddonInterface
}
func (c *Client) ListenerConfigs(namespace string) ListenerConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ListenerConfigResource, ListenerConfigGroupVersionKind, listenerConfigFactory{})
return &listenerConfigClient{
func (c *Client) Addons(namespace string) AddonInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AddonResource, AddonGroupVersionKind, addonFactory{})
return &addonClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type AddonsGetter interface {
Addons(namespace string) AddonInterface
type HelmChartsGetter interface {
HelmCharts(namespace string) HelmChartInterface
}
func (c *Client) Addons(namespace string) AddonInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &AddonResource, AddonGroupVersionKind, addonFactory{})
return &addonClient{
func (c *Client) HelmCharts(namespace string) HelmChartInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &HelmChartResource, HelmChartGroupVersionKind, helmChartFactory{})
return &helmChartClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type ListenerConfigsGetter interface {
ListenerConfigs(namespace string) ListenerConfigInterface
}
func (c *Client) ListenerConfigs(namespace string) ListenerConfigInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ListenerConfigResource, ListenerConfigGroupVersionKind, listenerConfigFactory{})
return &listenerConfigClient{
ns: namespace,
client: c,
objectClient: objectClient,
......
......@@ -33,10 +33,12 @@ func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this gets cleaned up when the types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&ListenerConfig{},
&ListenerConfigList{},
&Addon{},
&AddonList{},
&HelmChart{},
&HelmChartList{},
&ListenerConfig{},
&ListenerConfigList{},
)
return nil
}
package v1
import (
"github.com/rancher/norman/lifecycle"
v1 "k8s.io/api/rbac/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type ClusterRoleBindingLifecycle interface {
Create(obj *v1.ClusterRoleBinding) (runtime.Object, error)
Remove(obj *v1.ClusterRoleBinding) (runtime.Object, error)
Updated(obj *v1.ClusterRoleBinding) (runtime.Object, error)
}
type clusterRoleBindingLifecycleAdapter struct {
lifecycle ClusterRoleBindingLifecycle
}
func (w *clusterRoleBindingLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *clusterRoleBindingLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *clusterRoleBindingLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*v1.ClusterRoleBinding))
if o == nil {
return nil, err
}
return o, err
}
func (w *clusterRoleBindingLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*v1.ClusterRoleBinding))
if o == nil {
return nil, err
}
return o, err
}
func (w *clusterRoleBindingLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*v1.ClusterRoleBinding))
if o == nil {
return nil, err
}
return o, err
}
func NewClusterRoleBindingLifecycleAdapter(name string, clusterScoped bool, client ClusterRoleBindingInterface, l ClusterRoleBindingLifecycle) ClusterRoleBindingHandlerFunc {
adapter := &clusterRoleBindingLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1.ClusterRoleBinding) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}
package v1
import (
rbacv1 "k8s.io/api/rbac/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterRoleBindingList) DeepCopyInto(out *ClusterRoleBindingList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]rbacv1.ClusterRoleBinding, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRoleBindingList.
func (in *ClusterRoleBindingList) DeepCopy() *ClusterRoleBindingList {
if in == nil {
return nil
}
out := new(ClusterRoleBindingList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterRoleBindingList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
package v1
import (
"context"
"sync"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/objectclient/dynamic"
"github.com/rancher/norman/restwatch"
"k8s.io/client-go/rest"
)
type (
contextKeyType struct{}
contextClientsKeyType struct{}
)
type Interface interface {
RESTClient() rest.Interface
controller.Starter
ClusterRoleBindingsGetter
}
type Clients struct {
Interface Interface
ClusterRoleBinding ClusterRoleBindingClient
}
type Client struct {
sync.Mutex
restClient rest.Interface
starters []controller.Starter
clusterRoleBindingControllers map[string]ClusterRoleBindingController
}
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
c, err := NewForConfig(config)
if err != nil {
return ctx, nil, err
}
cs := NewClientsFromInterface(c)
ctx = context.WithValue(ctx, contextKeyType{}, c)
ctx = context.WithValue(ctx, contextClientsKeyType{}, cs)
return ctx, c, nil
}
func ClientsFrom(ctx context.Context) *Clients {
return ctx.Value(contextClientsKeyType{}).(*Clients)
}
func From(ctx context.Context) Interface {
return ctx.Value(contextKeyType{}).(Interface)
}
func NewClients(config rest.Config) (*Clients, error) {
iface, err := NewForConfig(config)
if err != nil {
return nil, err
}
return NewClientsFromInterface(iface), nil
}
func NewClientsFromInterface(iface Interface) *Clients {
return &Clients{
Interface: iface,
ClusterRoleBinding: &clusterRoleBindingClient2{
iface: iface.ClusterRoleBindings(""),
},
}
}
func NewForConfig(config rest.Config) (Interface, error) {
if config.NegotiatedSerializer == nil {
config.NegotiatedSerializer = dynamic.NegotiatedSerializer
}
restClient, err := restwatch.UnversionedRESTClientFor(&config)
if err != nil {
return nil, err
}
return &Client{
restClient: restClient,
clusterRoleBindingControllers: map[string]ClusterRoleBindingController{},
}, nil
}
func (c *Client) RESTClient() rest.Interface {
return c.restClient
}
func (c *Client) Sync(ctx context.Context) error {
return controller.Sync(ctx, c.starters...)
}
func (c *Client) Start(ctx context.Context, threadiness int) error {
return controller.Start(ctx, threadiness, c.starters...)
}
type ClusterRoleBindingsGetter interface {
ClusterRoleBindings(namespace string) ClusterRoleBindingInterface
}
func (c *Client) ClusterRoleBindings(namespace string) ClusterRoleBindingInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterRoleBindingResource, ClusterRoleBindingGroupVersionKind, clusterRoleBindingFactory{})
return &clusterRoleBindingClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
package v1
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const (
GroupName = "rbac.authorization.k8s.io"
Version = "v1"
)
// SchemeGroupVersion is group version used to register these objects
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
// Kind takes an unqualified kind and returns a Group qualified GroupKind
func Kind(kind string) schema.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
var (
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
// TODO this gets cleaned up when the types are fixed
scheme.AddKnownTypes(SchemeGroupVersion,
&ClusterRoleBindingList{},
)
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment