update generated code

Signed-off-by: Steve Kriss <krisss@vmware.com>
pull/1510/head
Steve Kriss 2019-05-03 09:43:25 -06:00
parent 13b6cbb4db
commit 02c7df9ea0
25 changed files with 200 additions and 24 deletions

View File

@ -28,8 +28,6 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
VeleroV1() velerov1.VeleroV1Interface
// Deprecated: please explicitly pick a version if possible.
Velero() velerov1.VeleroV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@ -44,12 +42,6 @@ func (c *Clientset) VeleroV1() velerov1.VeleroV1Interface {
return c.veleroV1
}
// Deprecated: Velero retrieves the default version of VeleroClient.
// Please explicitly pick a version.
func (c *Clientset) Velero() velerov1.VeleroV1Interface {
return c.veleroV1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {

View File

@ -75,8 +75,3 @@ var _ clientset.Interface = &Clientset{}
func (c *Clientset) VeleroV1() velerov1.VeleroV1Interface {
return &fakevelerov1.FakeVeleroV1{Fake: &c.Fake}
}
// Velero retrieves the VeleroV1Client
func (c *Clientset) Velero() velerov1.VeleroV1Interface {
return &fakevelerov1.FakeVeleroV1{Fake: &c.Fake}
}

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *backups) Get(name string, options metav1.GetOptions) (result *v1.Backup
// List takes label and field selectors, and returns the list of Backups that match those selectors.
func (c *backups) List(opts metav1.ListOptions) (result *v1.BackupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.BackupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("backups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *backups) List(opts metav1.ListOptions) (result *v1.BackupList, err erro
// Watch returns a watch.Interface that watches the requested backups.
func (c *backups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("backups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *backups) Delete(name string, options *metav1.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func (c *backups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("backups").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *backupStorageLocations) Get(name string, options metav1.GetOptions) (re
// List takes label and field selectors, and returns the list of BackupStorageLocations that match those selectors.
func (c *backupStorageLocations) List(opts metav1.ListOptions) (result *v1.BackupStorageLocationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.BackupStorageLocationList{}
err = c.client.Get().
Namespace(c.ns).
Resource("backupstoragelocations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *backupStorageLocations) List(opts metav1.ListOptions) (result *v1.Backu
// Watch returns a watch.Interface that watches the requested backupStorageLocations.
func (c *backupStorageLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("backupstoragelocations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *backupStorageLocations) Delete(name string, options *metav1.DeleteOptio
// DeleteCollection deletes a collection of objects.
func (c *backupStorageLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("backupstoragelocations").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *deleteBackupRequests) Get(name string, options metav1.GetOptions) (resu
// List takes label and field selectors, and returns the list of DeleteBackupRequests that match those selectors.
func (c *deleteBackupRequests) List(opts metav1.ListOptions) (result *v1.DeleteBackupRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DeleteBackupRequestList{}
err = c.client.Get().
Namespace(c.ns).
Resource("deletebackuprequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *deleteBackupRequests) List(opts metav1.ListOptions) (result *v1.DeleteB
// Watch returns a watch.Interface that watches the requested deleteBackupRequests.
func (c *deleteBackupRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("deletebackuprequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *deleteBackupRequests) Delete(name string, options *metav1.DeleteOptions
// DeleteCollection deletes a collection of objects.
func (c *deleteBackupRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("deletebackuprequests").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *downloadRequests) Get(name string, options metav1.GetOptions) (result *
// List takes label and field selectors, and returns the list of DownloadRequests that match those selectors.
func (c *downloadRequests) List(opts metav1.ListOptions) (result *v1.DownloadRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.DownloadRequestList{}
err = c.client.Get().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *downloadRequests) List(opts metav1.ListOptions) (result *v1.DownloadReq
// Watch returns a watch.Interface that watches the requested downloadRequests.
func (c *downloadRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *downloadRequests) Delete(name string, options *metav1.DeleteOptions) er
// DeleteCollection deletes a collection of objects.
func (c *downloadRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("downloadrequests").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -131,7 +131,7 @@ func (c *FakeBackups) DeleteCollection(options *v1.DeleteOptions, listOptions v1
// Patch applies the patch and returns the patched backup.
func (c *FakeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Backup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, data, subresources...), &velerov1.Backup{})
Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, pt, data, subresources...), &velerov1.Backup{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeBackupStorageLocations) DeleteCollection(options *v1.DeleteOptions,
// Patch applies the patch and returns the patched backupStorageLocation.
func (c *FakeBackupStorageLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.BackupStorageLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, data, subresources...), &velerov1.BackupStorageLocation{})
Invokes(testing.NewPatchSubresourceAction(backupstoragelocationsResource, c.ns, name, pt, data, subresources...), &velerov1.BackupStorageLocation{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeDeleteBackupRequests) DeleteCollection(options *v1.DeleteOptions, l
// Patch applies the patch and returns the patched deleteBackupRequest.
func (c *FakeDeleteBackupRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.DeleteBackupRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, data, subresources...), &velerov1.DeleteBackupRequest{})
Invokes(testing.NewPatchSubresourceAction(deletebackuprequestsResource, c.ns, name, pt, data, subresources...), &velerov1.DeleteBackupRequest{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeDownloadRequests) DeleteCollection(options *v1.DeleteOptions, listO
// Patch applies the patch and returns the patched downloadRequest.
func (c *FakeDownloadRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.DownloadRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, data, subresources...), &velerov1.DownloadRequest{})
Invokes(testing.NewPatchSubresourceAction(downloadrequestsResource, c.ns, name, pt, data, subresources...), &velerov1.DownloadRequest{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakePodVolumeBackups) DeleteCollection(options *v1.DeleteOptions, listO
// Patch applies the patch and returns the patched podVolumeBackup.
func (c *FakePodVolumeBackups) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.PodVolumeBackup, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, data, subresources...), &velerov1.PodVolumeBackup{})
Invokes(testing.NewPatchSubresourceAction(podvolumebackupsResource, c.ns, name, pt, data, subresources...), &velerov1.PodVolumeBackup{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakePodVolumeRestores) DeleteCollection(options *v1.DeleteOptions, list
// Patch applies the patch and returns the patched podVolumeRestore.
func (c *FakePodVolumeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.PodVolumeRestore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, data, subresources...), &velerov1.PodVolumeRestore{})
Invokes(testing.NewPatchSubresourceAction(podvolumerestoresResource, c.ns, name, pt, data, subresources...), &velerov1.PodVolumeRestore{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeResticRepositories) DeleteCollection(options *v1.DeleteOptions, lis
// Patch applies the patch and returns the patched resticRepository.
func (c *FakeResticRepositories) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.ResticRepository, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, data, subresources...), &velerov1.ResticRepository{})
Invokes(testing.NewPatchSubresourceAction(resticrepositoriesResource, c.ns, name, pt, data, subresources...), &velerov1.ResticRepository{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeRestores) DeleteCollection(options *v1.DeleteOptions, listOptions v
// Patch applies the patch and returns the patched restore.
func (c *FakeRestores) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Restore, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, data, subresources...), &velerov1.Restore{})
Invokes(testing.NewPatchSubresourceAction(restoresResource, c.ns, name, pt, data, subresources...), &velerov1.Restore{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeSchedules) DeleteCollection(options *v1.DeleteOptions, listOptions
// Patch applies the patch and returns the patched schedule.
func (c *FakeSchedules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.Schedule, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, data, subresources...), &velerov1.Schedule{})
Invokes(testing.NewPatchSubresourceAction(schedulesResource, c.ns, name, pt, data, subresources...), &velerov1.Schedule{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeServerStatusRequests) DeleteCollection(options *v1.DeleteOptions, l
// Patch applies the patch and returns the patched serverStatusRequest.
func (c *FakeServerStatusRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.ServerStatusRequest, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, data, subresources...), &velerov1.ServerStatusRequest{})
Invokes(testing.NewPatchSubresourceAction(serverstatusrequestsResource, c.ns, name, pt, data, subresources...), &velerov1.ServerStatusRequest{})
if obj == nil {
return nil, err

View File

@ -131,7 +131,7 @@ func (c *FakeVolumeSnapshotLocations) DeleteCollection(options *v1.DeleteOptions
// Patch applies the patch and returns the patched volumeSnapshotLocation.
func (c *FakeVolumeSnapshotLocations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *velerov1.VolumeSnapshotLocation, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, data, subresources...), &velerov1.VolumeSnapshotLocation{})
Invokes(testing.NewPatchSubresourceAction(volumesnapshotlocationsResource, c.ns, name, pt, data, subresources...), &velerov1.VolumeSnapshotLocation{})
if obj == nil {
return nil, err

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *podVolumeBackups) Get(name string, options metav1.GetOptions) (result *
// List takes label and field selectors, and returns the list of PodVolumeBackups that match those selectors.
func (c *podVolumeBackups) List(opts metav1.ListOptions) (result *v1.PodVolumeBackupList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodVolumeBackupList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *podVolumeBackups) List(opts metav1.ListOptions) (result *v1.PodVolumeBa
// Watch returns a watch.Interface that watches the requested podVolumeBackups.
func (c *podVolumeBackups) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *podVolumeBackups) Delete(name string, options *metav1.DeleteOptions) er
// DeleteCollection deletes a collection of objects.
func (c *podVolumeBackups) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumebackups").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *podVolumeRestores) Get(name string, options metav1.GetOptions) (result
// List takes label and field selectors, and returns the list of PodVolumeRestores that match those selectors.
func (c *podVolumeRestores) List(opts metav1.ListOptions) (result *v1.PodVolumeRestoreList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.PodVolumeRestoreList{}
err = c.client.Get().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *podVolumeRestores) List(opts metav1.ListOptions) (result *v1.PodVolumeR
// Watch returns a watch.Interface that watches the requested podVolumeRestores.
func (c *podVolumeRestores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *podVolumeRestores) Delete(name string, options *metav1.DeleteOptions) e
// DeleteCollection deletes a collection of objects.
func (c *podVolumeRestores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("podvolumerestores").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *resticRepositories) Get(name string, options metav1.GetOptions) (result
// List takes label and field selectors, and returns the list of ResticRepositories that match those selectors.
func (c *resticRepositories) List(opts metav1.ListOptions) (result *v1.ResticRepositoryList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ResticRepositoryList{}
err = c.client.Get().
Namespace(c.ns).
Resource("resticrepositories").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *resticRepositories) List(opts metav1.ListOptions) (result *v1.ResticRep
// Watch returns a watch.Interface that watches the requested resticRepositories.
func (c *resticRepositories) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("resticrepositories").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *resticRepositories) Delete(name string, options *metav1.DeleteOptions)
// DeleteCollection deletes a collection of objects.
func (c *resticRepositories) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("resticrepositories").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *restores) Get(name string, options metav1.GetOptions) (result *v1.Resto
// List takes label and field selectors, and returns the list of Restores that match those selectors.
func (c *restores) List(opts metav1.ListOptions) (result *v1.RestoreList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.RestoreList{}
err = c.client.Get().
Namespace(c.ns).
Resource("restores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *restores) List(opts metav1.ListOptions) (result *v1.RestoreList, err er
// Watch returns a watch.Interface that watches the requested restores.
func (c *restores) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("restores").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *restores) Delete(name string, options *metav1.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func (c *restores) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("restores").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *schedules) Get(name string, options metav1.GetOptions) (result *v1.Sche
// List takes label and field selectors, and returns the list of Schedules that match those selectors.
func (c *schedules) List(opts metav1.ListOptions) (result *v1.ScheduleList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ScheduleList{}
err = c.client.Get().
Namespace(c.ns).
Resource("schedules").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *schedules) List(opts metav1.ListOptions) (result *v1.ScheduleList, err
// Watch returns a watch.Interface that watches the requested schedules.
func (c *schedules) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("schedules").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *schedules) Delete(name string, options *metav1.DeleteOptions) error {
// DeleteCollection deletes a collection of objects.
func (c *schedules) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("schedules").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *serverStatusRequests) Get(name string, options metav1.GetOptions) (resu
// List takes label and field selectors, and returns the list of ServerStatusRequests that match those selectors.
func (c *serverStatusRequests) List(opts metav1.ListOptions) (result *v1.ServerStatusRequestList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.ServerStatusRequestList{}
err = c.client.Get().
Namespace(c.ns).
Resource("serverstatusrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *serverStatusRequests) List(opts metav1.ListOptions) (result *v1.ServerS
// Watch returns a watch.Interface that watches the requested serverStatusRequests.
func (c *serverStatusRequests) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("serverstatusrequests").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *serverStatusRequests) Delete(name string, options *metav1.DeleteOptions
// DeleteCollection deletes a collection of objects.
func (c *serverStatusRequests) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("serverstatusrequests").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -19,6 +19,8 @@ limitations under the License.
package v1
import (
"time"
v1 "github.com/heptio/velero/pkg/apis/velero/v1"
scheme "github.com/heptio/velero/pkg/generated/clientset/versioned/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -76,11 +78,16 @@ func (c *volumeSnapshotLocations) Get(name string, options metav1.GetOptions) (r
// List takes label and field selectors, and returns the list of VolumeSnapshotLocations that match those selectors.
func (c *volumeSnapshotLocations) List(opts metav1.ListOptions) (result *v1.VolumeSnapshotLocationList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1.VolumeSnapshotLocationList{}
err = c.client.Get().
Namespace(c.ns).
Resource("volumesnapshotlocations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
@ -88,11 +95,16 @@ func (c *volumeSnapshotLocations) List(opts metav1.ListOptions) (result *v1.Volu
// Watch returns a watch.Interface that watches the requested volumeSnapshotLocations.
func (c *volumeSnapshotLocations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("volumesnapshotlocations").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
@ -150,10 +162,15 @@ func (c *volumeSnapshotLocations) Delete(name string, options *metav1.DeleteOpti
// DeleteCollection deletes a collection of objects.
func (c *volumeSnapshotLocations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("volumesnapshotlocations").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()

View File

@ -27,6 +27,7 @@ import (
cache "k8s.io/client-go/tools/cache"
)
// NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer.
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
@ -35,4 +36,5 @@ type SharedInformerFactory interface {
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
}
// TweakListOptionsFunc is a function that transforms a v1.ListOptions.
type TweakListOptionsFunc func(*v1.ListOptions)