Thanks to visit codestin.com
Credit goes to github.com

Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contrib/test/integration/build/kubetest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
repo: "https://github.com/kubernetes/test-infra.git"
dest: "{{ ansible_env.GOPATH }}/src/k8s.io/test-infra"
force: "{{ force_clone | default(False) | bool}}"
version: "6d62b1c6482b598125bc9659de817daaa47aaab3"

# per https://github.com/kubernetes/test-infra/issues/14070 we need to download
# kubetest with go module 1.11 on and without -u. As of the time of writing this,
Expand Down
4 changes: 2 additions & 2 deletions contrib/test/integration/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
- name: clone build and install kubernetes for cgroup v2
include: "build/kubernetes.yml"
vars:
k8s_git_version: "master"
k8s_git_version: "release-1.19"
k8s_github_fork: "kubernetes"
crio_socket: "/var/run/crio/crio.sock"
when: "cgroupv2 | bool"
Expand Down Expand Up @@ -197,7 +197,7 @@
include: "build/kubernetes.yml"
vars:
force_clone: true
k8s_git_version: "master"
k8s_git_version: "release-1.19"
k8s_github_fork: "kubernetes"
crio_socket: "/var/run/crio/crio.sock"
when: "cgroupv2 | bool"
Expand Down
7 changes: 3 additions & 4 deletions internal/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ func (r *Runtime) WaitContainerStateStopped(ctx context.Context, c *Container) e
return nil
}

done := make(chan error)
chControl := make(chan struct{})
done := make(chan error, 1)
chControl := make(chan struct{}, 1)
defer close(chControl)
go func() {
defer close(done)
for {
Expand All @@ -141,10 +142,8 @@ func (r *Runtime) WaitContainerStateStopped(ctx context.Context, c *Container) e
case err = <-done:
break
case <-ctx.Done():
close(chControl)
return ctx.Err()
case <-time.After(time.Duration(r.config.CtrStopTimeout) * time.Second):
close(chControl)
return fmt.Errorf(
"failed to get container stopped status: %ds timeout reached",
r.config.CtrStopTimeout,
Expand Down