add restic integration for doing pod volume backups/restores

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-06-06 09:48:10 -07:00
parent c2c5b9040c
commit 50d4084fac
86 changed files with 5421 additions and 485 deletions
@@ -31,6 +31,8 @@ type ArkV1Interface interface {
ConfigsGetter
DeleteBackupRequestsGetter
DownloadRequestsGetter
PodVolumeBackupsGetter
PodVolumeRestoresGetter
RestoresGetter
SchedulesGetter
}
@@ -56,6 +58,14 @@ func (c *ArkV1Client) DownloadRequests(namespace string) DownloadRequestInterfac
return newDownloadRequests(c, namespace)
}
func (c *ArkV1Client) PodVolumeBackups(namespace string) PodVolumeBackupInterface {
return newPodVolumeBackups(c, namespace)
}
func (c *ArkV1Client) PodVolumeRestores(namespace string) PodVolumeRestoreInterface {
return newPodVolumeRestores(c, namespace)
}
func (c *ArkV1Client) Restores(namespace string) RestoreInterface {
return newRestores(c, namespace)
}
@@ -44,6 +44,14 @@ func (c *FakeArkV1) DownloadRequests(namespace string) v1.DownloadRequestInterfa
return &FakeDownloadRequests{c, namespace}
}
func (c *FakeArkV1) PodVolumeBackups(namespace string) v1.PodVolumeBackupInterface {
return &FakePodVolumeBackups{c, namespace}
}
func (c *FakeArkV1) PodVolumeRestores(namespace string) v1.PodVolumeRestoreInterface {
return &FakePodVolumeRestores{c, namespace}
}
func (c *FakeArkV1) Restores(namespace string) v1.RestoreInterface {
return &FakeRestores{c, namespace}
}
@@ -0,0 +1,140 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 (
ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
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"
)
// FakePodVolumeBackups implements PodVolumeBackupInterface
type FakePodVolumeBackups struct {
Fake *FakeArkV1
ns string
}
var podvolumebackupsResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "podvolumebackups"}
var podvolumebackupsKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeBackup"}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *FakePodVolumeBackups) Get(name string, options v1.GetOptions) (result *ark_v1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumebackupsResource, c.ns, name), &ark_v1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *FakePodVolumeBackups) List(opts v1.ListOptions) (result *ark_v1.PodVolumeBackupList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumebackupsResource, podvolumebackupsKind, c.ns, opts), &ark_v1.PodVolumeBackupList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &ark_v1.PodVolumeBackupList{}
for _, item := range obj.(*ark_v1.PodVolumeBackupList).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 podVolumeBackups.
func (c *FakePodVolumeBackups) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podvolumebackupsResource, c.ns, opts))
}
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Create(podVolumeBackup *ark_v1.PodVolumeBackup) (result *ark_v1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
}
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *FakePodVolumeBackups) Update(podVolumeBackup *ark_v1.PodVolumeBackup) (result *ark_v1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumebackupsResource, c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), 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 *FakePodVolumeBackups) UpdateStatus(podVolumeBackup *ark_v1.PodVolumeBackup) (*ark_v1.PodVolumeBackup, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumebackupsResource, "status", c.ns, podVolumeBackup), &ark_v1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeBackups) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumebackupsResource, c.ns, name), &ark_v1.PodVolumeBackup{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePodVolumeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumebackupsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.PodVolumeBackupList{})
return err
}
// Patch applies the patch and returns the patched podVolumeBackup.
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &ark_v1.PodVolumeBackup{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeBackup), err
}
@@ -0,0 +1,140 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 (
ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
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"
)
// FakePodVolumeRestores implements PodVolumeRestoreInterface
type FakePodVolumeRestores struct {
Fake *FakeArkV1
ns string
}
var podvolumerestoresResource = schema.GroupVersionResource{Group: "ark.heptio.com", Version: "v1", Resource: "podvolumerestores"}
var podvolumerestoresKind = schema.GroupVersionKind{Group: "ark.heptio.com", Version: "v1", Kind: "PodVolumeRestore"}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *FakePodVolumeRestores) Get(name string, options v1.GetOptions) (result *ark_v1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(podvolumerestoresResource, c.ns, name), &ark_v1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *FakePodVolumeRestores) List(opts v1.ListOptions) (result *ark_v1.PodVolumeRestoreList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(podvolumerestoresResource, podvolumerestoresKind, c.ns, opts), &ark_v1.PodVolumeRestoreList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &ark_v1.PodVolumeRestoreList{}
for _, item := range obj.(*ark_v1.PodVolumeRestoreList).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 podVolumeRestores.
func (c *FakePodVolumeRestores) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(podvolumerestoresResource, c.ns, opts))
}
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Create(podVolumeRestore *ark_v1.PodVolumeRestore) (result *ark_v1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
}
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *FakePodVolumeRestores) Update(podVolumeRestore *ark_v1.PodVolumeRestore) (result *ark_v1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(podvolumerestoresResource, c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), 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 *FakePodVolumeRestores) UpdateStatus(podVolumeRestore *ark_v1.PodVolumeRestore) (*ark_v1.PodVolumeRestore, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(podvolumerestoresResource, "status", c.ns, podVolumeRestore), &ark_v1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *FakePodVolumeRestores) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(podvolumerestoresResource, c.ns, name), &ark_v1.PodVolumeRestore{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakePodVolumeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(podvolumerestoresResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &ark_v1.PodVolumeRestoreList{})
return err
}
// Patch applies the patch and returns the patched podVolumeRestore.
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *ark_v1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &ark_v1.PodVolumeRestore{})
if obj == nil {
return nil, err
}
return obj.(*ark_v1.PodVolumeRestore), err
}
@@ -26,6 +26,10 @@ type DeleteBackupRequestExpansion interface{}
type DownloadRequestExpansion interface{}
type PodVolumeBackupExpansion interface{}
type PodVolumeRestoreExpansion interface{}
type RestoreExpansion interface{}
type ScheduleExpansion interface{}
@@ -0,0 +1,174 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 v1
import (
v1 "github.com/heptio/ark/pkg/apis/ark/v1"
scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/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"
)
// PodVolumeBackupsGetter has a method to return a PodVolumeBackupInterface.
// A group's client should implement this interface.
type PodVolumeBackupsGetter interface {
PodVolumeBackups(namespace string) PodVolumeBackupInterface
}
// PodVolumeBackupInterface has methods to work with PodVolumeBackup resources.
type PodVolumeBackupInterface interface {
Create(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
Update(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, error)
UpdateStatus(*v1.PodVolumeBackup) (*v1.PodVolumeBackup, 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.PodVolumeBackup, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeBackupList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error)
PodVolumeBackupExpansion
}
// podVolumeBackups implements PodVolumeBackupInterface
type podVolumeBackups struct {
client rest.Interface
ns string
}
// newPodVolumeBackups returns a PodVolumeBackups
func newPodVolumeBackups(c *ArkV1Client, namespace string) *podVolumeBackups {
return &podVolumeBackups{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the podVolumeBackup, and returns the corresponding podVolumeBackup object, and an error if there is any.
func (c *podVolumeBackups) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumebackups").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *podVolumeBackups) List(opts meta_v1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
result = &v1.PodVolumeBackupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
func (c *podVolumeBackups) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a podVolumeBackup and creates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *podVolumeBackups) Create(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Post().
Namespace(c.ns).
Resource("podvolumebackups").
Body(podVolumeBackup).
Do().
Into(result)
return
}
// Update takes the representation of a podVolumeBackup and updates it. Returns the server's representation of the podVolumeBackup, and an error, if there is any.
func (c *podVolumeBackups) Update(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Put().
Namespace(c.ns).
Resource("podvolumebackups").
Name(podVolumeBackup.Name).
Body(podVolumeBackup).
Do().
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 *podVolumeBackups) UpdateStatus(podVolumeBackup *v1.PodVolumeBackup) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Put().
Namespace(c.ns).
Resource("podvolumebackups").
Name(podVolumeBackup.Name).
SubResource("status").
Body(podVolumeBackup).
Do().
Into(result)
return
}
// Delete takes name of the podVolumeBackup and deletes it. Returns an error if one occurs.
func (c *podVolumeBackups) Delete(name string, options *meta_v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeBackups) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched podVolumeBackup.
func (c *podVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeBackup, err error) {
result = &v1.PodVolumeBackup{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("podvolumebackups").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -0,0 +1,174 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 v1
import (
v1 "github.com/heptio/ark/pkg/apis/ark/v1"
scheme "github.com/heptio/ark/pkg/generated/clientset/versioned/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"
)
// PodVolumeRestoresGetter has a method to return a PodVolumeRestoreInterface.
// A group's client should implement this interface.
type PodVolumeRestoresGetter interface {
PodVolumeRestores(namespace string) PodVolumeRestoreInterface
}
// PodVolumeRestoreInterface has methods to work with PodVolumeRestore resources.
type PodVolumeRestoreInterface interface {
Create(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
Update(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, error)
UpdateStatus(*v1.PodVolumeRestore) (*v1.PodVolumeRestore, 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.PodVolumeRestore, error)
List(opts meta_v1.ListOptions) (*v1.PodVolumeRestoreList, error)
Watch(opts meta_v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error)
PodVolumeRestoreExpansion
}
// podVolumeRestores implements PodVolumeRestoreInterface
type podVolumeRestores struct {
client rest.Interface
ns string
}
// newPodVolumeRestores returns a PodVolumeRestores
func newPodVolumeRestores(c *ArkV1Client, namespace string) *podVolumeRestores {
return &podVolumeRestores{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the podVolumeRestore, and returns the corresponding podVolumeRestore object, and an error if there is any.
func (c *podVolumeRestores) Get(name string, options meta_v1.GetOptions) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumerestores").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *podVolumeRestores) List(opts meta_v1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
result = &v1.PodVolumeRestoreList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&opts, scheme.ParameterCodec).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
func (c *podVolumeRestores) Watch(opts meta_v1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&opts, scheme.ParameterCodec).
Watch()
}
// Create takes the representation of a podVolumeRestore and creates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *podVolumeRestores) Create(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Post().
Namespace(c.ns).
Resource("podvolumerestores").
Body(podVolumeRestore).
Do().
Into(result)
return
}
// Update takes the representation of a podVolumeRestore and updates it. Returns the server's representation of the podVolumeRestore, and an error, if there is any.
func (c *podVolumeRestores) Update(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Put().
Namespace(c.ns).
Resource("podvolumerestores").
Name(podVolumeRestore.Name).
Body(podVolumeRestore).
Do().
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 *podVolumeRestores) UpdateStatus(podVolumeRestore *v1.PodVolumeRestore) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Put().
Namespace(c.ns).
Resource("podvolumerestores").
Name(podVolumeRestore.Name).
SubResource("status").
Body(podVolumeRestore).
Do().
Into(result)
return
}
// Delete takes name of the podVolumeRestore and deletes it. Returns an error if one occurs.
func (c *podVolumeRestores) Delete(name string, options *meta_v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *podVolumeRestores) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&listOptions, scheme.ParameterCodec).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched podVolumeRestore.
func (c *podVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodVolumeRestore, err error) {
result = &v1.PodVolumeRestore{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("podvolumerestores").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
@@ -32,6 +32,10 @@ type Interface interface {
DeleteBackupRequests() DeleteBackupRequestInformer
// DownloadRequests returns a DownloadRequestInformer.
DownloadRequests() DownloadRequestInformer
// PodVolumeBackups returns a PodVolumeBackupInformer.
PodVolumeBackups() PodVolumeBackupInformer
// PodVolumeRestores returns a PodVolumeRestoreInformer.
PodVolumeRestores() PodVolumeRestoreInformer
// Restores returns a RestoreInformer.
Restores() RestoreInformer
// Schedules returns a ScheduleInformer.
@@ -69,6 +73,16 @@ func (v *version) DownloadRequests() DownloadRequestInformer {
return &downloadRequestInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// PodVolumeBackups returns a PodVolumeBackupInformer.
func (v *version) PodVolumeBackups() PodVolumeBackupInformer {
return &podVolumeBackupInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// PodVolumeRestores returns a PodVolumeRestoreInformer.
func (v *version) PodVolumeRestores() PodVolumeRestoreInformer {
return &podVolumeRestoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
}
// Restores returns a RestoreInformer.
func (v *version) Restores() RestoreInformer {
return &restoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
@@ -0,0 +1,89 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 v1
import (
time "time"
ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
versioned "github.com/heptio/ark/pkg/generated/clientset/versioned"
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"
)
// PodVolumeBackupInformer provides access to a shared informer and lister for
// PodVolumeBackups.
type PodVolumeBackupInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.PodVolumeBackupLister
}
type podVolumeBackupInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewPodVolumeBackupInformer constructs a new informer for PodVolumeBackup 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 NewPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPodVolumeBackupInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredPodVolumeBackupInformer constructs a new informer for PodVolumeBackup 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 NewFilteredPodVolumeBackupInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeBackups(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeBackups(namespace).Watch(options)
},
},
&ark_v1.PodVolumeBackup{},
resyncPeriod,
indexers,
)
}
func (f *podVolumeBackupInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPodVolumeBackupInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *podVolumeBackupInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.PodVolumeBackup{}, f.defaultInformer)
}
func (f *podVolumeBackupInformer) Lister() v1.PodVolumeBackupLister {
return v1.NewPodVolumeBackupLister(f.Informer().GetIndexer())
}
@@ -0,0 +1,89 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 v1
import (
time "time"
ark_v1 "github.com/heptio/ark/pkg/apis/ark/v1"
versioned "github.com/heptio/ark/pkg/generated/clientset/versioned"
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"
)
// PodVolumeRestoreInformer provides access to a shared informer and lister for
// PodVolumeRestores.
type PodVolumeRestoreInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1.PodVolumeRestoreLister
}
type podVolumeRestoreInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
namespace string
}
// NewPodVolumeRestoreInformer constructs a new informer for PodVolumeRestore 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 NewPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredPodVolumeRestoreInformer(client, namespace, resyncPeriod, indexers, nil)
}
// NewFilteredPodVolumeRestoreInformer constructs a new informer for PodVolumeRestore 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 NewFilteredPodVolumeRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options meta_v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeRestores(namespace).List(options)
},
WatchFunc: func(options meta_v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ArkV1().PodVolumeRestores(namespace).Watch(options)
},
},
&ark_v1.PodVolumeRestore{},
resyncPeriod,
indexers,
)
}
func (f *podVolumeRestoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredPodVolumeRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}
func (f *podVolumeRestoreInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&ark_v1.PodVolumeRestore{}, f.defaultInformer)
}
func (f *podVolumeRestoreInformer) Lister() v1.PodVolumeRestoreLister {
return v1.NewPodVolumeRestoreLister(f.Informer().GetIndexer())
}
@@ -61,6 +61,10 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().DeleteBackupRequests().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("downloadrequests"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().DownloadRequests().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("podvolumebackups"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().PodVolumeBackups().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("podvolumerestores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().PodVolumeRestores().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("restores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Ark().V1().Restores().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("schedules"):
@@ -50,6 +50,22 @@ type DownloadRequestListerExpansion interface{}
// DownloadRequestNamespaceLister.
type DownloadRequestNamespaceListerExpansion interface{}
// PodVolumeBackupListerExpansion allows custom methods to be added to
// PodVolumeBackupLister.
type PodVolumeBackupListerExpansion interface{}
// PodVolumeBackupNamespaceListerExpansion allows custom methods to be added to
// PodVolumeBackupNamespaceLister.
type PodVolumeBackupNamespaceListerExpansion interface{}
// PodVolumeRestoreListerExpansion allows custom methods to be added to
// PodVolumeRestoreLister.
type PodVolumeRestoreListerExpansion interface{}
// PodVolumeRestoreNamespaceListerExpansion allows custom methods to be added to
// PodVolumeRestoreNamespaceLister.
type PodVolumeRestoreNamespaceListerExpansion interface{}
// RestoreListerExpansion allows custom methods to be added to
// RestoreLister.
type RestoreListerExpansion interface{}
@@ -0,0 +1,94 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 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"
)
// PodVolumeBackupLister helps list PodVolumeBackups.
type PodVolumeBackupLister interface {
// List lists all PodVolumeBackups in the indexer.
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
// PodVolumeBackups returns an object that can list and get PodVolumeBackups.
PodVolumeBackups(namespace string) PodVolumeBackupNamespaceLister
PodVolumeBackupListerExpansion
}
// podVolumeBackupLister implements the PodVolumeBackupLister interface.
type podVolumeBackupLister struct {
indexer cache.Indexer
}
// NewPodVolumeBackupLister returns a new PodVolumeBackupLister.
func NewPodVolumeBackupLister(indexer cache.Indexer) PodVolumeBackupLister {
return &podVolumeBackupLister{indexer: indexer}
}
// List lists all PodVolumeBackups in the indexer.
func (s *podVolumeBackupLister) List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.PodVolumeBackup))
})
return ret, err
}
// PodVolumeBackups returns an object that can list and get PodVolumeBackups.
func (s *podVolumeBackupLister) PodVolumeBackups(namespace string) PodVolumeBackupNamespaceLister {
return podVolumeBackupNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// PodVolumeBackupNamespaceLister helps list and get PodVolumeBackups.
type PodVolumeBackupNamespaceLister interface {
// List lists all PodVolumeBackups in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error)
// Get retrieves the PodVolumeBackup from the indexer for a given namespace and name.
Get(name string) (*v1.PodVolumeBackup, error)
PodVolumeBackupNamespaceListerExpansion
}
// podVolumeBackupNamespaceLister implements the PodVolumeBackupNamespaceLister
// interface.
type podVolumeBackupNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all PodVolumeBackups in the indexer for a given namespace.
func (s podVolumeBackupNamespaceLister) List(selector labels.Selector) (ret []*v1.PodVolumeBackup, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.PodVolumeBackup))
})
return ret, err
}
// Get retrieves the PodVolumeBackup from the indexer for a given namespace and name.
func (s podVolumeBackupNamespaceLister) Get(name string) (*v1.PodVolumeBackup, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("podvolumebackup"), name)
}
return obj.(*v1.PodVolumeBackup), nil
}
@@ -0,0 +1,94 @@
/*
Copyright 2018 the Heptio Ark contributors.
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 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"
)
// PodVolumeRestoreLister helps list PodVolumeRestores.
type PodVolumeRestoreLister interface {
// List lists all PodVolumeRestores in the indexer.
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
// PodVolumeRestores returns an object that can list and get PodVolumeRestores.
PodVolumeRestores(namespace string) PodVolumeRestoreNamespaceLister
PodVolumeRestoreListerExpansion
}
// podVolumeRestoreLister implements the PodVolumeRestoreLister interface.
type podVolumeRestoreLister struct {
indexer cache.Indexer
}
// NewPodVolumeRestoreLister returns a new PodVolumeRestoreLister.
func NewPodVolumeRestoreLister(indexer cache.Indexer) PodVolumeRestoreLister {
return &podVolumeRestoreLister{indexer: indexer}
}
// List lists all PodVolumeRestores in the indexer.
func (s *podVolumeRestoreLister) List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.PodVolumeRestore))
})
return ret, err
}
// PodVolumeRestores returns an object that can list and get PodVolumeRestores.
func (s *podVolumeRestoreLister) PodVolumeRestores(namespace string) PodVolumeRestoreNamespaceLister {
return podVolumeRestoreNamespaceLister{indexer: s.indexer, namespace: namespace}
}
// PodVolumeRestoreNamespaceLister helps list and get PodVolumeRestores.
type PodVolumeRestoreNamespaceLister interface {
// List lists all PodVolumeRestores in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error)
// Get retrieves the PodVolumeRestore from the indexer for a given namespace and name.
Get(name string) (*v1.PodVolumeRestore, error)
PodVolumeRestoreNamespaceListerExpansion
}
// podVolumeRestoreNamespaceLister implements the PodVolumeRestoreNamespaceLister
// interface.
type podVolumeRestoreNamespaceLister struct {
indexer cache.Indexer
namespace string
}
// List lists all PodVolumeRestores in the indexer for a given namespace.
func (s podVolumeRestoreNamespaceLister) List(selector labels.Selector) (ret []*v1.PodVolumeRestore, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1.PodVolumeRestore))
})
return ret, err
}
// Get retrieves the PodVolumeRestore from the indexer for a given namespace and name.
func (s podVolumeRestoreNamespaceLister) Get(name string) (*v1.PodVolumeRestore, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1.Resource("podvolumerestore"), name)
}
return obj.(*v1.PodVolumeRestore), nil
}