Skip to content

Commit

Permalink
Remove waitForPodReady check from PodRunner (#5427)
Browse files Browse the repository at this point in the history
* Remove waitForPodReady out of PodRunner

* Add waitForPodReady to copy_volume_data
  • Loading branch information
DeepikaDixit authored and Ilya Kislenko committed Apr 17, 2019
1 parent ac72e67 commit cfc4885
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pkg/function/copy_volume_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ func copyVolumeData(ctx context.Context, cli kubernetes.Interface, tp param.Temp

func copyVolumeDataPodFunc(cli kubernetes.Interface, tp param.TemplateParams, namespace, mountPoint, targetPath, encryptionKey string) func(ctx context.Context, pod *v1.Pod) (map[string]interface{}, error) {
return func(ctx context.Context, pod *v1.Pod) (map[string]interface{}, error) {
// Wait for pod to reach running state
if err := kube.WaitForPodReady(ctx, cli, pod.Namespace, pod.Name); err != nil {
return nil, errors.Wrapf(err, "Failed while waiting for Pod %s to be ready", pod.Name)
}
// Get restic repository
if err := restic.GetOrCreateRepository(cli, namespace, pod.Name, pod.Spec.Containers[0].Name, targetPath, encryptionKey, tp.Profile); err != nil {
return nil, err
Expand Down
4 changes: 0 additions & 4 deletions pkg/kube/pod_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,5 @@ func (p *PodRunner) Run(ctx context.Context, fn func(context.Context, *v1.Pod) (
defer DeletePod(context.Background(), p.cli, pod)
}
}()
// Wait for pod to reach running state
if err := WaitForPodReady(ctx, p.cli, pod.Namespace, pod.Name); err != nil {
return nil, errors.Wrapf(err, "Failed while waiting for Pod %s to be ready", pod.Name)
}
return fn(ctx, pod)
}

0 comments on commit cfc4885

Please sign in to comment.