Renerate files

Signed-off-by: Andy Goldstein <andy.goldstein@gmail.com>
This commit is contained in:
Andy Goldstein
2017-09-11 15:40:48 -04:00
parent ee38a9471a
commit 5c9ffae88f
25 changed files with 520 additions and 11 deletions
@@ -11,6 +11,7 @@ type ArkV1Interface interface {
RESTClient() rest.Interface
BackupsGetter
ConfigsGetter
DownloadRequestsGetter
RestoresGetter
SchedulesGetter
}
@@ -28,6 +29,10 @@ func (c *ArkV1Client) Configs(namespace string) ConfigInterface {
return newConfigs(c, namespace)
}
func (c *ArkV1Client) DownloadRequests(namespace string) DownloadRequestInterface {
return newDownloadRequests(c, namespace)
}
func (c *ArkV1Client) Restores(namespace string) RestoreInterface {
return newRestores(c, namespace)
}
@@ -0,0 +1,156 @@
package v1
import (
v1 "github.com/heptio/ark/pkg/apis/ark/v1"
scheme "github.com/heptio/ark/pkg/generated/clientset/scheme"
meta_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"
)
// DownloadRequestsGetter has a method to return a DownloadRequestInterface.
// A group's client should implement this interface.
type DownloadRequestsGetter interface {
DownloadRequests(namespace string) DownloadRequestInterface
}
// DownloadRequestInterface has methods to work with DownloadRequest resources.
type DownloadRequestInterface interface {
Create(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Update(*v1.DownloadRequest) (*v1.DownloadRequest, error)
UpdateStatus(*v1.DownloadRequest) (*v1.DownloadRequest, error)
Delete(name string, options *meta_v1.DeleteOptions) error
DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error
Get(name string, options meta_v1.GetOptions) (*v1.DownloadRequest, error)
List(opts meta_v1.ListOptions) (*v1.DownloadRequestList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error)
DownloadRequestExpansion
}
// downloadRequests implements DownloadRequestInterface
type downloadRequests struct {
client rest.Interface
ns string
}
// newDownloadRequests returns a DownloadRequests
func newDownloadRequests(c *ArkV1Client, namespace string) *downloadRequests {
return &downloadRequests{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a downloadRequest and creates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *downloadRequests) Create(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Post().
Namespace(c.ns).
Resource("downloadrequests").
Body(downloadRequest).
Do().
Into(result)
return
}
// Update takes the representation of a downloadRequest and updates it. Returns the server's representation of the downloadRequest, and an error, if there is any.
func (c *downloadRequests) Update(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Put().
Namespace(c.ns).
Resource("downloadrequests").
Name(downloadRequest.Name).
Body(downloadRequest).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus().
func (c *downloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Put().
Namespace(c.ns).
Resource("downloadrequests").
Name(downloadRequest.Name).
SubResource("status").
Body(downloadRequest).
Do().
Into(result)
return
}
// Delete takes name of the downloadRequest and deletes it. Returns an error if one occurs.
func (c *downloadRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *downloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Get takes name of the downloadRequest, and returns the corresponding downloadRequest object, and an error if there is any.
func (c *downloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Get().
Namespace(c.ns).
Resource("downloadrequests").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *downloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) {
result = &v1.DownloadRequestList{}
err = c.client.Get().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested downloadRequests.
func (c *downloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Patch applies the patch and returns the patched downloadRequest.
func (c *downloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error) {
result = &v1.DownloadRequest{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("downloadrequests").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -18,6 +18,10 @@ func (c *FakeArkV1) Configs(namespace string) v1.ConfigInterface {
return &FakeConfigs{c, namespace}
}
func (c *FakeArkV1) DownloadRequests(namespace string) v1.DownloadRequestInterface {
return &FakeDownloadRequests{c, namespace}
}
func (c *FakeArkV1) Restores(namespace string) v1.RestoreInterface {
return &FakeRestores{c, namespace}
}
@@ -0,0 +1,114 @@
package fake
import (
v1 "github.com/heptio/ark/pkg/apis/ark/v1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeDownloadRequests implements DownloadRequestInterface
type FakeDownloadRequests struct {
Fake *FakeArkV1
ns string
}
var downloadrequestsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "downloadrequests"}
var downloadrequestsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "DownloadRequest"}
func (c *FakeDownloadRequests) Create(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(downloadrequestsResource, c.ns, downloadRequest), &v1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1.DownloadRequest), err
}
func (c *FakeDownloadRequests) Update(downloadRequest *v1.DownloadRequest) (result *v1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(downloadrequestsResource, c.ns, downloadRequest), &v1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1.DownloadRequest), err
}
func (c *FakeDownloadRequests) UpdateStatus(downloadRequest *v1.DownloadRequest) (*v1.DownloadRequest, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(downloadrequestsResource, "status", c.ns, downloadRequest), &v1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1.DownloadRequest), err
}
func (c *FakeDownloadRequests) Delete(name string, options *meta_v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(downloadrequestsResource, c.ns, name), &v1.DownloadRequest{})
return err
}
func (c *FakeDownloadRequests) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(downloadrequestsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.DownloadRequestList{})
return err
}
func (c *FakeDownloadRequests) Get(name string, options meta_v1.GetOptions) (result *v1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(downloadrequestsResource, c.ns, name), &v1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1.DownloadRequest), err
}
func (c *FakeDownloadRequests) List(opts meta_v1.ListOptions) (result *v1.DownloadRequestList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(downloadrequestsResource, downloadrequestsKind, c.ns, opts), &v1.DownloadRequestList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.DownloadRequestList{}
for _, item := range obj.(*v1.DownloadRequestList).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 downloadRequests.
func (c *FakeDownloadRequests) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(downloadrequestsResource, c.ns, opts))
}
// Patch applies the patch and returns the patched downloadRequest.
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &v1.DownloadRequest{})
if obj == nil {
return nil, err
}
return obj.(*v1.DownloadRequest), err
}
@@ -4,6 +4,8 @@ type BackupExpansion interface{}
type ConfigExpansion interface{}
type DownloadRequestExpansion interface{}
type RestoreExpansion interface{}
type ScheduleExpansion interface{}
@@ -0,0 +1,52 @@
// This file was automatically generated by informer-gen
package v1
import (
ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
clientset "github.com/heptio/ark/pkg/generated/clientset"
internalinterfaces "github.com/heptio/ark/pkg/generated/informers/externalversions/internalinterfaces"
v1 "github.com/heptio/ark/pkg/generated/listers/ark/v1"
meta_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"
time "time"
)
// DownloadRequestInformer provides access to a shared informer and lister for
// DownloadRequests.
type DownloadRequestInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.DownloadRequestLister
}
type downloadRequestInformer struct {
factory internalinterfaces.SharedInformerFactory
}
func newDownloadRequestInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
sharedIndexInformer := cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
return client.ArkV1().DownloadRequests(meta_v1.NamespaceAll).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
return client.ArkV1().DownloadRequests(meta_v1.NamespaceAll).Watch(options)
},
},
&ark_v1.DownloadRequest{},
resyncPeriod,
cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc},
)
return sharedIndexInformer
}
func (f *downloadRequestInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.DownloadRequest{}, newDownloadRequestInformer)
}
func (f *downloadRequestInformer) Lister() v1.DownloadRequestLister {
return v1.NewDownloadRequestLister(f.Informer().GetIndexer())
}
@@ -12,6 +12,8 @@ type Interface interface {
Backups() BackupInformer
// Configs returns a ConfigInformer.
Configs() ConfigInformer
// DownloadRequests returns a DownloadRequestInformer.
DownloadRequests() DownloadRequestInformer
// Restores returns a RestoreInformer.
Restores() RestoreInformer
// Schedules returns a ScheduleInformer.
@@ -37,6 +39,11 @@ func (v *version) Configs() ConfigInformer {
return &configInformer{factory: v.SharedInformerFactory}
}
// DownloadRequests returns a DownloadRequestInformer.
func (v *version) DownloadRequests() DownloadRequestInformer {
return &downloadRequestInformer{factory: v.SharedInformerFactory}
}
// Restores returns a RestoreInformer.
func (v *version) Restores() RestoreInformer {
return &restoreInformer{factory: v.SharedInformerFactory}
@@ -40,6 +40,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Backups().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("configs"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Configs().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("downloadrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().DownloadRequests().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("restores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Restores().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("schedules"):
@@ -0,0 +1,78 @@
// This file was automatically generated by lister-gen
package v1
import (
v1 "github.com/heptio/ark/pkg/apis/ark/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
)
// DownloadRequestLister helps list DownloadRequests.
type DownloadRequestLister interface {
// List lists all DownloadRequests in the indexer.
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
// DownloadRequests returns an object that can list and get DownloadRequests.
DownloadRequests(namespace string) DownloadRequestNamespaceLister
DownloadRequestListerExpansion
}
// downloadRequestLister implements the DownloadRequestLister interface.
type downloadRequestLister struct {
indexer cache.Indexer
}
// NewDownloadRequestLister returns a new DownloadRequestLister.
func NewDownloadRequestLister(indexer cache.Indexer) DownloadRequestLister {
return &downloadRequestLister{indexer: indexer}
}
// List lists all DownloadRequests in the indexer.
func (s *downloadRequestLister) List(selector labels.Selector) (ret []*v1.DownloadRequest, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.DownloadRequest))
})
return ret, err
}
// DownloadRequests returns an object that can list and get DownloadRequests.
func (s *downloadRequestLister) DownloadRequests(namespace string) DownloadRequestNamespaceLister {
return downloadRequestNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// DownloadRequestNamespaceLister helps list and get DownloadRequests.
type DownloadRequestNamespaceLister interface {
// List lists all DownloadRequests in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1.DownloadRequest, err error)
// Get retrieves the DownloadRequest from the indexer for a given namespace and name.
Get(name string) (*v1.DownloadRequest, error)
DownloadRequestNamespaceListerExpansion
}
// downloadRequestNamespaceLister implements the DownloadRequestNamespaceLister
// interface.
type downloadRequestNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all DownloadRequests in the indexer for a given namespace.
func (s downloadRequestNamespaceLister) List(selector labels.Selector) (ret []*v1.DownloadRequest, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.DownloadRequest))
})
return ret, err
}
// Get retrieves the DownloadRequest from the indexer for a given namespace and name.
func (s downloadRequestNamespaceLister) Get(name string) (*v1.DownloadRequest, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("downloadrequest"), name)
}
return obj.(*v1.DownloadRequest), nil
}
@@ -18,6 +18,14 @@ type ConfigListerExpansion interface{}
// ConfigNamespaceLister.
type ConfigNamespaceListerExpansion interface{}
// DownloadRequestListerExpansion allows custom methods to be added to
// DownloadRequestLister.
type DownloadRequestListerExpansion interface{}
// DownloadRequestNamespaceListerExpansion allows custom methods to be added to
// DownloadRequestNamespaceLister.
type DownloadRequestNamespaceListerExpansion interface{}
// RestoreListerExpansion allows custom methods to be added to
// RestoreLister.
type RestoreListerExpansion interface{}