parent
ee38a9471a
commit
5c9ffae88f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
@ -7,6 +7,12 @@ Work with restores
|
|||
|
||||
Work with restores
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for restore
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -7,6 +7,12 @@ Work with schedules
|
|||
|
||||
Work with schedules
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for schedule
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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{}
|
||||
|
|
Loading…
Reference in New Issue