diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 47cc67b37..e702f3b86 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -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 { diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 886dda3fc..80d769e9b 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -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} -} diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/backup.go b/pkg/generated/clientset/versioned/typed/velero/v1/backup.go index 1b6c8d119..c568f10a1 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/backup.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/backup.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/backupstoragelocation.go b/pkg/generated/clientset/versioned/typed/velero/v1/backupstoragelocation.go index 8f34494f6..416965a9b 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/backupstoragelocation.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/backupstoragelocation.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/deletebackuprequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/deletebackuprequest.go index 93929700b..bb4cf1a4f 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/deletebackuprequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/deletebackuprequest.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/downloadrequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/downloadrequest.go index 6d8e939df..78fe0ed98 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/downloadrequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/downloadrequest.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backup.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backup.go index 486be00d2..495ee0aa4 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backup.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backup.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backupstoragelocation.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backupstoragelocation.go index c1105d521..012b07411 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backupstoragelocation.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_backupstoragelocation.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_deletebackuprequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_deletebackuprequest.go index c3dc72a57..d92c144b9 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_deletebackuprequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_deletebackuprequest.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_downloadrequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_downloadrequest.go index 6c525dc73..cadfcb4e3 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_downloadrequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_downloadrequest.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumebackup.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumebackup.go index 750cb1593..2f4119a7f 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumebackup.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumebackup.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumerestore.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumerestore.go index 8e977b940..799e531e4 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumerestore.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_podvolumerestore.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_resticrepository.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_resticrepository.go index 05eb530ba..4e90d4b3d 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_resticrepository.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_resticrepository.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_restore.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_restore.go index a0b52cb5c..7092630d6 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_restore.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_restore.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_schedule.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_schedule.go index 1b16626b2..4cd9001ea 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_schedule.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_schedule.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_serverstatusrequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_serverstatusrequest.go index e7fe66b06..278bc070e 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_serverstatusrequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_serverstatusrequest.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_volumesnapshotlocation.go b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_volumesnapshotlocation.go index c5f94f3cd..9920abb8a 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_volumesnapshotlocation.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/fake/fake_volumesnapshotlocation.go @@ -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 diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/podvolumebackup.go b/pkg/generated/clientset/versioned/typed/velero/v1/podvolumebackup.go index 403937371..deab18d7c 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/podvolumebackup.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/podvolumebackup.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/podvolumerestore.go b/pkg/generated/clientset/versioned/typed/velero/v1/podvolumerestore.go index 0bf7133dc..c4cbea01c 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/podvolumerestore.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/podvolumerestore.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/resticrepository.go b/pkg/generated/clientset/versioned/typed/velero/v1/resticrepository.go index fcb7d57c0..e672fd1d3 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/resticrepository.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/resticrepository.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/restore.go b/pkg/generated/clientset/versioned/typed/velero/v1/restore.go index 225e41727..680e802dd 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/restore.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/restore.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/schedule.go b/pkg/generated/clientset/versioned/typed/velero/v1/schedule.go index c071d7225..3eba1d20f 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/schedule.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/schedule.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/serverstatusrequest.go b/pkg/generated/clientset/versioned/typed/velero/v1/serverstatusrequest.go index 68d13caf5..42edf6e4c 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/serverstatusrequest.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/serverstatusrequest.go @@ -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() diff --git a/pkg/generated/clientset/versioned/typed/velero/v1/volumesnapshotlocation.go b/pkg/generated/clientset/versioned/typed/velero/v1/volumesnapshotlocation.go index 8f2dd9ac3..5b4571278 100644 --- a/pkg/generated/clientset/versioned/typed/velero/v1/volumesnapshotlocation.go +++ b/pkg/generated/clientset/versioned/typed/velero/v1/volumesnapshotlocation.go @@ -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() diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go index d43826e31..ea36e70a1 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -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)