From 3d4b6dbfba25f828f797d8c9370756ddb0131196 Mon Sep 17 00:00:00 2001 From: Yuxuan Zhu <48610618+yuxuanzhu0214@users.noreply.github.com> Date: Tue, 10 Sep 2024 11:15:54 -0700 Subject: [PATCH] add informer client code to instance manager generated by codegen (#448) * chore(deps): Bump github.com/aws/aws-sdk-go from 1.54.5 to 1.54.15 (#442) Signed-off-by: Yuxuan Zhu * changed instance manager api folder path Signed-off-by: Yuxuan Zhu * added clientset, informers, listers Signed-off-by: Yuxuan Zhu * add schemegroupversion Signed-off-by: Yuxuan Zhu * updated controller-gen to v0.14.0 to fix nil pointer bug in make generate Signed-off-by: Yuxuan Zhu * resolve dependency conflict Signed-off-by: Yuxuan Zhu --------- Signed-off-by: Yuxuan Zhu Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yuxuan Zhu --- .../v1alpha1/groupversion_info.go | 7 +- .../v1alpha1/instancegroup_types.go | 1 + .../v1alpha1/instancegroup_types_test.go | 0 .../v1alpha1/zz_generated.deepcopy.go | 1 - client/clientset/versioned/clientset.go | 118 +++++++++ .../versioned/fake/clientset_generated.go | 83 ++++++ client/clientset/versioned/fake/doc.go | 18 ++ client/clientset/versioned/fake/register.go | 54 ++++ client/clientset/versioned/scheme/doc.go | 18 ++ client/clientset/versioned/scheme/register.go | 54 ++++ .../typed/instancemgr/v1alpha1/doc.go | 18 ++ .../typed/instancemgr/v1alpha1/fake/doc.go | 18 ++ .../v1alpha1/fake/fake_instancegroup.go | 139 ++++++++++ .../v1alpha1/fake/fake_instancemgr_client.go | 38 +++ .../v1alpha1/generated_expansion.go | 19 ++ .../instancemgr/v1alpha1/instancegroup.go | 193 ++++++++++++++ .../v1alpha1/instancemgr_client.go | 105 ++++++++ client/informers/externalversions/factory.go | 249 ++++++++++++++++++ client/informers/externalversions/generic.go | 60 +++++ .../externalversions/instancemgr/interface.go | 44 ++++ .../instancemgr/v1alpha1/instancegroup.go | 88 +++++++ .../instancemgr/v1alpha1/interface.go | 43 +++ .../internalinterfaces/factory_interfaces.go | 38 +++ .../v1alpha1/expansion_generated.go | 25 ++ .../instancemgr/v1alpha1/instancegroup.go | 97 +++++++ ...stancemgr.keikoproj.io_instancegroups.yaml | 37 +-- controllers/instancegroup_controller.go | 2 +- controllers/interface.go | 2 +- controllers/providers/kubernetes/crd.go | 2 +- controllers/providers/kubernetes/events.go | 2 +- controllers/providers/kubernetes/utils.go | 2 +- controllers/provisioners/config.go | 2 +- controllers/provisioners/config_test.go | 2 +- controllers/provisioners/eks/cloud.go | 2 +- controllers/provisioners/eks/cloud_test.go | 2 +- controllers/provisioners/eks/create.go | 2 +- controllers/provisioners/eks/create_test.go | 2 +- controllers/provisioners/eks/delete.go | 2 +- controllers/provisioners/eks/delete_test.go | 2 +- controllers/provisioners/eks/eks.go | 2 +- controllers/provisioners/eks/eks_test.go | 2 +- controllers/provisioners/eks/helpers.go | 2 +- controllers/provisioners/eks/helpers_test.go | 2 +- .../provisioners/eks/scaling/interface.go | 2 +- .../provisioners/eks/scaling/launchconfig.go | 2 +- .../eks/scaling/launchconfig_test.go | 2 +- .../eks/scaling/launchtemplate.go | 2 +- .../eks/scaling/launchtemplate_test.go | 2 +- controllers/provisioners/eks/state.go | 2 +- controllers/provisioners/eks/state_test.go | 2 +- controllers/provisioners/eks/update.go | 2 +- controllers/provisioners/eks/update_test.go | 2 +- controllers/provisioners/eks/upgrade.go | 2 +- controllers/provisioners/eks/upgrade_test.go | 2 +- .../provisioners/eksfargate/eksfargate.go | 2 +- .../eksfargate/eksfargate_test.go | 2 +- controllers/provisioners/eksfargate/types.go | 2 +- .../provisioners/eksmanaged/eksmanaged.go | 2 +- .../eksmanaged/eksmanaged_test.go | 2 +- controllers/provisioners/eksmanaged/types.go | 2 +- controllers/provisioners/provisioners.go | 2 +- controllers/reconcilers.go | 2 +- go.mod | 16 +- go.sum | 49 ++-- hack/tools.go | 3 + hack/update-codegen.sh | 32 +++ main.go | 2 +- 67 files changed, 1659 insertions(+), 80 deletions(-) rename api/{ => instancemgr}/v1alpha1/groupversion_info.go (84%) rename api/{ => instancemgr}/v1alpha1/instancegroup_types.go (99%) rename api/{ => instancemgr}/v1alpha1/instancegroup_types_test.go (100%) rename api/{ => instancemgr}/v1alpha1/zz_generated.deepcopy.go (99%) create mode 100644 client/clientset/versioned/clientset.go create mode 100644 client/clientset/versioned/fake/clientset_generated.go create mode 100644 client/clientset/versioned/fake/doc.go create mode 100644 client/clientset/versioned/fake/register.go create mode 100644 client/clientset/versioned/scheme/doc.go create mode 100644 client/clientset/versioned/scheme/register.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/doc.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/fake/doc.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancegroup.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancemgr_client.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/generated_expansion.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/instancegroup.go create mode 100644 client/clientset/versioned/typed/instancemgr/v1alpha1/instancemgr_client.go create mode 100644 client/informers/externalversions/factory.go create mode 100644 client/informers/externalversions/generic.go create mode 100644 client/informers/externalversions/instancemgr/interface.go create mode 100644 client/informers/externalversions/instancemgr/v1alpha1/instancegroup.go create mode 100644 client/informers/externalversions/instancemgr/v1alpha1/interface.go create mode 100644 client/informers/externalversions/internalinterfaces/factory_interfaces.go create mode 100644 client/listers/instancemgr/v1alpha1/expansion_generated.go create mode 100644 client/listers/instancemgr/v1alpha1/instancegroup.go create mode 100644 hack/tools.go create mode 100755 hack/update-codegen.sh diff --git a/api/v1alpha1/groupversion_info.go b/api/instancemgr/v1alpha1/groupversion_info.go similarity index 84% rename from api/v1alpha1/groupversion_info.go rename to api/instancemgr/v1alpha1/groupversion_info.go index 4f0ab7dd..45fb062f 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/instancemgr/v1alpha1/groupversion_info.go @@ -25,7 +25,8 @@ import ( var ( // GroupVersion is group version used to register instance groups - GroupVersion = schema.GroupVersion{Group: "instancemgr.keikoproj.io", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "instancemgr.keikoproj.io", Version: "v1alpha1"} + SchemeGroupVersion = GroupVersion // GroupVersionResource is group version resource used to register instance groups GroupVersionResource = schema.GroupVersionResource{ @@ -40,3 +41,7 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme ) + +func Resource(resource string) schema.GroupResource { + return GroupVersion.WithResource(resource).GroupResource() +} diff --git a/api/v1alpha1/instancegroup_types.go b/api/instancemgr/v1alpha1/instancegroup_types.go similarity index 99% rename from api/v1alpha1/instancegroup_types.go rename to api/instancemgr/v1alpha1/instancegroup_types.go index 2419a000..fdfe5ee3 100644 --- a/api/v1alpha1/instancegroup_types.go +++ b/api/instancemgr/v1alpha1/instancegroup_types.go @@ -138,6 +138,7 @@ var ( // +kubebuilder:printcolumn:name="Strategy",type="string",JSONPath=".status.strategy",description="instance group upgrade strategy" // +kubebuilder:printcolumn:name="Lifecycle",type="string",JSONPath=".status.lifecycle",description="instance group lifecycle spot/normal" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="time passed since instancegroup creation" +// +genclient type InstanceGroup struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` diff --git a/api/v1alpha1/instancegroup_types_test.go b/api/instancemgr/v1alpha1/instancegroup_types_test.go similarity index 100% rename from api/v1alpha1/instancegroup_types_test.go rename to api/instancemgr/v1alpha1/instancegroup_types_test.go diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/instancemgr/v1alpha1/zz_generated.deepcopy.go similarity index 99% rename from api/v1alpha1/zz_generated.deepcopy.go rename to api/instancemgr/v1alpha1/zz_generated.deepcopy.go index 576601b7..77c4f130 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/instancemgr/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* diff --git a/client/clientset/versioned/clientset.go b/client/clientset/versioned/clientset.go new file mode 100644 index 00000000..3db6fb8a --- /dev/null +++ b/client/clientset/versioned/clientset.go @@ -0,0 +1,118 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/client/clientset/versioned/typed/instancemgr/v1alpha1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" +) + +type Interface interface { + Discovery() discovery.DiscoveryInterface + InstancemgrV1alpha1() instancemgrv1alpha1.InstancemgrV1alpha1Interface +} + +// Clientset contains the clients for groups. +type Clientset struct { + *discovery.DiscoveryClient + instancemgrV1alpha1 *instancemgrv1alpha1.InstancemgrV1alpha1Client +} + +// InstancemgrV1alpha1 retrieves the InstancemgrV1alpha1Client +func (c *Clientset) InstancemgrV1alpha1() instancemgrv1alpha1.InstancemgrV1alpha1Interface { + return c.instancemgrV1alpha1 +} + +// Discovery retrieves the DiscoveryClient +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + if c == nil { + return nil + } + return c.DiscoveryClient +} + +// NewForConfig creates a new Clientset for the given config. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfig will generate a rate-limiter in configShallowCopy. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, error) { + configShallowCopy := *c + if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { + if configShallowCopy.Burst <= 0 { + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + } + configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) + } + + var cs Clientset + var err error + cs.instancemgrV1alpha1, err = instancemgrv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + return &cs, nil +} + +// NewForConfigOrDie creates a new Clientset for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *Clientset { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.instancemgrV1alpha1 = instancemgrv1alpha1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/client/clientset/versioned/fake/clientset_generated.go b/client/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..ff601d38 --- /dev/null +++ b/client/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,83 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/keikoproj/instance-manager/client/clientset/versioned" + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/client/clientset/versioned/typed/instancemgr/v1alpha1" + fakeinstancemgrv1alpha1 "github.com/keikoproj/instance-manager/client/clientset/versioned/typed/instancemgr/v1alpha1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// NewSimpleClientset returns a clientset that will respond with the provided objects. +// It's backed by a very simple object tracker that processes creates, updates and deletions as-is, +// without applying any validations and/or defaults. It shouldn't be considered a replacement +// for a real clientset and is mostly useful in simple unit tests. +func NewSimpleClientset(objects ...runtime.Object) *Clientset { + o := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + 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) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// Clientset implements clientset.Interface. Meant to be embedded into a +// struct to get a default implementation. This makes faking out just the method +// you want to test easier. +type Clientset struct { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// InstancemgrV1alpha1 retrieves the InstancemgrV1alpha1Client +func (c *Clientset) InstancemgrV1alpha1() instancemgrv1alpha1.InstancemgrV1alpha1Interface { + return &fakeinstancemgrv1alpha1.FakeInstancemgrV1alpha1{Fake: &c.Fake} +} diff --git a/client/clientset/versioned/fake/doc.go b/client/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..4dfc33d3 --- /dev/null +++ b/client/clientset/versioned/fake/doc.go @@ -0,0 +1,18 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/client/clientset/versioned/fake/register.go b/client/clientset/versioned/fake/register.go new file mode 100644 index 00000000..5f28e5f8 --- /dev/null +++ b/client/clientset/versioned/fake/register.go @@ -0,0 +1,54 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + 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 localSchemeBuilder = runtime.SchemeBuilder{ + instancemgrv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(scheme)) +} diff --git a/client/clientset/versioned/scheme/doc.go b/client/clientset/versioned/scheme/doc.go new file mode 100644 index 00000000..39c658fb --- /dev/null +++ b/client/clientset/versioned/scheme/doc.go @@ -0,0 +1,18 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package contains the scheme of the automatically generated clientset. +package scheme diff --git a/client/clientset/versioned/scheme/register.go b/client/clientset/versioned/scheme/register.go new file mode 100644 index 00000000..17997671 --- /dev/null +++ b/client/clientset/versioned/scheme/register.go @@ -0,0 +1,54 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package scheme + +import ( + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + 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) +var localSchemeBuilder = runtime.SchemeBuilder{ + instancemgrv1alpha1.AddToScheme, +} + +// AddToScheme adds all types of this clientset into the given scheme. This allows composition +// of clientsets, like in: +// +// import ( +// "k8s.io/client-go/kubernetes" +// clientsetscheme "k8s.io/client-go/kubernetes/scheme" +// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme" +// ) +// +// kclientset, _ := kubernetes.NewForConfig(c) +// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme) +// +// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types +// correctly. +var AddToScheme = localSchemeBuilder.AddToScheme + +func init() { + v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"}) + utilruntime.Must(AddToScheme(Scheme)) +} diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/doc.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/doc.go new file mode 100644 index 00000000..b5983ac1 --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/doc.go @@ -0,0 +1,18 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/doc.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/doc.go new file mode 100644 index 00000000..9e82ae57 --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/doc.go @@ -0,0 +1,18 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancegroup.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancegroup.go new file mode 100644 index 00000000..8494af47 --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancegroup.go @@ -0,0 +1,139 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeInstanceGroups implements InstanceGroupInterface +type FakeInstanceGroups struct { + Fake *FakeInstancemgrV1alpha1 + ns string +} + +var instancegroupsResource = v1alpha1.SchemeGroupVersion.WithResource("instancegroups") + +var instancegroupsKind = v1alpha1.SchemeGroupVersion.WithKind("InstanceGroup") + +// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any. +func (c *FakeInstanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(instancegroupsResource, c.ns, name), &v1alpha1.InstanceGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InstanceGroup), err +} + +// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors. +func (c *FakeInstanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(instancegroupsResource, instancegroupsKind, c.ns, opts), &v1alpha1.InstanceGroupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.InstanceGroupList{ListMeta: obj.(*v1alpha1.InstanceGroupList).ListMeta} + for _, item := range obj.(*v1alpha1.InstanceGroupList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested instanceGroups. +func (c *FakeInstanceGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(instancegroupsResource, c.ns, opts)) + +} + +// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any. +func (c *FakeInstanceGroups) Create(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.CreateOptions) (result *v1alpha1.InstanceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InstanceGroup), err +} + +// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any. +func (c *FakeInstanceGroups) Update(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha1.InstanceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(instancegroupsResource, c.ns, instanceGroup), &v1alpha1.InstanceGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InstanceGroup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeInstanceGroups) UpdateStatus(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (*v1alpha1.InstanceGroup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(instancegroupsResource, "status", c.ns, instanceGroup), &v1alpha1.InstanceGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InstanceGroup), err +} + +// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs. +func (c *FakeInstanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(instancegroupsResource, c.ns, name, opts), &v1alpha1.InstanceGroup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInstanceGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(instancegroupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.InstanceGroupList{}) + return err +} + +// Patch applies the patch and returns the patched instanceGroup. +func (c *FakeInstanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InstanceGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(instancegroupsResource, c.ns, name, pt, data, subresources...), &v1alpha1.InstanceGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InstanceGroup), err +} diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancemgr_client.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancemgr_client.go new file mode 100644 index 00000000..d32c5a57 --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/fake/fake_instancemgr_client.go @@ -0,0 +1,38 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/keikoproj/instance-manager/client/clientset/versioned/typed/instancemgr/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeInstancemgrV1alpha1 struct { + *testing.Fake +} + +func (c *FakeInstancemgrV1alpha1) InstanceGroups(namespace string) v1alpha1.InstanceGroupInterface { + return &FakeInstanceGroups{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeInstancemgrV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/generated_expansion.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/generated_expansion.go new file mode 100644 index 00000000..01d83c4b --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/generated_expansion.go @@ -0,0 +1,19 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type InstanceGroupExpansion interface{} diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/instancegroup.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/instancegroup.go new file mode 100644 index 00000000..9289a1b3 --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/instancegroup.go @@ -0,0 +1,193 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + scheme "github.com/keikoproj/instance-manager/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// InstanceGroupsGetter has a method to return a InstanceGroupInterface. +// A group's client should implement this interface. +type InstanceGroupsGetter interface { + InstanceGroups(namespace string) InstanceGroupInterface +} + +// InstanceGroupInterface has methods to work with InstanceGroup resources. +type InstanceGroupInterface interface { + Create(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.CreateOptions) (*v1alpha1.InstanceGroup, error) + Update(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (*v1alpha1.InstanceGroup, error) + UpdateStatus(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (*v1alpha1.InstanceGroup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.InstanceGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.InstanceGroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InstanceGroup, err error) + InstanceGroupExpansion +} + +// instanceGroups implements InstanceGroupInterface +type instanceGroups struct { + client rest.Interface + ns string +} + +// newInstanceGroups returns a InstanceGroups +func newInstanceGroups(c *InstancemgrV1alpha1Client, namespace string) *instanceGroups { + return &instanceGroups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the instanceGroup, and returns the corresponding instanceGroup object, and an error if there is any. +func (c *instanceGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.InstanceGroup, err error) { + result = &v1alpha1.InstanceGroup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("instancegroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of InstanceGroups that match those selectors. +func (c *instanceGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.InstanceGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.InstanceGroupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("instancegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested instanceGroups. +func (c *instanceGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("instancegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a instanceGroup and creates it. Returns the server's representation of the instanceGroup, and an error, if there is any. +func (c *instanceGroups) Create(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.CreateOptions) (result *v1alpha1.InstanceGroup, err error) { + result = &v1alpha1.InstanceGroup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("instancegroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a instanceGroup and updates it. Returns the server's representation of the instanceGroup, and an error, if there is any. +func (c *instanceGroups) Update(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha1.InstanceGroup, err error) { + result = &v1alpha1.InstanceGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("instancegroups"). + Name(instanceGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceGroup). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *instanceGroups) UpdateStatus(ctx context.Context, instanceGroup *v1alpha1.InstanceGroup, opts v1.UpdateOptions) (result *v1alpha1.InstanceGroup, err error) { + result = &v1alpha1.InstanceGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("instancegroups"). + Name(instanceGroup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the instanceGroup and deletes it. Returns an error if one occurs. +func (c *instanceGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("instancegroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *instanceGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("instancegroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched instanceGroup. +func (c *instanceGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.InstanceGroup, err error) { + result = &v1alpha1.InstanceGroup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("instancegroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/client/clientset/versioned/typed/instancemgr/v1alpha1/instancemgr_client.go b/client/clientset/versioned/typed/instancemgr/v1alpha1/instancemgr_client.go new file mode 100644 index 00000000..6cb16a3b --- /dev/null +++ b/client/clientset/versioned/typed/instancemgr/v1alpha1/instancemgr_client.go @@ -0,0 +1,105 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + "github.com/keikoproj/instance-manager/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type InstancemgrV1alpha1Interface interface { + RESTClient() rest.Interface + InstanceGroupsGetter +} + +// InstancemgrV1alpha1Client is used to interact with features provided by the instancemgr group. +type InstancemgrV1alpha1Client struct { + restClient rest.Interface +} + +func (c *InstancemgrV1alpha1Client) InstanceGroups(namespace string) InstanceGroupInterface { + return newInstanceGroups(c, namespace) +} + +// NewForConfig creates a new InstancemgrV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*InstancemgrV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new InstancemgrV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*InstancemgrV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &InstancemgrV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new InstancemgrV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *InstancemgrV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new InstancemgrV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *InstancemgrV1alpha1Client { + return &InstancemgrV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *InstancemgrV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/client/informers/externalversions/factory.go b/client/informers/externalversions/factory.go new file mode 100644 index 00000000..ee83bfa3 --- /dev/null +++ b/client/informers/externalversions/factory.go @@ -0,0 +1,249 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + reflect "reflect" + sync "sync" + time "time" + + versioned "github.com/keikoproj/instance-manager/client/clientset/versioned" + instancemgr "github.com/keikoproj/instance-manager/client/informers/externalversions/instancemgr" + internalinterfaces "github.com/keikoproj/instance-manager/client/informers/externalversions/internalinterfaces" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" + 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. + // This allows Start() to be called multiple times safely. + startedInformers map[reflect.Type]bool + // wg tracks how many goroutines were started. + wg sync.WaitGroup + // shuttingDown is true when Shutdown has been called. It may still be running + // because it needs to wait for goroutines. + shuttingDown bool +} + +// 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 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 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: 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 +} + +func (f *sharedInformerFactory) Start(stopCh <-chan struct{}) { + f.lock.Lock() + defer f.lock.Unlock() + + if f.shuttingDown { + return + } + + for informerType, informer := range f.informers { + if !f.startedInformers[informerType] { + f.wg.Add(1) + // We need a new variable in each loop iteration, + // otherwise the goroutine would use the loop variable + // and that keeps changing. + informer := informer + go func() { + defer f.wg.Done() + informer.Run(stopCh) + }() + f.startedInformers[informerType] = true + } + } +} + +func (f *sharedInformerFactory) Shutdown() { + f.lock.Lock() + f.shuttingDown = true + f.lock.Unlock() + + // Will return immediately if there is nothing to wait for. + f.wg.Wait() +} + +func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool { + informers := func() map[reflect.Type]cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informers := map[reflect.Type]cache.SharedIndexInformer{} + for informerType, informer := range f.informers { + if f.startedInformers[informerType] { + informers[informerType] = informer + } + } + return informers + }() + + res := map[reflect.Type]bool{} + for informType, informer := range informers { + res[informType] = cache.WaitForCacheSync(stopCh, informer.HasSynced) + } + return res +} + +// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// client. +func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { + f.lock.Lock() + defer f.lock.Unlock() + + informerType := reflect.TypeOf(obj) + informer, exists := f.informers[informerType] + if exists { + return informer + } + + resyncPeriod, exists := f.customResync[informerType] + if !exists { + resyncPeriod = f.defaultResync + } + + informer = newFunc(f.client, resyncPeriod) + f.informers[informerType] = informer + + return informer +} + +// SharedInformerFactory provides shared informers for resources in all known +// API group versions. +// +// It is typically used like this: +// +// ctx, cancel := context.Background() +// defer cancel() +// factory := NewSharedInformerFactory(client, resyncPeriod) +// defer factory.WaitForStop() // Returns immediately if nothing was started. +// genericInformer := factory.ForResource(resource) +// typedInformer := factory.SomeAPIGroup().V1().SomeType() +// factory.Start(ctx.Done()) // Start processing these informers. +// synced := factory.WaitForCacheSync(ctx.Done()) +// for v, ok := range synced { +// if !ok { +// fmt.Fprintf(os.Stderr, "caches failed to sync: %v", v) +// return +// } +// } +// +// // Creating informers can also be created after Start, but then +// // Start must be called again: +// anotherGenericInformer := factory.ForResource(resource) +// factory.Start(ctx.Done()) +type SharedInformerFactory interface { + internalinterfaces.SharedInformerFactory + + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + + // Shutdown marks a factory as shutting down. At that point no new + // informers can be started anymore and Start will return without + // doing anything. + // + // In addition, Shutdown blocks until all goroutines have terminated. For that + // to happen, the close channel(s) that they were started with must be closed, + // either before Shutdown gets called or while it is waiting. + // + // Shutdown may be called multiple times, even concurrently. All such calls will + // block until all goroutines have terminated. + Shutdown() + + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + + // ForResource gives generic access to a shared informer of the matching type. + ForResource(resource schema.GroupVersionResource) (GenericInformer, error) + + // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // client. + InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + + Instancemgr() instancemgr.Interface +} + +func (f *sharedInformerFactory) Instancemgr() instancemgr.Interface { + return instancemgr.New(f, f.namespace, f.tweakListOptions) +} diff --git a/client/informers/externalversions/generic.go b/client/informers/externalversions/generic.go new file mode 100644 index 00000000..e739ec01 --- /dev/null +++ b/client/informers/externalversions/generic.go @@ -0,0 +1,60 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package externalversions + +import ( + "fmt" + + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + cache "k8s.io/client-go/tools/cache" +) + +// GenericInformer is type of SharedIndexInformer which will locate and delegate to other +// sharedInformers based on type +type GenericInformer interface { + Informer() cache.SharedIndexInformer + Lister() cache.GenericLister +} + +type genericInformer struct { + informer cache.SharedIndexInformer + resource schema.GroupResource +} + +// Informer returns the SharedIndexInformer. +func (f *genericInformer) Informer() cache.SharedIndexInformer { + return f.informer +} + +// Lister returns the GenericLister. +func (f *genericInformer) Lister() cache.GenericLister { + return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource) +} + +// ForResource gives generic access to a shared informer of the matching type +// TODO extend this to unknown resources with a client pool +func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { + switch resource { + // Group=instancemgr, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("instancegroups"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Instancemgr().V1alpha1().InstanceGroups().Informer()}, nil + + } + + return nil, fmt.Errorf("no informer found for %v", resource) +} diff --git a/client/informers/externalversions/instancemgr/interface.go b/client/informers/externalversions/instancemgr/interface.go new file mode 100644 index 00000000..1a7a6056 --- /dev/null +++ b/client/informers/externalversions/instancemgr/interface.go @@ -0,0 +1,44 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package instancemgr + +import ( + v1alpha1 "github.com/keikoproj/instance-manager/client/informers/externalversions/instancemgr/v1alpha1" + internalinterfaces "github.com/keikoproj/instance-manager/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) +} diff --git a/client/informers/externalversions/instancemgr/v1alpha1/instancegroup.go b/client/informers/externalversions/instancemgr/v1alpha1/instancegroup.go new file mode 100644 index 00000000..148cfeba --- /dev/null +++ b/client/informers/externalversions/instancemgr/v1alpha1/instancegroup.go @@ -0,0 +1,88 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + versioned "github.com/keikoproj/instance-manager/client/clientset/versioned" + internalinterfaces "github.com/keikoproj/instance-manager/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/keikoproj/instance-manager/client/listers/instancemgr/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// InstanceGroupInformer provides access to a shared informer and lister for +// InstanceGroups. +type InstanceGroupInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.InstanceGroupLister +} + +type instanceGroupInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewInstanceGroupInformer constructs a new informer for InstanceGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewInstanceGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredInstanceGroupInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredInstanceGroupInformer constructs a new informer for InstanceGroup type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredInstanceGroupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InstancemgrV1alpha1().InstanceGroups(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.InstancemgrV1alpha1().InstanceGroups(namespace).Watch(context.TODO(), options) + }, + }, + &instancemgrv1alpha1.InstanceGroup{}, + resyncPeriod, + indexers, + ) +} + +func (f *instanceGroupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredInstanceGroupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *instanceGroupInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&instancemgrv1alpha1.InstanceGroup{}, f.defaultInformer) +} + +func (f *instanceGroupInformer) Lister() v1alpha1.InstanceGroupLister { + return v1alpha1.NewInstanceGroupLister(f.Informer().GetIndexer()) +} diff --git a/client/informers/externalversions/instancemgr/v1alpha1/interface.go b/client/informers/externalversions/instancemgr/v1alpha1/interface.go new file mode 100644 index 00000000..bc31c0fc --- /dev/null +++ b/client/informers/externalversions/instancemgr/v1alpha1/interface.go @@ -0,0 +1,43 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + internalinterfaces "github.com/keikoproj/instance-manager/client/informers/externalversions/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // InstanceGroups returns a InstanceGroupInformer. + InstanceGroups() InstanceGroupInformer +} + +type version struct { + factory internalinterfaces.SharedInformerFactory + namespace string + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { + return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} +} + +// InstanceGroups returns a InstanceGroupInformer. +func (v *version) InstanceGroups() InstanceGroupInformer { + return &instanceGroupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/client/informers/externalversions/internalinterfaces/factory_interfaces.go new file mode 100644 index 00000000..59b087bd --- /dev/null +++ b/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -0,0 +1,38 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by informer-gen. DO NOT EDIT. + +package internalinterfaces + +import ( + time "time" + + versioned "github.com/keikoproj/instance-manager/client/clientset/versioned" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + cache "k8s.io/client-go/tools/cache" +) + +// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. +type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer + +// SharedInformerFactory a small interface to allow for adding an informer without an import cycle +type SharedInformerFactory interface { + Start(stopCh <-chan struct{}) + InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer +} + +// TweakListOptionsFunc is a function that transforms a v1.ListOptions. +type TweakListOptionsFunc func(*v1.ListOptions) diff --git a/client/listers/instancemgr/v1alpha1/expansion_generated.go b/client/listers/instancemgr/v1alpha1/expansion_generated.go new file mode 100644 index 00000000..fa1f1a7c --- /dev/null +++ b/client/listers/instancemgr/v1alpha1/expansion_generated.go @@ -0,0 +1,25 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +// InstanceGroupListerExpansion allows custom methods to be added to +// InstanceGroupLister. +type InstanceGroupListerExpansion interface{} + +// InstanceGroupNamespaceListerExpansion allows custom methods to be added to +// InstanceGroupNamespaceLister. +type InstanceGroupNamespaceListerExpansion interface{} diff --git a/client/listers/instancemgr/v1alpha1/instancegroup.go b/client/listers/instancemgr/v1alpha1/instancegroup.go new file mode 100644 index 00000000..940e45a2 --- /dev/null +++ b/client/listers/instancemgr/v1alpha1/instancegroup.go @@ -0,0 +1,97 @@ +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// InstanceGroupLister helps list InstanceGroups. +// All objects returned here must be treated as read-only. +type InstanceGroupLister interface { + // List lists all InstanceGroups in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.InstanceGroup, err error) + // InstanceGroups returns an object that can list and get InstanceGroups. + InstanceGroups(namespace string) InstanceGroupNamespaceLister + InstanceGroupListerExpansion +} + +// instanceGroupLister implements the InstanceGroupLister interface. +type instanceGroupLister struct { + indexer cache.Indexer +} + +// NewInstanceGroupLister returns a new InstanceGroupLister. +func NewInstanceGroupLister(indexer cache.Indexer) InstanceGroupLister { + return &instanceGroupLister{indexer: indexer} +} + +// List lists all InstanceGroups in the indexer. +func (s *instanceGroupLister) List(selector labels.Selector) (ret []*v1alpha1.InstanceGroup, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.InstanceGroup)) + }) + return ret, err +} + +// InstanceGroups returns an object that can list and get InstanceGroups. +func (s *instanceGroupLister) InstanceGroups(namespace string) InstanceGroupNamespaceLister { + return instanceGroupNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// InstanceGroupNamespaceLister helps list and get InstanceGroups. +// All objects returned here must be treated as read-only. +type InstanceGroupNamespaceLister interface { + // List lists all InstanceGroups in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1alpha1.InstanceGroup, err error) + // Get retrieves the InstanceGroup from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1alpha1.InstanceGroup, error) + InstanceGroupNamespaceListerExpansion +} + +// instanceGroupNamespaceLister implements the InstanceGroupNamespaceLister +// interface. +type instanceGroupNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all InstanceGroups in the indexer for a given namespace. +func (s instanceGroupNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.InstanceGroup, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.InstanceGroup)) + }) + return ret, err +} + +// Get retrieves the InstanceGroup from the indexer for a given namespace and name. +func (s instanceGroupNamespaceLister) Get(name string) (*v1alpha1.InstanceGroup, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("instancegroup"), name) + } + return obj.(*v1alpha1.InstanceGroup), nil +} diff --git a/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml b/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml index be055775..490ba7cb 100644 --- a/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml +++ b/config/crd/bases/instancemgr.keikoproj.io_instancegroups.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.12.1 + controller-gen.kubebuilder.io/version: v0.14.0 name: instancegroups.instancemgr.keikoproj.io spec: group: instancemgr.keikoproj.io @@ -55,14 +55,19 @@ spec: description: InstanceGroup is the Schema for the instancegroups API properties: apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object @@ -205,22 +210,24 @@ spec: type: array taints: items: - description: The node this Taint is attached to has the - "effect" on any pod that does not tolerate the Taint. + description: |- + The node this Taint is attached to has the "effect" on + any pod that does not tolerate the Taint. properties: effect: - description: Required. The effect of the taint on pods - that do not tolerate the taint. Valid effects are - NoSchedule, PreferNoSchedule and NoExecute. + description: |- + Required. The effect of the taint on pods + that do not tolerate the taint. + Valid effects are NoSchedule, PreferNoSchedule and NoExecute. type: string key: description: Required. The taint key to be applied to a node. type: string timeAdded: - description: TimeAdded represents the time at which - the taint was added. It is only written for NoExecute - taints. + description: |- + TimeAdded represents the time at which the taint was added. + It is only written for NoExecute taints. format: date-time type: string value: diff --git a/controllers/instancegroup_controller.go b/controllers/instancegroup_controller.go index 47412ce3..5da59d5a 100644 --- a/controllers/instancegroup_controller.go +++ b/controllers/instancegroup_controller.go @@ -23,7 +23,7 @@ import ( "time" "github.com/go-logr/logr" - v1alpha1 "github.com/keikoproj/instance-manager/api/v1alpha1" + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/interface.go b/controllers/interface.go index c0159ef5..4d313a34 100644 --- a/controllers/interface.go +++ b/controllers/interface.go @@ -1,7 +1,7 @@ package controllers import ( - v1alpha "github.com/keikoproj/instance-manager/api/v1alpha1" + v1alpha "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" ) // CloudDeployer is a common interface that should be fulfilled by each provisioner diff --git a/controllers/providers/kubernetes/crd.go b/controllers/providers/kubernetes/crd.go index 60361849..9a1579e7 100644 --- a/controllers/providers/kubernetes/crd.go +++ b/controllers/providers/kubernetes/crd.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" "github.com/pkg/errors" kerr "k8s.io/apimachinery/pkg/api/errors" diff --git a/controllers/providers/kubernetes/events.go b/controllers/providers/kubernetes/events.go index 0ff757f9..bf045bc5 100644 --- a/controllers/providers/kubernetes/events.go +++ b/controllers/providers/kubernetes/events.go @@ -22,7 +22,7 @@ import ( "math/rand" "time" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "k8s.io/apimachinery/pkg/types" v1 "k8s.io/api/core/v1" diff --git a/controllers/providers/kubernetes/utils.go b/controllers/providers/kubernetes/utils.go index 13bb31d1..a18aec28 100644 --- a/controllers/providers/kubernetes/utils.go +++ b/controllers/providers/kubernetes/utils.go @@ -25,7 +25,7 @@ import ( jsonpatch "github.com/evanphx/json-patch" "github.com/ghodss/yaml" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/provisioners/config.go b/controllers/provisioners/config.go index 7e46294c..77850e29 100644 --- a/controllers/provisioners/config.go +++ b/controllers/provisioners/config.go @@ -22,7 +22,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "github.com/ghodss/yaml" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" diff --git a/controllers/provisioners/config_test.go b/controllers/provisioners/config_test.go index 3cc74e8f..e996ea34 100644 --- a/controllers/provisioners/config_test.go +++ b/controllers/provisioners/config_test.go @@ -19,7 +19,7 @@ import ( "testing" "github.com/ghodss/yaml" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/provisioners/eks/cloud.go b/controllers/provisioners/eks/cloud.go index 1ee2230f..511b5356 100644 --- a/controllers/provisioners/eks/cloud.go +++ b/controllers/provisioners/eks/cloud.go @@ -19,7 +19,7 @@ import ( "context" "strings" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/cloud_test.go b/controllers/provisioners/eks/cloud_test.go index 80218db2..692b7a95 100644 --- a/controllers/provisioners/eks/cloud_test.go +++ b/controllers/provisioners/eks/cloud_test.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/iam" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/provisioners" "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/controllers/provisioners/eks/create.go b/controllers/provisioners/eks/create.go index e8392151..dba0bb21 100644 --- a/controllers/provisioners/eks/create.go +++ b/controllers/provisioners/eks/create.go @@ -20,7 +20,7 @@ import ( "github.com/keikoproj/instance-manager/controllers/provisioners/eks/scaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/pkg/errors" diff --git a/controllers/provisioners/eks/create_test.go b/controllers/provisioners/eks/create_test.go index 56a680e3..46460d66 100644 --- a/controllers/provisioners/eks/create_test.go +++ b/controllers/provisioners/eks/create_test.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/iam" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/onsi/gomega" "github.com/pkg/errors" ) diff --git a/controllers/provisioners/eks/delete.go b/controllers/provisioners/eks/delete.go index b4cd9460..49b6abbd 100644 --- a/controllers/provisioners/eks/delete.go +++ b/controllers/provisioners/eks/delete.go @@ -18,7 +18,7 @@ package eks import ( "github.com/keikoproj/instance-manager/controllers/provisioners/eks/scaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/pkg/errors" diff --git a/controllers/provisioners/eks/delete_test.go b/controllers/provisioners/eks/delete_test.go index c591680d..c5a95811 100644 --- a/controllers/provisioners/eks/delete_test.go +++ b/controllers/provisioners/eks/delete_test.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/iam" awsauth "github.com/keikoproj/aws-auth/pkg/mapper" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/keikoproj/instance-manager/controllers/provisioners/eks/scaling" "github.com/onsi/gomega" diff --git a/controllers/provisioners/eks/eks.go b/controllers/provisioners/eks/eks.go index 0bfe7521..1dbb2ba7 100644 --- a/controllers/provisioners/eks/eks.go +++ b/controllers/provisioners/eks/eks.go @@ -23,7 +23,7 @@ import ( "github.com/go-logr/logr" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/eks_test.go b/controllers/provisioners/eks/eks_test.go index acba0f85..8cb668c9 100644 --- a/controllers/provisioners/eks/eks_test.go +++ b/controllers/provisioners/eks/eks_test.go @@ -31,7 +31,7 @@ import ( "github.com/aws/aws-sdk-go/service/iam/iamiface" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/helpers.go b/controllers/provisioners/eks/helpers.go index f00ace9e..1785b409 100644 --- a/controllers/provisioners/eks/helpers.go +++ b/controllers/provisioners/eks/helpers.go @@ -30,7 +30,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/helpers_test.go b/controllers/provisioners/eks/helpers_test.go index e76f3856..ba4c88aa 100644 --- a/controllers/provisioners/eks/helpers_test.go +++ b/controllers/provisioners/eks/helpers_test.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/onsi/gomega" diff --git a/controllers/provisioners/eks/scaling/interface.go b/controllers/provisioners/eks/scaling/interface.go index 7beb32cc..fe0e93e4 100644 --- a/controllers/provisioners/eks/scaling/interface.go +++ b/controllers/provisioners/eks/scaling/interface.go @@ -18,7 +18,7 @@ package scaling import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/controllers/provisioners/eks/scaling/launchconfig.go b/controllers/provisioners/eks/scaling/launchconfig.go index 7b4df504..9db2aaf6 100644 --- a/controllers/provisioners/eks/scaling/launchconfig.go +++ b/controllers/provisioners/eks/scaling/launchconfig.go @@ -20,7 +20,7 @@ import ( "sort" "strings" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" "github.com/aws/aws-sdk-go/aws" diff --git a/controllers/provisioners/eks/scaling/launchconfig_test.go b/controllers/provisioners/eks/scaling/launchconfig_test.go index da7b7793..8a782da2 100644 --- a/controllers/provisioners/eks/scaling/launchconfig_test.go +++ b/controllers/provisioners/eks/scaling/launchconfig_test.go @@ -25,7 +25,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/onsi/gomega" diff --git a/controllers/provisioners/eks/scaling/launchtemplate.go b/controllers/provisioners/eks/scaling/launchtemplate.go index ac52a66d..a78b8bef 100644 --- a/controllers/provisioners/eks/scaling/launchtemplate.go +++ b/controllers/provisioners/eks/scaling/launchtemplate.go @@ -21,7 +21,7 @@ import ( "strconv" "strings" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" diff --git a/controllers/provisioners/eks/scaling/launchtemplate_test.go b/controllers/provisioners/eks/scaling/launchtemplate_test.go index ce0a894d..4de72f0c 100644 --- a/controllers/provisioners/eks/scaling/launchtemplate_test.go +++ b/controllers/provisioners/eks/scaling/launchtemplate_test.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/onsi/gomega" diff --git a/controllers/provisioners/eks/state.go b/controllers/provisioners/eks/state.go index 392859dc..8e724891 100644 --- a/controllers/provisioners/eks/state.go +++ b/controllers/provisioners/eks/state.go @@ -17,7 +17,7 @@ package eks import ( "github.com/aws/aws-sdk-go/aws" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" ) const ( diff --git a/controllers/provisioners/eks/state_test.go b/controllers/provisioners/eks/state_test.go index 7d6f86da..63a646bb 100644 --- a/controllers/provisioners/eks/state_test.go +++ b/controllers/provisioners/eks/state_test.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/onsi/gomega" ) diff --git a/controllers/provisioners/eks/update.go b/controllers/provisioners/eks/update.go index 34b854fc..a00b03b1 100644 --- a/controllers/provisioners/eks/update.go +++ b/controllers/provisioners/eks/update.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/update_test.go b/controllers/provisioners/eks/update_test.go index c930cb75..63066f8b 100644 --- a/controllers/provisioners/eks/update_test.go +++ b/controllers/provisioners/eks/update_test.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/iam" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/onsi/gomega" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" diff --git a/controllers/provisioners/eks/upgrade.go b/controllers/provisioners/eks/upgrade.go index 8d4b944d..001de691 100644 --- a/controllers/provisioners/eks/upgrade.go +++ b/controllers/provisioners/eks/upgrade.go @@ -20,7 +20,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/common" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" diff --git a/controllers/provisioners/eks/upgrade_test.go b/controllers/provisioners/eks/upgrade_test.go index c5f2d213..f73fea1b 100644 --- a/controllers/provisioners/eks/upgrade_test.go +++ b/controllers/provisioners/eks/upgrade_test.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/ghodss/yaml" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/keikoproj/instance-manager/controllers/provisioners/eks/scaling" "github.com/onsi/gomega" diff --git a/controllers/provisioners/eksfargate/eksfargate.go b/controllers/provisioners/eksfargate/eksfargate.go index cad8d5a6..096fc6e2 100644 --- a/controllers/provisioners/eksfargate/eksfargate.go +++ b/controllers/provisioners/eksfargate/eksfargate.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/iam" - v1alpha1 "github.com/keikoproj/instance-manager/api/v1alpha1" + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/keikoproj/instance-manager/controllers/provisioners" "github.com/pkg/errors" diff --git a/controllers/provisioners/eksfargate/eksfargate_test.go b/controllers/provisioners/eksfargate/eksfargate_test.go index 573eab0b..6a8e46f2 100644 --- a/controllers/provisioners/eksfargate/eksfargate_test.go +++ b/controllers/provisioners/eksfargate/eksfargate_test.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/service/eks/eksiface" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/iam/iamiface" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/keikoproj/instance-manager/controllers/provisioners" "github.com/pkg/errors" diff --git a/controllers/provisioners/eksfargate/types.go b/controllers/provisioners/eksfargate/types.go index 3ce95c40..e2c2c4ce 100644 --- a/controllers/provisioners/eksfargate/types.go +++ b/controllers/provisioners/eksfargate/types.go @@ -18,7 +18,7 @@ package eksfargate import ( "github.com/aws/aws-sdk-go/aws" "github.com/go-logr/logr" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" ) diff --git a/controllers/provisioners/eksmanaged/eksmanaged.go b/controllers/provisioners/eksmanaged/eksmanaged.go index fcf7af4b..0fe4778d 100644 --- a/controllers/provisioners/eksmanaged/eksmanaged.go +++ b/controllers/provisioners/eksmanaged/eksmanaged.go @@ -20,7 +20,7 @@ import ( "strings" "github.com/aws/aws-sdk-go/aws" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" "github.com/keikoproj/instance-manager/controllers/provisioners" ) diff --git a/controllers/provisioners/eksmanaged/eksmanaged_test.go b/controllers/provisioners/eksmanaged/eksmanaged_test.go index d8367ac3..093f1e4b 100644 --- a/controllers/provisioners/eksmanaged/eksmanaged_test.go +++ b/controllers/provisioners/eksmanaged/eksmanaged_test.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/keikoproj/instance-manager/controllers/provisioners" diff --git a/controllers/provisioners/eksmanaged/types.go b/controllers/provisioners/eksmanaged/types.go index 8abcabd8..b7213cf6 100644 --- a/controllers/provisioners/eksmanaged/types.go +++ b/controllers/provisioners/eksmanaged/types.go @@ -18,7 +18,7 @@ package eksmanaged import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/go-logr/logr" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" ) diff --git a/controllers/provisioners/provisioners.go b/controllers/provisioners/provisioners.go index 85beffff..e0997496 100644 --- a/controllers/provisioners/provisioners.go +++ b/controllers/provisioners/provisioners.go @@ -2,7 +2,7 @@ package provisioners import ( "github.com/go-logr/logr" - "github.com/keikoproj/instance-manager/api/v1alpha1" + "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" corev1 "k8s.io/api/core/v1" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/reconcilers.go b/controllers/reconcilers.go index e149d854..3411aeb7 100644 --- a/controllers/reconcilers.go +++ b/controllers/reconcilers.go @@ -23,7 +23,7 @@ import ( "strings" "time" - v1alpha1 "github.com/keikoproj/instance-manager/api/v1alpha1" + v1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" awsprovider "github.com/keikoproj/instance-manager/controllers/providers/aws" kubeprovider "github.com/keikoproj/instance-manager/controllers/providers/kubernetes" "github.com/keikoproj/instance-manager/controllers/provisioners" diff --git a/go.mod b/go.mod index bf1f9086..ffc33637 100644 --- a/go.mod +++ b/go.mod @@ -19,6 +19,7 @@ require ( k8s.io/api v0.26.15 k8s.io/apimachinery v0.26.15 k8s.io/client-go v0.26.15 + k8s.io/code-generator v0.27.2 sigs.k8s.io/controller-runtime v0.14.7 ) @@ -30,9 +31,9 @@ require ( github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-logr/zapr v1.2.3 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/swag v0.19.14 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect @@ -59,11 +60,13 @@ require ( go.uber.org/atomic v1.7.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.24.0 // indirect + golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.20.0 // indirect gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect @@ -72,10 +75,11 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.26.10 // indirect k8s.io/component-base v0.26.10 // indirect - k8s.io/klog/v2 v2.80.1 // indirect - k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect + k8s.io/gengo v0.0.0-20220902162205-c0856e24416d // indirect + k8s.io/klog/v2 v2.90.1 // indirect + k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect - sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index b05e026c..27eaa305 100644 --- a/go.sum +++ b/go.sum @@ -32,20 +32,19 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= -github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= +github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -110,15 +109,13 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -128,7 +125,6 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= @@ -155,11 +151,14 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlVjOeLOBz+CPAI8dnbqNSVwUwRrkp7vQ= @@ -186,6 +185,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -205,6 +206,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -229,6 +232,7 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= @@ -265,7 +269,6 @@ google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHh gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -290,19 +293,25 @@ k8s.io/apimachinery v0.26.15 h1:GPxeERYBSqSZlj3xIkX4L6mBjzZ9q8JPnJ+Vj15qe+g= k8s.io/apimachinery v0.26.15/go.mod h1:O/uIhIOWuy6ndHqQ6qbkjD7OgeMhVtlk8+Z66ZcmJQc= k8s.io/client-go v0.26.15 h1:A2Yav2v+VZQfpEsf5ESFp2Lqq5XACKBDrwkG+jEtOg0= k8s.io/client-go v0.26.15/go.mod h1:KJs7snLEyKPlypqTQG/ngcaqE6h3/6qTvVHDViRL+iI= +k8s.io/code-generator v0.27.2 h1:RmK0CnU5qRaK6WRtSyWNODmfTZNoJbrizpVcsgbtrvI= +k8s.io/code-generator v0.27.2/go.mod h1:DPung1sI5vBgn4AGKtlPRQAyagj/ir/4jI55ipZHVww= k8s.io/component-base v0.26.10 h1:vl3Gfe5aC09mNxfnQtTng7u3rnBVrShOK3MAkqEleb0= k8s.io/component-base v0.26.10/go.mod h1:/IDdENUHG5uGxqcofZajovYXE9KSPzJ4yQbkYQt7oN0= -k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E= -k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d h1:U9tB195lKdzwqicbJvyJeOXV7Klv+wNAWENRnXEGi08= +k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= +k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= +k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y= k8s.io/utils v0.0.0-20221128185143-99ec85e7a448/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/controller-runtime v0.14.7 h1:Vrnm2vk9ZFlRkXATHz0W0wXcqNl7kPat8q2JyxVy0Q8= sigs.k8s.io/controller-runtime v0.14.7/go.mod h1:ErTs3SJCOujNUnTz4AS+uh8hp6DHMo1gj6fFndJT1X8= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k= -sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= +sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/hack/tools.go b/hack/tools.go new file mode 100644 index 00000000..ed8aab6e --- /dev/null +++ b/hack/tools.go @@ -0,0 +1,3 @@ +package tools + +import _ "k8s.io/code-generator" diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh new file mode 100755 index 00000000..ff3b83d2 --- /dev/null +++ b/hack/update-codegen.sh @@ -0,0 +1,32 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +readonly REPO_ROOT="$(git rev-parse --show-toplevel)" + +function make_fake_paths() { + FAKE_GOPATH="$(mktemp -d)" + trap 'rm -rf ${FAKE_GOPATH}' EXIT + FAKE_REPOPATH="${FAKE_GOPATH}/src/github.com/keikoproj/instance-manager" + mkdir -p "$(dirname "${FAKE_REPOPATH}")" && ln -s "${REPO_ROOT}" "${FAKE_REPOPATH}" +} + +make_fake_paths + +export GOPATH="${FAKE_GOPATH}" +export GO111MODULE="off" + +cd "${FAKE_REPOPATH}" + +CODEGEN_PKG=${CODEGEN_PKG:-$(cd "${FAKE_REPOPATH}"; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../code-generator)} + +echo "${FAKE_REPOPATH}" +echo ${CODEGEN_PKG} + +chmod +x ${CODEGEN_PKG}/*.sh + +bash -x ${CODEGEN_PKG}/generate-groups.sh "client,informer,lister" \ + github.com/keikoproj/instance-manager/client github.com/keikoproj/instance-manager/api \ + "instancemgr:v1alpha1" \ + --go-header-file hack/boilerplate.go.txt diff --git a/main.go b/main.go index 40783791..98b6b002 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ import ( "sync" "github.com/keikoproj/aws-sdk-go-cache/cache" - instancemgrv1alpha1 "github.com/keikoproj/instance-manager/api/v1alpha1" + instancemgrv1alpha1 "github.com/keikoproj/instance-manager/api/instancemgr/v1alpha1" "github.com/keikoproj/instance-manager/controllers" "github.com/keikoproj/instance-manager/controllers/common" "github.com/keikoproj/instance-manager/controllers/providers/aws"