From 7e95b692b530cba591e368f64424dedd6275568c Mon Sep 17 00:00:00 2001 From: Ewout Prangsma Date: Mon, 27 Aug 2018 13:04:17 +0200 Subject: [PATCH] Updated generated code --- .../v1alpha/zz_generated.deepcopy.go | 311 ++++++++---------- .../v1alpha/zz_generated.deepcopy.go | 56 ++-- .../storage/v1alpha/zz_generated.deepcopy.go | 2 +- .../clientset/versioned/clientset.go | 5 +- pkg/generated/clientset/versioned/doc.go | 3 + .../versioned/fake/clientset_generated.go | 12 +- pkg/generated/clientset/versioned/fake/doc.go | 3 + .../clientset/versioned/fake/register.go | 23 +- .../clientset/versioned/scheme/doc.go | 3 + .../clientset/versioned/scheme/register.go | 23 +- .../deployment/v1alpha/arangodeployment.go | 3 + .../deployment/v1alpha/deployment_client.go | 3 + .../versioned/typed/deployment/v1alpha/doc.go | 3 + .../typed/deployment/v1alpha/fake/doc.go | 3 + .../v1alpha/fake/fake_arangodeployment.go | 5 +- .../v1alpha/fake/fake_deployment_client.go | 3 + .../deployment/v1alpha/generated_expansion.go | 3 + .../v1alpha/arangodeploymentreplication.go | 3 + .../typed/replication/v1alpha/doc.go | 3 + .../typed/replication/v1alpha/fake/doc.go | 3 + .../fake/fake_arangodeploymentreplication.go | 5 +- .../v1alpha/fake/fake_replication_client.go | 3 + .../v1alpha/generated_expansion.go | 3 + .../replication/v1alpha/replication_client.go | 3 + .../storage/v1alpha/arangolocalstorage.go | 3 + .../versioned/typed/storage/v1alpha/doc.go | 3 + .../typed/storage/v1alpha/fake/doc.go | 3 + .../v1alpha/fake/fake_arangolocalstorage.go | 5 +- .../v1alpha/fake/fake_storage_client.go | 3 + .../storage/v1alpha/generated_expansion.go | 3 + .../typed/storage/v1alpha/storage_client.go | 3 + .../externalversions/deployment/interface.go | 2 +- .../deployment/v1alpha/arangodeployment.go | 8 +- .../deployment/v1alpha/interface.go | 2 +- .../informers/externalversions/factory.go | 63 +++- .../informers/externalversions/generic.go | 10 +- .../internalinterfaces/factory_interfaces.go | 2 +- .../externalversions/replication/interface.go | 2 +- .../v1alpha/arangodeploymentreplication.go | 8 +- .../replication/v1alpha/interface.go | 2 +- .../externalversions/storage/interface.go | 2 +- .../storage/v1alpha/arangolocalstorage.go | 8 +- .../storage/v1alpha/interface.go | 2 +- .../deployment/v1alpha/arangodeployment.go | 2 +- .../deployment/v1alpha/expansion_generated.go | 2 +- .../v1alpha/arangodeploymentreplication.go | 2 +- .../v1alpha/expansion_generated.go | 2 +- .../storage/v1alpha/arangolocalstorage.go | 2 +- .../storage/v1alpha/expansion_generated.go | 2 +- 49 files changed, 376 insertions(+), 257 deletions(-) diff --git a/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go b/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go index 44c6d3db6..9afc322e4 100644 --- a/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go +++ b/pkg/apis/deployment/v1alpha/zz_generated.deepcopy.go @@ -20,15 +20,15 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha import ( time "time" - core_v1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -38,12 +38,7 @@ func (in *Action) DeepCopyInto(out *Action) { in.CreationTime.DeepCopyInto(&out.CreationTime) if in.StartTime != nil { in, out := &in.StartTime, &out.StartTime - if *in == nil { - *out = nil - } else { - *out = new(v1.Time) - (*in).DeepCopyInto(*out) - } + *out = (*in).DeepCopy() } return } @@ -124,12 +119,8 @@ func (in *AuthenticationSpec) DeepCopyInto(out *AuthenticationSpec) { *out = *in if in.JWTSecretName != nil { in, out := &in.JWTSecretName, &out.JWTSecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -149,30 +140,18 @@ func (in *ChaosSpec) DeepCopyInto(out *ChaosSpec) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } if in.Interval != nil { in, out := &in.Interval, &out.Interval - if *in == nil { - *out = nil - } else { - *out = new(time.Duration) - **out = **in - } + *out = new(time.Duration) + **out = **in } if in.KillPodProbability != nil { in, out := &in.KillPodProbability, &out.KillPodProbability - if *in == nil { - *out = nil - } else { - *out = new(Percent) - **out = **in - } + *out = new(Percent) + **out = **in } return } @@ -205,62 +184,60 @@ func (in *Condition) DeepCopy() *Condition { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConditionList) DeepCopyInto(out *ConditionList) { + { + in := &in + *out = make(ConditionList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionList. +func (in ConditionList) DeepCopy() ConditionList { + if in == nil { + return nil + } + out := new(ConditionList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeploymentSpec) DeepCopyInto(out *DeploymentSpec) { *out = *in if in.Mode != nil { in, out := &in.Mode, &out.Mode - if *in == nil { - *out = nil - } else { - *out = new(DeploymentMode) - **out = **in - } + *out = new(DeploymentMode) + **out = **in } if in.Environment != nil { in, out := &in.Environment, &out.Environment - if *in == nil { - *out = nil - } else { - *out = new(Environment) - **out = **in - } + *out = new(Environment) + **out = **in } if in.StorageEngine != nil { in, out := &in.StorageEngine, &out.StorageEngine - if *in == nil { - *out = nil - } else { - *out = new(StorageEngine) - **out = **in - } + *out = new(StorageEngine) + **out = **in } if in.Image != nil { in, out := &in.Image, &out.Image - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } if in.ImagePullPolicy != nil { in, out := &in.ImagePullPolicy, &out.ImagePullPolicy - if *in == nil { - *out = nil - } else { - *out = new(core_v1.PullPolicy) - **out = **in - } + *out = new(v1.PullPolicy) + **out = **in } if in.DowntimeAllowed != nil { in, out := &in.DowntimeAllowed, &out.DowntimeAllowed - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } in.ExternalAccess.DeepCopyInto(&out.ExternalAccess) in.RocksDB.DeepCopyInto(&out.RocksDB) @@ -297,12 +274,8 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { } if in.CurrentImage != nil { in, out := &in.CurrentImage, &out.CurrentImage - if *in == nil { - *out = nil - } else { - *out = new(ImageInfo) - **out = **in - } + *out = new(ImageInfo) + **out = **in } in.Members.DeepCopyInto(&out.Members) if in.Conditions != nil { @@ -321,21 +294,13 @@ func (in *DeploymentStatus) DeepCopyInto(out *DeploymentStatus) { } if in.AcceptedSpec != nil { in, out := &in.AcceptedSpec, &out.AcceptedSpec - if *in == nil { - *out = nil - } else { - *out = new(DeploymentSpec) - (*in).DeepCopyInto(*out) - } + *out = new(DeploymentSpec) + (*in).DeepCopyInto(*out) } if in.SecretHashes != nil { in, out := &in.SecretHashes, &out.SecretHashes - if *in == nil { - *out = nil - } else { - *out = new(SecretHashes) - **out = **in - } + *out = new(SecretHashes) + **out = **in } return } @@ -413,30 +378,18 @@ func (in *ExternalAccessSpec) DeepCopyInto(out *ExternalAccessSpec) { *out = *in if in.Type != nil { in, out := &in.Type, &out.Type - if *in == nil { - *out = nil - } else { - *out = new(ExternalAccessType) - **out = **in - } + *out = new(ExternalAccessType) + **out = **in } if in.NodePort != nil { in, out := &in.NodePort, &out.NodePort - if *in == nil { - *out = nil - } else { - *out = new(int) - **out = **in - } + *out = new(int) + **out = **in } if in.LoadBalancerIP != nil { in, out := &in.LoadBalancerIP, &out.LoadBalancerIP - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -467,6 +420,26 @@ func (in *ImageInfo) DeepCopy() *ImageInfo { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ImageInfoList) DeepCopyInto(out *ImageInfoList) { + { + in := &in + *out = make(ImageInfoList, len(*in)) + copy(*out, *in) + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageInfoList. +func (in ImageInfoList) DeepCopy() ImageInfoList { + if in == nil { + return nil + } + out := new(ImageInfoList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MemberStatus) DeepCopyInto(out *MemberStatus) { *out = *in @@ -480,7 +453,7 @@ func (in *MemberStatus) DeepCopyInto(out *MemberStatus) { } if in.RecentTerminations != nil { in, out := &in.RecentTerminations, &out.RecentTerminations - *out = make([]v1.Time, len(*in)) + *out = make([]metav1.Time, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -498,17 +471,35 @@ func (in *MemberStatus) DeepCopy() *MemberStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in MemberStatusList) DeepCopyInto(out *MemberStatusList) { + { + in := &in + *out = make(MemberStatusList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberStatusList. +func (in MemberStatusList) DeepCopy() MemberStatusList { + if in == nil { + return nil + } + out := new(MemberStatusList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MonitoringSpec) DeepCopyInto(out *MonitoringSpec) { *out = *in if in.TokenSecretName != nil { in, out := &in.TokenSecretName, &out.TokenSecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -523,17 +514,35 @@ func (in *MonitoringSpec) DeepCopy() *MonitoringSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Plan) DeepCopyInto(out *Plan) { + { + in := &in + *out = make(Plan, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plan. +func (in Plan) DeepCopy() Plan { + if in == nil { + return nil + } + out := new(Plan) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RocksDBEncryptionSpec) DeepCopyInto(out *RocksDBEncryptionSpec) { *out = *in if in.KeySecretName != nil { in, out := &in.KeySecretName, &out.KeySecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -586,12 +595,8 @@ func (in *ServerGroupSpec) DeepCopyInto(out *ServerGroupSpec) { *out = *in if in.Count != nil { in, out := &in.Count, &out.Count - if *in == nil { - *out = nil - } else { - *out = new(int) - **out = **in - } + *out = new(int) + **out = **in } if in.Args != nil { in, out := &in.Args, &out.Args @@ -600,29 +605,21 @@ func (in *ServerGroupSpec) DeepCopyInto(out *ServerGroupSpec) { } if in.StorageClassName != nil { in, out := &in.StorageClassName, &out.StorageClassName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } in.Resources.DeepCopyInto(&out.Resources) if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations - *out = make([]core_v1.Toleration, len(*in)) + *out = make([]v1.Toleration, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.ServiceAccountName != nil { in, out := &in.ServiceAccountName, &out.ServiceAccountName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -642,21 +639,13 @@ func (in *SyncAuthenticationSpec) DeepCopyInto(out *SyncAuthenticationSpec) { *out = *in if in.JWTSecretName != nil { in, out := &in.JWTSecretName, &out.JWTSecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } if in.ClientCASecretName != nil { in, out := &in.ClientCASecretName, &out.ClientCASecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -703,12 +692,8 @@ func (in *SyncSpec) DeepCopyInto(out *SyncSpec) { *out = *in if in.Enabled != nil { in, out := &in.Enabled, &out.Enabled - if *in == nil { - *out = nil - } else { - *out = new(bool) - **out = **in - } + *out = new(bool) + **out = **in } in.ExternalAccess.DeepCopyInto(&out.ExternalAccess) in.Authentication.DeepCopyInto(&out.Authentication) @@ -732,12 +717,8 @@ func (in *TLSSpec) DeepCopyInto(out *TLSSpec) { *out = *in if in.CASecretName != nil { in, out := &in.CASecretName, &out.CASecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } if in.AltNames != nil { in, out := &in.AltNames, &out.AltNames @@ -746,12 +727,8 @@ func (in *TLSSpec) DeepCopyInto(out *TLSSpec) { } if in.TTL != nil { in, out := &in.TTL, &out.TTL - if *in == nil { - *out = nil - } else { - *out = new(Duration) - **out = **in - } + *out = new(Duration) + **out = **in } return } diff --git a/pkg/apis/replication/v1alpha/zz_generated.deepcopy.go b/pkg/apis/replication/v1alpha/zz_generated.deepcopy.go index ccfa8d871..35206b000 100644 --- a/pkg/apis/replication/v1alpha/zz_generated.deepcopy.go +++ b/pkg/apis/replication/v1alpha/zz_generated.deepcopy.go @@ -20,7 +20,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha @@ -128,6 +128,28 @@ func (in *Condition) DeepCopy() *Condition { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in ConditionList) DeepCopyInto(out *ConditionList) { + { + in := &in + *out = make(ConditionList, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + return + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConditionList. +func (in ConditionList) DeepCopy() ConditionList { + if in == nil { + return nil + } + out := new(ConditionList) + in.DeepCopyInto(out) + return *out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DatabaseStatus) DeepCopyInto(out *DatabaseStatus) { *out = *in @@ -199,21 +221,13 @@ func (in *EndpointAuthenticationSpec) DeepCopyInto(out *EndpointAuthenticationSp *out = *in if in.KeyfileSecretName != nil { in, out := &in.KeyfileSecretName, &out.KeyfileSecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } if in.UserSecretName != nil { in, out := &in.UserSecretName, &out.UserSecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } @@ -233,12 +247,8 @@ func (in *EndpointSpec) DeepCopyInto(out *EndpointSpec) { *out = *in if in.DeploymentName != nil { in, out := &in.DeploymentName, &out.DeploymentName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } if in.MasterEndpoint != nil { in, out := &in.MasterEndpoint, &out.MasterEndpoint @@ -288,12 +298,8 @@ func (in *EndpointTLSSpec) DeepCopyInto(out *EndpointTLSSpec) { *out = *in if in.CASecretName != nil { in, out := &in.CASecretName, &out.CASecretName - if *in == nil { - *out = nil - } else { - *out = new(string) - **out = **in - } + *out = new(string) + **out = **in } return } diff --git a/pkg/apis/storage/v1alpha/zz_generated.deepcopy.go b/pkg/apis/storage/v1alpha/zz_generated.deepcopy.go index 94bb9250c..d2b0cd013 100644 --- a/pkg/apis/storage/v1alpha/zz_generated.deepcopy.go +++ b/pkg/apis/storage/v1alpha/zz_generated.deepcopy.go @@ -20,7 +20,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was autogenerated by deepcopy-gen. Do not edit it manually! +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 44936e362..20784842c 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -17,13 +17,15 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package versioned import ( databasev1alpha "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/deployment/v1alpha" replicationv1alpha "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/replication/v1alpha" storagev1alpha "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/typed/storage/v1alpha" - glog "github.com/golang/glog" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -115,7 +117,6 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy) if err != nil { - glog.Errorf("failed to create the DiscoveryClient: %v", err) return nil, err } return &cs, nil diff --git a/pkg/generated/clientset/versioned/doc.go b/pkg/generated/clientset/versioned/doc.go index eadca8d06..611123583 100644 --- a/pkg/generated/clientset/versioned/doc.go +++ b/pkg/generated/clientset/versioned/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated clientset. package versioned diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 1e3cefd46..00ef7441c 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -46,9 +49,10 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { } } - fakePtr := testing.Fake{} - fakePtr.AddReactor("*", "*", testing.ObjectReaction(o)) - fakePtr.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + cs := &Clientset{} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { gvr := action.GetResource() ns := action.GetNamespace() watch, err := o.Watch(gvr, ns) @@ -58,7 +62,7 @@ func NewSimpleClientset(objects ...runtime.Object) *Clientset { return true, watch, nil }) - return &Clientset{fakePtr, &fakediscovery.FakeDiscovery{Fake: &fakePtr}} + return cs } // Clientset implements clientset.Interface. Meant to be embedded into a diff --git a/pkg/generated/clientset/versioned/fake/doc.go b/pkg/generated/clientset/versioned/fake/doc.go index f49855ef8..abc693b83 100644 --- a/pkg/generated/clientset/versioned/fake/doc.go +++ b/pkg/generated/clientset/versioned/fake/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated fake clientset. package fake diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 70c37b32b..08555281c 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -27,15 +30,16 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) - -func init() { - v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + databasev1alpha.AddToScheme, + replicationv1alpha.AddToScheme, + storagev1alpha.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -48,12 +52,13 @@ func init() { // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -func AddToScheme(scheme *runtime.Scheme) { - databasev1alpha.AddToScheme(scheme) - replicationv1alpha.AddToScheme(scheme) - storagev1alpha.AddToScheme(scheme) +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) } diff --git a/pkg/generated/clientset/versioned/scheme/doc.go b/pkg/generated/clientset/versioned/scheme/doc.go index 0edf246bd..938255afa 100644 --- a/pkg/generated/clientset/versioned/scheme/doc.go +++ b/pkg/generated/clientset/versioned/scheme/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package contains the scheme of the automatically generated clientset. package scheme diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index de3b9f360..470ea8df3 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package scheme import ( @@ -27,15 +30,16 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) - -func init() { - v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) - AddToScheme(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + databasev1alpha.AddToScheme, + replicationv1alpha.AddToScheme, + storagev1alpha.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition @@ -48,12 +52,13 @@ func init() { // ) // // kclientset, _ := kubernetes.NewForConfig(c) -// aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) // // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. -func AddToScheme(scheme *runtime.Scheme) { - databasev1alpha.AddToScheme(scheme) - replicationv1alpha.AddToScheme(scheme) - storagev1alpha.AddToScheme(scheme) +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) } diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go index 59ad656f0..48c30a20f 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/arangodeployment.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go index 345033471..75288b76f 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/deployment_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go index f48feba5c..7853ae553 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go index 6055f5176..7958e7822 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go index 8127d727c..7e7e9d749 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_arangodeployment.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -63,7 +66,7 @@ func (c *FakeArangoDeployments) List(opts v1.ListOptions) (result *v1alpha.Arang if label == nil { label = labels.Everything() } - list := &v1alpha.ArangoDeploymentList{} + list := &v1alpha.ArangoDeploymentList{ListMeta: obj.(*v1alpha.ArangoDeploymentList).ListMeta} for _, item := range obj.(*v1alpha.ArangoDeploymentList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go index 472e7def9..be0eda489 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/fake/fake_deployment_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go index 2e36f2670..ba13ce770 100644 --- a/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/deployment/v1alpha/generated_expansion.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha type ArangoDeploymentExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/arangodeploymentreplication.go index b548a7665..2c0a45dba 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/arangodeploymentreplication.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/doc.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/doc.go index f48feba5c..7853ae553 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/doc.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/doc.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/doc.go index 6055f5176..7958e7822 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/doc.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_arangodeploymentreplication.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_arangodeploymentreplication.go index 96c937aed..6cc260310 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_arangodeploymentreplication.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_arangodeploymentreplication.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -63,7 +66,7 @@ func (c *FakeArangoDeploymentReplications) List(opts v1.ListOptions) (result *v1 if label == nil { label = labels.Everything() } - list := &v1alpha.ArangoDeploymentReplicationList{} + list := &v1alpha.ArangoDeploymentReplicationList{ListMeta: obj.(*v1alpha.ArangoDeploymentReplicationList).ListMeta} for _, item := range obj.(*v1alpha.ArangoDeploymentReplicationList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_replication_client.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_replication_client.go index bea672c63..57b33879c 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_replication_client.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/fake/fake_replication_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/generated_expansion.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/generated_expansion.go index c102dfab5..7574264ab 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/generated_expansion.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha type ArangoDeploymentReplicationExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/replication/v1alpha/replication_client.go b/pkg/generated/clientset/versioned/typed/replication/v1alpha/replication_client.go index a2ae5c1c2..a9401e90b 100644 --- a/pkg/generated/clientset/versioned/typed/replication/v1alpha/replication_client.go +++ b/pkg/generated/clientset/versioned/typed/replication/v1alpha/replication_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go index 3a09820df..b02118dfc 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/arangolocalstorage.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/doc.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/doc.go index f48feba5c..7853ae553 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/doc.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // This package has the automatically generated typed clients. package v1alpha diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/doc.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/doc.go index 6055f5176..7958e7822 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/doc.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/doc.go @@ -17,5 +17,8 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + // Package fake has the automatically generated clients. package fake diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go index 833e7c550..194505a26 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_arangolocalstorage.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( @@ -60,7 +63,7 @@ func (c *FakeArangoLocalStorages) List(opts v1.ListOptions) (result *v1alpha.Ara if label == nil { label = labels.Everything() } - list := &v1alpha.ArangoLocalStorageList{} + list := &v1alpha.ArangoLocalStorageList{ListMeta: obj.(*v1alpha.ArangoLocalStorageList).ListMeta} for _, item := range obj.(*v1alpha.ArangoLocalStorageList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_storage_client.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_storage_client.go index e1fbbe983..272b74901 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_storage_client.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/fake/fake_storage_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package fake import ( diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/generated_expansion.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/generated_expansion.go index a9dd0388e..68b91f2e1 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/generated_expansion.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha type ArangoLocalStorageExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/storage/v1alpha/storage_client.go b/pkg/generated/clientset/versioned/typed/storage/v1alpha/storage_client.go index b2358f01d..886dbe8cd 100644 --- a/pkg/generated/clientset/versioned/typed/storage/v1alpha/storage_client.go +++ b/pkg/generated/clientset/versioned/typed/storage/v1alpha/storage_client.go @@ -17,6 +17,9 @@ // // Copyright holder is ArangoDB GmbH, Cologne, Germany // + +// Code generated by client-gen. DO NOT EDIT. + package v1alpha import ( diff --git a/pkg/generated/informers/externalversions/deployment/interface.go b/pkg/generated/informers/externalversions/deployment/interface.go index 870850685..9b0cc7e5b 100644 --- a/pkg/generated/informers/externalversions/deployment/interface.go +++ b/pkg/generated/informers/externalversions/deployment/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package database diff --git a/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go b/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go index d5498e0ac..7c1ae444d 100644 --- a/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go +++ b/pkg/generated/informers/externalversions/deployment/v1alpha/arangodeployment.go @@ -18,14 +18,14 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha import ( time "time" - deployment_v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha" + deploymentv1alpha "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha" versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" v1alpha "github.com/arangodb/kube-arangodb/pkg/generated/listers/deployment/v1alpha" @@ -74,7 +74,7 @@ func NewFilteredArangoDeploymentInformer(client versioned.Interface, namespace s return client.DatabaseV1alpha().ArangoDeployments(namespace).Watch(options) }, }, - &deployment_v1alpha.ArangoDeployment{}, + &deploymentv1alpha.ArangoDeployment{}, resyncPeriod, indexers, ) @@ -85,7 +85,7 @@ func (f *arangoDeploymentInformer) defaultInformer(client versioned.Interface, r } func (f *arangoDeploymentInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&deployment_v1alpha.ArangoDeployment{}, f.defaultInformer) + return f.factory.InformerFor(&deploymentv1alpha.ArangoDeployment{}, f.defaultInformer) } func (f *arangoDeploymentInformer) Lister() v1alpha.ArangoDeploymentLister { diff --git a/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go b/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go index 4fbbb770e..1825ffa1c 100644 --- a/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go +++ b/pkg/generated/informers/externalversions/deployment/v1alpha/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/externalversions/factory.go index c88fc2a3f..fc58ab927 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/externalversions/factory.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions @@ -38,12 +38,16 @@ import ( cache "k8s.io/client-go/tools/cache" ) +// SharedInformerOption defines the functional option type for SharedInformerFactory. +type SharedInformerOption func(*sharedInformerFactory) *sharedInformerFactory + type sharedInformerFactory struct { client versioned.Interface namespace string tweakListOptions internalinterfaces.TweakListOptionsFunc lock sync.Mutex defaultResync time.Duration + customResync map[reflect.Type]time.Duration informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -51,23 +55,62 @@ type sharedInformerFactory struct { startedInformers map[reflect.Type]bool } -// NewSharedInformerFactory constructs a new instance of sharedInformerFactory +// WithCustomResyncConfig sets a custom resync period for the specified informer types. +func WithCustomResyncConfig(resyncConfig map[v1.Object]time.Duration) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + for k, v := range resyncConfig { + factory.customResync[reflect.TypeOf(k)] = v + } + return factory + } +} + +// WithTweakListOptions sets a custom filter on all listers of the configured SharedInformerFactory. +func WithTweakListOptions(tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.tweakListOptions = tweakListOptions + return factory + } +} + +// WithNamespace limits the SharedInformerFactory to the specified namespace. +func WithNamespace(namespace string) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.namespace = namespace + return factory + } +} + +// NewSharedInformerFactory constructs a new instance of sharedInformerFactory for all namespaces. func NewSharedInformerFactory(client versioned.Interface, defaultResync time.Duration) SharedInformerFactory { - return NewFilteredSharedInformerFactory(client, defaultResync, v1.NamespaceAll, nil) + return NewSharedInformerFactoryWithOptions(client, defaultResync) } // NewFilteredSharedInformerFactory constructs a new instance of sharedInformerFactory. // Listers obtained via this SharedInformerFactory will be subject to the same filters // as specified here. +// Deprecated: Please use NewSharedInformerFactoryWithOptions instead func NewFilteredSharedInformerFactory(client versioned.Interface, defaultResync time.Duration, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) SharedInformerFactory { - return &sharedInformerFactory{ + return NewSharedInformerFactoryWithOptions(client, defaultResync, WithNamespace(namespace), WithTweakListOptions(tweakListOptions)) +} + +// NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options. +func NewSharedInformerFactoryWithOptions(client versioned.Interface, defaultResync time.Duration, options ...SharedInformerOption) SharedInformerFactory { + factory := &sharedInformerFactory{ client: client, - namespace: namespace, - tweakListOptions: tweakListOptions, + namespace: v1.NamespaceAll, defaultResync: defaultResync, informers: make(map[reflect.Type]cache.SharedIndexInformer), startedInformers: make(map[reflect.Type]bool), + customResync: make(map[reflect.Type]time.Duration), + } + + // Apply all options + for _, opt := range options { + factory = opt(factory) } + + return factory } // Start initializes all requested informers. @@ -116,7 +159,13 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal if exists { return informer } - informer = newFunc(f.client, f.defaultResync) + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) f.informers[informerType] = informer return informer diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index b169aa0ef..c94e774a4 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package externalversions @@ -26,8 +26,8 @@ import ( "fmt" v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1alpha" - replication_v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1alpha" - storage_v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" + replicationv1alpha "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1alpha" + storagev1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -63,11 +63,11 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Database().V1alpha().ArangoDeployments().Informer()}, nil // Group=replication.database.arangodb.com, Version=v1alpha - case replication_v1alpha.SchemeGroupVersion.WithResource("arangodeploymentreplications"): + case replicationv1alpha.SchemeGroupVersion.WithResource("arangodeploymentreplications"): return &genericInformer{resource: resource.GroupResource(), informer: f.Replication().V1alpha().ArangoDeploymentReplications().Informer()}, nil // Group=storage.arangodb.com, Version=v1alpha - case storage_v1alpha.SchemeGroupVersion.WithResource("arangolocalstorages"): + case storagev1alpha.SchemeGroupVersion.WithResource("arangolocalstorages"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1alpha().ArangoLocalStorages().Informer()}, nil } diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index e2a568374..ea4e3c3ca 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package internalinterfaces diff --git a/pkg/generated/informers/externalversions/replication/interface.go b/pkg/generated/informers/externalversions/replication/interface.go index 6c7a3bcfb..d4bbb9c43 100644 --- a/pkg/generated/informers/externalversions/replication/interface.go +++ b/pkg/generated/informers/externalversions/replication/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package replication diff --git a/pkg/generated/informers/externalversions/replication/v1alpha/arangodeploymentreplication.go b/pkg/generated/informers/externalversions/replication/v1alpha/arangodeploymentreplication.go index 2c45a1651..3e491e1d2 100644 --- a/pkg/generated/informers/externalversions/replication/v1alpha/arangodeploymentreplication.go +++ b/pkg/generated/informers/externalversions/replication/v1alpha/arangodeploymentreplication.go @@ -18,14 +18,14 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha import ( time "time" - replication_v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1alpha" + replicationv1alpha "github.com/arangodb/kube-arangodb/pkg/apis/replication/v1alpha" versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" v1alpha "github.com/arangodb/kube-arangodb/pkg/generated/listers/replication/v1alpha" @@ -74,7 +74,7 @@ func NewFilteredArangoDeploymentReplicationInformer(client versioned.Interface, return client.ReplicationV1alpha().ArangoDeploymentReplications(namespace).Watch(options) }, }, - &replication_v1alpha.ArangoDeploymentReplication{}, + &replicationv1alpha.ArangoDeploymentReplication{}, resyncPeriod, indexers, ) @@ -85,7 +85,7 @@ func (f *arangoDeploymentReplicationInformer) defaultInformer(client versioned.I } func (f *arangoDeploymentReplicationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&replication_v1alpha.ArangoDeploymentReplication{}, f.defaultInformer) + return f.factory.InformerFor(&replicationv1alpha.ArangoDeploymentReplication{}, f.defaultInformer) } func (f *arangoDeploymentReplicationInformer) Lister() v1alpha.ArangoDeploymentReplicationLister { diff --git a/pkg/generated/informers/externalversions/replication/v1alpha/interface.go b/pkg/generated/informers/externalversions/replication/v1alpha/interface.go index c5f378749..aaa561ee3 100644 --- a/pkg/generated/informers/externalversions/replication/v1alpha/interface.go +++ b/pkg/generated/informers/externalversions/replication/v1alpha/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/informers/externalversions/storage/interface.go b/pkg/generated/informers/externalversions/storage/interface.go index 86dd7b1ce..a6f3eb9b3 100644 --- a/pkg/generated/informers/externalversions/storage/interface.go +++ b/pkg/generated/informers/externalversions/storage/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package storage diff --git a/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go b/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go index 62ece31db..f11c6d76b 100644 --- a/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/informers/externalversions/storage/v1alpha/arangolocalstorage.go @@ -18,14 +18,14 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha import ( time "time" - storage_v1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" + storagev1alpha "github.com/arangodb/kube-arangodb/pkg/apis/storage/v1alpha" versioned "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned" internalinterfaces "github.com/arangodb/kube-arangodb/pkg/generated/informers/externalversions/internalinterfaces" v1alpha "github.com/arangodb/kube-arangodb/pkg/generated/listers/storage/v1alpha" @@ -73,7 +73,7 @@ func NewFilteredArangoLocalStorageInformer(client versioned.Interface, resyncPer return client.StorageV1alpha().ArangoLocalStorages().Watch(options) }, }, - &storage_v1alpha.ArangoLocalStorage{}, + &storagev1alpha.ArangoLocalStorage{}, resyncPeriod, indexers, ) @@ -84,7 +84,7 @@ func (f *arangoLocalStorageInformer) defaultInformer(client versioned.Interface, } func (f *arangoLocalStorageInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&storage_v1alpha.ArangoLocalStorage{}, f.defaultInformer) + return f.factory.InformerFor(&storagev1alpha.ArangoLocalStorage{}, f.defaultInformer) } func (f *arangoLocalStorageInformer) Lister() v1alpha.ArangoLocalStorageLister { diff --git a/pkg/generated/informers/externalversions/storage/v1alpha/interface.go b/pkg/generated/informers/externalversions/storage/v1alpha/interface.go index d410030ea..d08509158 100644 --- a/pkg/generated/informers/externalversions/storage/v1alpha/interface.go +++ b/pkg/generated/informers/externalversions/storage/v1alpha/interface.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by informer-gen +// Code generated by informer-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/deployment/v1alpha/arangodeployment.go b/pkg/generated/listers/deployment/v1alpha/arangodeployment.go index 9b1258f59..d64a41e24 100644 --- a/pkg/generated/listers/deployment/v1alpha/arangodeployment.go +++ b/pkg/generated/listers/deployment/v1alpha/arangodeployment.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/deployment/v1alpha/expansion_generated.go b/pkg/generated/listers/deployment/v1alpha/expansion_generated.go index 1e8cad6f6..cc93e7d4f 100644 --- a/pkg/generated/listers/deployment/v1alpha/expansion_generated.go +++ b/pkg/generated/listers/deployment/v1alpha/expansion_generated.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/replication/v1alpha/arangodeploymentreplication.go b/pkg/generated/listers/replication/v1alpha/arangodeploymentreplication.go index 09bdea528..2aa86e8ff 100644 --- a/pkg/generated/listers/replication/v1alpha/arangodeploymentreplication.go +++ b/pkg/generated/listers/replication/v1alpha/arangodeploymentreplication.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/replication/v1alpha/expansion_generated.go b/pkg/generated/listers/replication/v1alpha/expansion_generated.go index 51d8b72b8..1dd6ef1f3 100644 --- a/pkg/generated/listers/replication/v1alpha/expansion_generated.go +++ b/pkg/generated/listers/replication/v1alpha/expansion_generated.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go b/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go index 7a89e9306..aee87946d 100644 --- a/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go +++ b/pkg/generated/listers/storage/v1alpha/arangolocalstorage.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha diff --git a/pkg/generated/listers/storage/v1alpha/expansion_generated.go b/pkg/generated/listers/storage/v1alpha/expansion_generated.go index 76e4cd4fe..917b607b3 100644 --- a/pkg/generated/listers/storage/v1alpha/expansion_generated.go +++ b/pkg/generated/listers/storage/v1alpha/expansion_generated.go @@ -18,7 +18,7 @@ // Copyright holder is ArangoDB GmbH, Cologne, Germany // -// This file was automatically generated by lister-gen +// Code generated by lister-gen. DO NOT EDIT. package v1alpha