From 5c9ffae88f86347eee9ec5efa6a6e16656c8191a Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Wed, 23 Aug 2017 13:28:40 -0400 Subject: [PATCH] Renerate files Signed-off-by: Andy Goldstein --- docs/cli-reference/ark.md | 1 + docs/cli-reference/ark_backup.md | 7 + docs/cli-reference/ark_backup_create.md | 3 +- docs/cli-reference/ark_backup_get.md | 3 +- docs/cli-reference/ark_backup_logs.md | 36 ++++ docs/cli-reference/ark_restore.md | 6 + docs/cli-reference/ark_restore_create.md | 3 +- docs/cli-reference/ark_restore_delete.md | 8 +- docs/cli-reference/ark_restore_get.md | 3 +- docs/cli-reference/ark_schedule.md | 6 + docs/cli-reference/ark_schedule_create.md | 3 +- docs/cli-reference/ark_schedule_delete.md | 8 +- docs/cli-reference/ark_schedule_get.md | 3 +- docs/cli-reference/ark_server.md | 5 +- docs/cli-reference/ark_version.md | 8 +- .../clientset/typed/ark/v1/ark_client.go | 5 + .../clientset/typed/ark/v1/downloadrequest.go | 156 ++++++++++++++++++ .../typed/ark/v1/fake/fake_ark_client.go | 4 + .../typed/ark/v1/fake/fake_downloadrequest.go | 114 +++++++++++++ .../typed/ark/v1/generated_expansion.go | 2 + .../ark/v1/downloadrequest.go | 52 ++++++ .../externalversions/ark/v1/interface.go | 7 + .../informers/externalversions/generic.go | 2 + .../listers/ark/v1/downloadrequest.go | 78 +++++++++ .../listers/ark/v1/expansion_generated.go | 8 + 25 files changed, 520 insertions(+), 11 deletions(-) create mode 100644 docs/cli-reference/ark_backup_logs.md create mode 100644 pkg/generated/clientset/typed/ark/v1/downloadrequest.go create mode 100644 pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go create mode 100644 pkg/generated/informers/externalversions/ark/v1/downloadrequest.go create mode 100644 pkg/generated/listers/ark/v1/downloadrequest.go diff --git a/docs/cli-reference/ark.md b/docs/cli-reference/ark.md index d548d5af6..5f5f12185 100644 --- a/docs/cli-reference/ark.md +++ b/docs/cli-reference/ark.md @@ -14,6 +14,7 @@ associated data. ``` --alsologtostderr log to standard error as well as files + -h, --help help for ark --kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory diff --git a/docs/cli-reference/ark_backup.md b/docs/cli-reference/ark_backup.md index 6191610bb..aabdc0a06 100644 --- a/docs/cli-reference/ark_backup.md +++ b/docs/cli-reference/ark_backup.md @@ -7,6 +7,12 @@ Work with backups Work with backups +### Options + +``` + -h, --help help for backup +``` + ### Options inherited from parent commands ``` @@ -24,4 +30,5 @@ Work with backups * [ark](ark.md) - Back up and restore Kubernetes cluster resources. * [ark backup create](ark_backup_create.md) - Create a backup * [ark backup get](ark_backup_get.md) - Get backups +* [ark backup logs](ark_backup_logs.md) - Get backup logs diff --git a/docs/cli-reference/ark_backup_create.md b/docs/cli-reference/ark_backup_create.md index 25f177361..0b317b229 100644 --- a/docs/cli-reference/ark_backup_create.md +++ b/docs/cli-reference/ark_backup_create.md @@ -8,7 +8,7 @@ Create a backup Create a backup ``` -ark backup create NAME +ark backup create NAME [flags] ``` ### Options @@ -16,6 +16,7 @@ ark backup create NAME ``` --exclude-namespaces stringArray namespaces to exclude from the backup --exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io + -h, --help help for create --include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *) --include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources) --label-columns stringArray a comma-separated list of labels to be displayed as columns diff --git a/docs/cli-reference/ark_backup_get.md b/docs/cli-reference/ark_backup_get.md index d1ef6e53a..fd90b56a0 100644 --- a/docs/cli-reference/ark_backup_get.md +++ b/docs/cli-reference/ark_backup_get.md @@ -8,12 +8,13 @@ Get backups Get backups ``` -ark backup get +ark backup get [flags] ``` ### Options ``` + -h, --help help for get --label-columns stringArray a comma-separated list of labels to be displayed as columns -o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table") -l, --selector string only show items matching this label selector diff --git a/docs/cli-reference/ark_backup_logs.md b/docs/cli-reference/ark_backup_logs.md new file mode 100644 index 000000000..e08515298 --- /dev/null +++ b/docs/cli-reference/ark_backup_logs.md @@ -0,0 +1,36 @@ +## ark backup logs + +Get backup logs + +### Synopsis + + +Get backup logs + +``` +ark backup logs BACKUP [flags] +``` + +### Options + +``` + -h, --help help for logs + --timeout duration how long to wait to receive logs (default 1m0s) +``` + +### Options inherited from parent commands + +``` + --alsologtostderr log to standard error as well as files + --kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration + --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) + --log_dir string If non-empty, write log files in this directory + --logtostderr log to standard error instead of files + --stderrthreshold severity logs at or above this threshold go to stderr (default 2) + -v, --v Level log level for V logs + --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging +``` + +### SEE ALSO +* [ark backup](ark_backup.md) - Work with backups + diff --git a/docs/cli-reference/ark_restore.md b/docs/cli-reference/ark_restore.md index 4c8c4bc7d..530e7c86e 100644 --- a/docs/cli-reference/ark_restore.md +++ b/docs/cli-reference/ark_restore.md @@ -7,6 +7,12 @@ Work with restores Work with restores +### Options + +``` + -h, --help help for restore +``` + ### Options inherited from parent commands ``` diff --git a/docs/cli-reference/ark_restore_create.md b/docs/cli-reference/ark_restore_create.md index dfe86214f..795b7ad98 100644 --- a/docs/cli-reference/ark_restore_create.md +++ b/docs/cli-reference/ark_restore_create.md @@ -8,13 +8,14 @@ Create a restore Create a restore ``` -ark restore create BACKUP +ark restore create BACKUP [flags] ``` ### Options ``` --exclude-namespaces stringArray namespaces to exclude from the restore + -h, --help help for create --include-namespaces stringArray namespaces to include in the restore (use '*' for all namespaces) (default *) --label-columns stringArray a comma-separated list of labels to be displayed as columns --labels mapStringString labels to apply to the restore diff --git a/docs/cli-reference/ark_restore_delete.md b/docs/cli-reference/ark_restore_delete.md index bd2276e74..2b6563733 100644 --- a/docs/cli-reference/ark_restore_delete.md +++ b/docs/cli-reference/ark_restore_delete.md @@ -8,7 +8,13 @@ Delete a restore Delete a restore ``` -ark restore delete NAME +ark restore delete NAME [flags] +``` + +### Options + +``` + -h, --help help for delete ``` ### Options inherited from parent commands diff --git a/docs/cli-reference/ark_restore_get.md b/docs/cli-reference/ark_restore_get.md index cd37983b0..987cc803c 100644 --- a/docs/cli-reference/ark_restore_get.md +++ b/docs/cli-reference/ark_restore_get.md @@ -8,12 +8,13 @@ get restores get restores ``` -ark restore get +ark restore get [flags] ``` ### Options ``` + -h, --help help for get --label-columns stringArray a comma-separated list of labels to be displayed as columns -o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table") -l, --selector string only show items matching this label selector diff --git a/docs/cli-reference/ark_schedule.md b/docs/cli-reference/ark_schedule.md index 7c146b11e..e080546e8 100644 --- a/docs/cli-reference/ark_schedule.md +++ b/docs/cli-reference/ark_schedule.md @@ -7,6 +7,12 @@ Work with schedules Work with schedules +### Options + +``` + -h, --help help for schedule +``` + ### Options inherited from parent commands ``` diff --git a/docs/cli-reference/ark_schedule_create.md b/docs/cli-reference/ark_schedule_create.md index 3ba7ec9e8..a3ea62726 100644 --- a/docs/cli-reference/ark_schedule_create.md +++ b/docs/cli-reference/ark_schedule_create.md @@ -8,7 +8,7 @@ Create a schedule Create a schedule ``` -ark schedule create NAME +ark schedule create NAME [flags] ``` ### Options @@ -16,6 +16,7 @@ ark schedule create NAME ``` --exclude-namespaces stringArray namespaces to exclude from the backup --exclude-resources stringArray resources to exclude from the backup, formatted as resource.group, such as storageclasses.storage.k8s.io + -h, --help help for create --include-namespaces stringArray namespaces to include in the backup (use '*' for all namespaces) (default *) --include-resources stringArray resources to include in the backup, formatted as resource.group, such as storageclasses.storage.k8s.io (use '*' for all resources) --label-columns stringArray a comma-separated list of labels to be displayed as columns diff --git a/docs/cli-reference/ark_schedule_delete.md b/docs/cli-reference/ark_schedule_delete.md index e8057b3c5..a86f1c5e3 100644 --- a/docs/cli-reference/ark_schedule_delete.md +++ b/docs/cli-reference/ark_schedule_delete.md @@ -8,7 +8,13 @@ Delete a schedule Delete a schedule ``` -ark schedule delete NAME +ark schedule delete NAME [flags] +``` + +### Options + +``` + -h, --help help for delete ``` ### Options inherited from parent commands diff --git a/docs/cli-reference/ark_schedule_get.md b/docs/cli-reference/ark_schedule_get.md index 9852eea53..a6b86ed5a 100644 --- a/docs/cli-reference/ark_schedule_get.md +++ b/docs/cli-reference/ark_schedule_get.md @@ -8,12 +8,13 @@ Get schedules Get schedules ``` -ark schedule get +ark schedule get [flags] ``` ### Options ``` + -h, --help help for get --label-columns stringArray a comma-separated list of labels to be displayed as columns -o, --output string Output display format. For create commands, display the object but do not send it to the server. Valid formats are 'table', 'json', and 'yaml'. (default "table") -l, --selector string only show items matching this label selector diff --git a/docs/cli-reference/ark_server.md b/docs/cli-reference/ark_server.md index 15729ec22..da18fe925 100644 --- a/docs/cli-reference/ark_server.md +++ b/docs/cli-reference/ark_server.md @@ -8,19 +8,20 @@ Run the ark server Run the ark server ``` -ark server +ark server [flags] ``` ### Options ``` - --kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration + -h, --help help for server ``` ### Options inherited from parent commands ``` --alsologtostderr log to standard error as well as files + --kubeconfig string Path to the kubeconfig file to use to talk to the Kubernetes apiserver. If unset, try the environment variable KUBECONFIG, as well as in-cluster configuration --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory --logtostderr log to standard error instead of files diff --git a/docs/cli-reference/ark_version.md b/docs/cli-reference/ark_version.md index 5f08ff16c..744cb5378 100644 --- a/docs/cli-reference/ark_version.md +++ b/docs/cli-reference/ark_version.md @@ -8,7 +8,13 @@ Print the ark version and associated image Print the ark version and associated image ``` -ark version +ark version [flags] +``` + +### Options + +``` + -h, --help help for version ``` ### Options inherited from parent commands diff --git a/pkg/generated/clientset/typed/ark/v1/ark_client.go b/pkg/generated/clientset/typed/ark/v1/ark_client.go index a89846954..b66b79e60 100644 --- a/pkg/generated/clientset/typed/ark/v1/ark_client.go +++ b/pkg/generated/clientset/typed/ark/v1/ark_client.go @@ -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) } diff --git a/pkg/generated/clientset/typed/ark/v1/downloadrequest.go b/pkg/generated/clientset/typed/ark/v1/downloadrequest.go new file mode 100644 index 000000000..7b0c4fcf5 --- /dev/null +++ b/pkg/generated/clientset/typed/ark/v1/downloadrequest.go @@ -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 +} diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go index dfa6aa2a0..6868c42f4 100644 --- a/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go +++ b/pkg/generated/clientset/typed/ark/v1/fake/fake_ark_client.go @@ -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} } diff --git a/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go b/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go new file mode 100644 index 000000000..cbad32dca --- /dev/null +++ b/pkg/generated/clientset/typed/ark/v1/fake/fake_downloadrequest.go @@ -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 +} diff --git a/pkg/generated/clientset/typed/ark/v1/generated_expansion.go b/pkg/generated/clientset/typed/ark/v1/generated_expansion.go index e39c944d4..7ba58630d 100644 --- a/pkg/generated/clientset/typed/ark/v1/generated_expansion.go +++ b/pkg/generated/clientset/typed/ark/v1/generated_expansion.go @@ -4,6 +4,8 @@ type BackupExpansion interface{} type ConfigExpansion interface{} +type DownloadRequestExpansion interface{} + type RestoreExpansion interface{} type ScheduleExpansion interface{} diff --git a/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go b/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go new file mode 100644 index 000000000..c57a717b4 --- /dev/null +++ b/pkg/generated/informers/externalversions/ark/v1/downloadrequest.go @@ -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()) +} diff --git a/pkg/generated/informers/externalversions/ark/v1/interface.go b/pkg/generated/informers/externalversions/ark/v1/interface.go index 74c4cc047..f9eff9e76 100644 --- a/pkg/generated/informers/externalversions/ark/v1/interface.go +++ b/pkg/generated/informers/externalversions/ark/v1/interface.go @@ -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} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 14b889852..bd932781e 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -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"): diff --git a/pkg/generated/listers/ark/v1/downloadrequest.go b/pkg/generated/listers/ark/v1/downloadrequest.go new file mode 100644 index 000000000..60aeb29ff --- /dev/null +++ b/pkg/generated/listers/ark/v1/downloadrequest.go @@ -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 +} diff --git a/pkg/generated/listers/ark/v1/expansion_generated.go b/pkg/generated/listers/ark/v1/expansion_generated.go index 152e7b996..5f03a85fe 100644 --- a/pkg/generated/listers/ark/v1/expansion_generated.go +++ b/pkg/generated/listers/ark/v1/expansion_generated.go @@ -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{}