Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use k8s 1.29 client libs #1547

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
245 changes: 125 additions & 120 deletions go.mod

Large diffs are not rendered by default.

638 changes: 328 additions & 310 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pkg/backup/backupsession.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (c *BackupSessionController) runBackupSessionController(invokerRef *core.Ob
func (c *BackupSessionController) initBackupSessionWatcher() error {
c.bsInformer = c.StashInformerFactory.Stash().V1beta1().BackupSessions().Informer()
c.bsQueue = queue.New(api_v1beta1.ResourceKindBackupSession, c.MaxNumRequeues, c.NumThreads, c.processBackupSession)
c.bsInformer.AddEventHandler(queue.NewFilteredHandler(cache.ResourceEventHandlerFuncs{
_, _ = c.bsInformer.AddEventHandler(queue.NewFilteredHandler(cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
if backupsession, ok := obj.(*api_v1beta1.BackupSession); ok && c.selectedByLabels(backupsession) {
queue.Enqueue(c.bsQueue.GetQueue(), backupsession)
Expand Down Expand Up @@ -294,7 +294,7 @@ func (c *BackupSessionController) electLeaderPod(targetInfo invoker.BackupTarget
EventRecorder: eventer.NewEventRecorder(c.K8sClient, BackupEventComponent),
}
resLock, err := resourcelock.New(
resourcelock.ConfigMapsLeasesResourceLock,
resourcelock.LeasesResourceLock,
c.Namespace,
util.GetBackupConfigmapLockName(targetInfo.Target.Ref),
c.K8sClient.CoreV1(),
Expand Down Expand Up @@ -353,7 +353,7 @@ func (c *BackupSessionController) electBackupLeader(backupSession *api_v1beta1.B
}

resLock, err := resourcelock.New(
resourcelock.ConfigMapsLeasesResourceLock,
resourcelock.LeasesResourceLock,
c.Namespace,
util.GetBackupConfigmapLockName(targetInfo.Target.Ref),
c.K8sClient.CoreV1(),
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmds/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package cmds

import (
"context"
"fmt"
"strings"
"time"
Expand Down Expand Up @@ -126,7 +127,7 @@ func NewCmdRestore() *cobra.Command {
}

func waitUntilAllPreviousTargetsExecuted(opt *restore.Options, tref v1beta1_api.TargetRef) error {
return wait.PollImmediate(5*time.Second, 30*time.Minute, func() (bool, error) {
return wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 30*time.Minute, true, func(ctx context.Context) (bool, error) {
klog.Infof("Waiting for all previous targets to complete their restore process...")
inv, err := invoker.NewRestoreInvoker(opt.KubeClient, opt.StashClient, opt.InvokerKind, opt.InvokerName, opt.Namespace)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/backup_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (c *StashController) initBackupConfigurationWatcher() {
if c.auditor != nil {
c.auditor.ForGVK(c.bcInformer, api_v1beta1.SchemeGroupVersion.WithKind(api_v1beta1.ResourceKindBackupConfiguration))
}
c.bcInformer.AddEventHandler(queue.NewEventHandler(c.bcQueue.GetQueue(), func(oldObj, newObj interface{}) bool {
_, _ = c.bcInformer.AddEventHandler(queue.NewEventHandler(c.bcQueue.GetQueue(), func(oldObj, newObj interface{}) bool {
bc := newObj.(*api_v1beta1.BackupConfiguration)
desiredPhase := invoker.CalculateBackupInvokerPhase(bc.Spec.Driver, bc.Status.Conditions)
return bc.GetDeletionTimestamp() != nil ||
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/backup_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *StashController) initBackupSessionWatcher() {
if c.auditor != nil {
c.auditor.ForGVK(c.backupSessionInformer, api_v1beta1.SchemeGroupVersion.WithKind(api_v1beta1.ResourceKindBackupSession))
}
c.backupSessionInformer.AddEventHandler(queue.DefaultEventHandler(c.backupSessionQueue.GetQueue(), core.NamespaceAll))
_, _ = c.backupSessionInformer.AddEventHandler(queue.DefaultEventHandler(c.backupSessionQueue.GetQueue(), core.NamespaceAll))
c.backupSessionLister = c.stashInformerFactory.Stash().V1beta1().BackupSessions().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/daemonsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c *StashController) NewDaemonSetWebhook() hooks.AdmissionHook {
func (c *StashController) initDaemonSetWatcher() {
c.dsInformer = c.kubeInformerFactory.Apps().V1().DaemonSets().Informer()
c.dsQueue = queue.New("DaemonSet", c.MaxNumRequeues, c.NumThreads, c.processDaemonSetEvent)
c.dsInformer.AddEventHandler(queue.DefaultEventHandler(c.dsQueue.GetQueue(), core.NamespaceAll))
_, _ = c.dsInformer.AddEventHandler(queue.DefaultEventHandler(c.dsQueue.GetQueue(), core.NamespaceAll))
c.dsLister = c.kubeInformerFactory.Apps().V1().DaemonSets().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c *StashController) NewDeploymentWebhook() hooks.AdmissionHook {
func (c *StashController) initDeploymentWatcher() {
c.dpInformer = c.kubeInformerFactory.Apps().V1().Deployments().Informer()
c.dpQueue = queue.New("Deployment", c.MaxNumRequeues, c.NumThreads, c.processDeploymentEvent)
c.dpInformer.AddEventHandler(queue.DefaultEventHandler(c.dpQueue.GetQueue(), core.NamespaceAll))
_, _ = c.dpInformer.AddEventHandler(queue.DefaultEventHandler(c.dpQueue.GetQueue(), core.NamespaceAll))
c.dpLister = c.kubeInformerFactory.Apps().V1().Deployments().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/deploymentconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *StashController) initDeploymentConfigWatcher() {
}
c.dcInformer = c.ocInformerFactory.Apps().V1().DeploymentConfigs().Informer()
c.dcQueue = queue.New(apis.KindDeploymentConfig, c.MaxNumRequeues, c.NumThreads, c.processDeploymentConfigEvent)
c.dcInformer.AddEventHandler(queue.DefaultEventHandler(c.dcQueue.GetQueue(), core.NamespaceAll))
_, _ = c.dcInformer.AddEventHandler(queue.DefaultEventHandler(c.dcQueue.GetQueue(), core.NamespaceAll))
c.dcLister = c.ocInformerFactory.Apps().V1().DeploymentConfigs().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c *StashController) initJobWatcher() {
)
})
c.jobQueue = queue.New("Job", c.MaxNumRequeues, c.NumThreads, c.runJobInjector)
c.jobInformer.AddEventHandler(queue.DefaultEventHandler(c.jobQueue.GetQueue(), core.NamespaceAll))
_, _ = c.jobInformer.AddEventHandler(queue.DefaultEventHandler(c.jobQueue.GetQueue(), core.NamespaceAll))
c.jobLister = c.kubeInformerFactory.Batch().V1().Jobs().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (c *StashController) initRepositoryWatcher() {
if c.auditor != nil {
c.auditor.ForGVK(c.repoInformer, api_v1alpha1.SchemeGroupVersion.WithKind(api_v1alpha1.ResourceKindRepository))
}
c.repoInformer.AddEventHandler(queue.NewReconcilableHandler(c.repoQueue.GetQueue(), core.NamespaceAll))
_, _ = c.repoInformer.AddEventHandler(queue.NewReconcilableHandler(c.repoQueue.GetQueue(), core.NamespaceAll))
c.repoLister = c.stashInformerFactory.Stash().V1alpha1().Repositories().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/restore_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (c *StashController) initRestoreSessionWatcher() {
if c.auditor != nil {
c.auditor.ForGVK(c.restoreSessionInformer, api_v1beta1.SchemeGroupVersion.WithKind(api_v1beta1.ResourceKindRestoreSession))
}
c.restoreSessionInformer.AddEventHandler(queue.DefaultEventHandler(c.restoreSessionQueue.GetQueue(), core.NamespaceAll))
_, _ = c.restoreSessionInformer.AddEventHandler(queue.DefaultEventHandler(c.restoreSessionQueue.GetQueue(), core.NamespaceAll))
c.restoreSessionLister = c.stashInformerFactory.Stash().V1beta1().RestoreSessions().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/statefulsets.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c *StashController) NewStatefulSetWebhook() hooks.AdmissionHook {
func (c *StashController) initStatefulSetWatcher() {
c.ssInformer = c.kubeInformerFactory.Apps().V1().StatefulSets().Informer()
c.ssQueue = queue.New("StatefulSet", c.MaxNumRequeues, c.NumThreads, c.processStatefulSetEvent)
c.ssInformer.AddEventHandler(queue.DefaultEventHandler(c.ssQueue.GetQueue(), core.NamespaceAll))
_, _ = c.ssInformer.AddEventHandler(queue.DefaultEventHandler(c.ssQueue.GetQueue(), core.NamespaceAll))
c.ssLister = c.kubeInformerFactory.Apps().V1().StatefulSets().Lister()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (opt *Options) electRestoreLeader(inv invoker.RestoreInvoker, targetInfo in
}

resLock, err := resourcelock.New(
resourcelock.ConfigMapsLeasesResourceLock,
resourcelock.LeasesResourceLock,
inv.GetObjectMeta().Namespace,
util.GetRestoreConfigmapLockName(targetInfo.Target.Ref),
opt.KubeClient.CoreV1(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (o *UpdateStatusOptions) updateRepositoryStatus(inv invoker.BackupInvoker,
}

func (o UpdateStatusOptions) waitUntilOtherHostsCompleted(backupSession *v1beta1.BackupSession, curTarget v1beta1.TargetRef, numCurHosts int) error {
return wait.PollImmediate(5*time.Second, 30*time.Minute, func() (done bool, err error) {
return wait.PollUntilContextTimeout(context.Background(), 5*time.Second, 30*time.Minute, true, func(ctx context.Context) (done bool, err error) {
klog.Infof("Waiting for all other targets/hosts to complete their backup.....")
newBackupSession, err := o.StashClient.StashV1beta1().BackupSessions(backupSession.Namespace).Get(context.TODO(), backupSession.Name, metav1.GetOptions{})
if err != nil {
Expand Down
20 changes: 10 additions & 10 deletions pkg/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,44 +238,44 @@ func DeleteAllConfigMapLocks(k8sClient kubernetes.Interface, namespace, name, ki
}

func WaitUntilDeploymentReady(c kubernetes.Interface, meta metav1.ObjectMeta) error {
return wait.PollImmediate(apis.RetryInterval, apis.ReadinessTimeout, func() (bool, error) {
if obj, err := c.AppsV1().Deployments(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), apis.RetryInterval, apis.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := c.AppsV1().Deployments(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
return pointer.Int32(obj.Spec.Replicas) == obj.Status.ReadyReplicas && obj.ObjectMeta.Generation == obj.Status.ObservedGeneration, nil
}
return false, nil
})
}

func WaitUntilDaemonSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error {
return wait.PollImmediate(apis.RetryInterval, apis.ReadinessTimeout, func() (bool, error) {
if obj, err := kubeClient.AppsV1().DaemonSets(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), apis.RetryInterval, apis.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := kubeClient.AppsV1().DaemonSets(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
return obj.Status.DesiredNumberScheduled == obj.Status.NumberReady && obj.ObjectMeta.Generation == obj.Status.ObservedGeneration, nil
}
return false, nil
})
}

func WaitUntilStatefulSetReady(kubeClient kubernetes.Interface, meta metav1.ObjectMeta) error {
return wait.PollImmediate(apis.RetryInterval, apis.ReadinessTimeout, func() (bool, error) {
if obj, err := kubeClient.AppsV1().StatefulSets(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), apis.RetryInterval, apis.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := kubeClient.AppsV1().StatefulSets(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
return pointer.Int32(obj.Spec.Replicas) == obj.Status.ReadyReplicas && obj.ObjectMeta.Generation == obj.Status.ObservedGeneration, nil
}
return false, nil
})
}

func WaitUntilDeploymentConfigReady(c oc_cs.Interface, meta metav1.ObjectMeta) error {
return wait.PollImmediate(apis.RetryInterval, apis.ReadinessTimeout, func() (bool, error) {
if obj, err := c.AppsV1().DeploymentConfigs(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), apis.RetryInterval, apis.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := c.AppsV1().DeploymentConfigs(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
return obj.Spec.Replicas == obj.Status.ReadyReplicas && obj.ObjectMeta.Generation == obj.Status.ObservedGeneration, nil
}
return false, nil
})
}

func WaitUntilPVCReady(c kubernetes.Interface, meta metav1.ObjectMeta) error {
return wait.PollImmediate(apis.RetryInterval, 2*time.Hour, func() (bool, error) {
if obj, err := c.CoreV1().PersistentVolumeClaims(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), apis.RetryInterval, 2*time.Hour, true, func(ctx context.Context) (bool, error) {
if obj, err := c.CoreV1().PersistentVolumeClaims(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
return obj.Status.Phase == core.ClaimBound, nil
}
return false, nil
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/daemonset.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func (f *Framework) EventuallyDaemonSet(meta metav1.ObjectMeta) GomegaAsyncAsser
}

func (fi *Invocation) WaitUntilDaemonSetReadyWithSidecar(meta metav1.ObjectMeta) error {
return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) {
if obj, err := fi.KubeClient.AppsV1().DaemonSets(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), kutil.RetryInterval, kutil.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := fi.KubeClient.AppsV1().DaemonSets(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
if obj.Status.DesiredNumberScheduled == obj.Status.NumberReady {
pods, err := fi.GetAllPods(obj.ObjectMeta)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/framework/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ func (f *Framework) EventuallyDeployment(meta metav1.ObjectMeta) GomegaAsyncAsse
}

func (fi *Invocation) WaitUntilDeploymentReadyWithSidecar(meta metav1.ObjectMeta) error {
return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) {
if obj, err := fi.KubeClient.AppsV1().Deployments(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), kutil.RetryInterval, kutil.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := fi.KubeClient.AppsV1().Deployments(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
if obj.Status.Replicas == obj.Status.ReadyReplicas {
pods, err := fi.GetAllPods(obj.ObjectMeta)
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion test/e2e/framework/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package framework

import (
"bytes"
"context"
"fmt"

core "k8s.io/api/core/v1"
Expand Down Expand Up @@ -48,7 +49,7 @@ func (f *Framework) ExecOnPod(pod *core.Pod, command ...string) (string, error)
return "", fmt.Errorf("failed to init executor: %v", err)
}

err = exec.Stream(remotecommand.StreamOptions{
err = exec.StreamWithContext(context.Background(), remotecommand.StreamOptions{
Stdout: &execOut,
Stderr: &execErr,
})
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/minio_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (f *Framework) PVCForMinioServer() core.PersistentVolumeClaim {
AccessModes: []core.PersistentVolumeAccessMode{
core.ReadWriteOnce,
},
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("1Gi"),
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (fi *Invocation) PersistentVolumeClaim(name string) *core.PersistentVolumeC
core.ReadWriteOnce,
},
StorageClassName: &fi.StorageClass,
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("10Mi"),
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework/rest_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (fi *Invocation) PVCForRestServer() core.PersistentVolumeClaim {
AccessModes: []core.PersistentVolumeAccessMode{
core.ReadWriteOnce,
},
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceName(core.ResourceStorage): resource.MustParse("2Gi"),
},
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/framework/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (fi *Invocation) StatefulSet(name, volName string, replica int32) apps.Stat
core.ReadWriteOnce,
},
StorageClassName: pointer.StringP(fi.StorageClass),
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("1Gi"),
},
Expand All @@ -110,8 +110,8 @@ func (f *Framework) EventuallyStatefulSet(meta metav1.ObjectMeta) GomegaAsyncAss
}

func (fi *Invocation) WaitUntilStatefulSetReadyWithSidecar(meta metav1.ObjectMeta) error {
return wait.PollImmediate(kutil.RetryInterval, kutil.ReadinessTimeout, func() (bool, error) {
if obj, err := fi.KubeClient.AppsV1().StatefulSets(meta.Namespace).Get(context.TODO(), meta.Name, metav1.GetOptions{}); err == nil {
return wait.PollUntilContextTimeout(context.Background(), kutil.RetryInterval, kutil.ReadinessTimeout, true, func(ctx context.Context) (bool, error) {
if obj, err := fi.KubeClient.AppsV1().StatefulSets(meta.Namespace).Get(ctx, meta.Name, metav1.GetOptions{}); err == nil {
if obj.Status.Replicas == obj.Status.ReadyReplicas {
pods, err := fi.GetAllPods(obj.ObjectMeta)
if err != nil {
Expand Down Expand Up @@ -245,7 +245,7 @@ func (fi *Invocation) DeployStatefulSetWithProbeClient(name string) (*apps.State
core.ReadWriteOnce,
},
StorageClassName: pointer.StringP(fi.StorageClass),
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("1Gi"),
},
Expand Down
10 changes: 5 additions & 5 deletions test/e2e/framework/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ func (f *Framework) ReadSampleDataFromFromWorkload(meta metav1.ObjectMeta, resou
}

func WaitUntilRepositoryDeleted(sc cs.Interface, repository *v1alpha1.Repository) error {
return wait.PollImmediate(PullInterval, WaitTimeOut, func() (done bool, err error) {
if _, err := sc.StashV1alpha1().Repositories(repository.Namespace).Get(context.TODO(), repository.Name, metav1.GetOptions{}); err != nil {
return wait.PollUntilContextTimeout(context.Background(), PullInterval, WaitTimeOut, true, func(ctx context.Context) (done bool, err error) {
if _, err := sc.StashV1alpha1().Repositories(repository.Namespace).Get(ctx, repository.Name, metav1.GetOptions{}); err != nil {
if kerr.IsNotFound(err) {
return true, nil
} else {
Expand Down Expand Up @@ -293,11 +293,11 @@ func (fi *Invocation) WaitUntilResourceDeleted(obj runtime.Object) error {
}

func (fi *Invocation) waitUntilResourceDeleted(gvr schema.GroupVersionResource, objMeta metav1.ObjectMeta) error {
return wait.PollImmediate(PullInterval, WaitTimeOut, func() (done bool, err error) {
return wait.PollUntilContextTimeout(context.Background(), PullInterval, WaitTimeOut, true, func(ctx context.Context) (done bool, err error) {
if gvr.Resource == v1beta1.ResourcePluralBackupBlueprint {
_, err = fi.dmClient.Resource(gvr).Get(context.TODO(), objMeta.Name, metav1.GetOptions{})
_, err = fi.dmClient.Resource(gvr).Get(ctx, objMeta.Name, metav1.GetOptions{})
} else {
_, err = fi.dmClient.Resource(gvr).Namespace(objMeta.Namespace).Get(context.TODO(), objMeta.Name, metav1.GetOptions{})
_, err = fi.dmClient.Resource(gvr).Namespace(objMeta.Namespace).Get(ctx, objMeta.Name, metav1.GetOptions{})
}
if err != nil {
if kerr.IsNotFound(err) {
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/misc/clone_pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = Describe("Clone", func() {
core.ReadWriteOnce,
},
StorageClassName: pointer.StringP(f.StorageClass),
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("10Mi"),
},
Expand Down Expand Up @@ -179,7 +179,7 @@ var _ = Describe("Clone", func() {
core.ReadWriteOnce,
},
StorageClassName: pointer.StringP(f.StorageClass),
Resources: core.ResourceRequirements{
Resources: core.VolumeResourceRequirements{
Requests: core.ResourceList{
core.ResourceStorage: resource.MustParse("10Mi"),
},
Expand Down
2 changes: 1 addition & 1 deletion vendor/cloud.google.com/go/compute/internal/version.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/Azure/azure-sdk-for-go/LICENSE.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading