Skip to content

Commit

Permalink
fix: docker client fix (#2681)
Browse files Browse the repository at this point in the history
  • Loading branch information
SandhyaRavi2403 authored Oct 1, 2024
1 parent 96d9682 commit 5fae158
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apptests/kind/kind.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"

"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"sigs.k8s.io/kind/pkg/cluster"
"sigs.k8s.io/kind/pkg/cmd"
Expand Down Expand Up @@ -98,14 +99,14 @@ func (c *Cluster) RunScript(ctx context.Context, nodeName, script string) error
default:
}

apiClient, err := client.NewClientWithOpts(client.FromEnv)
apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
return err
}
defer apiClient.Close()

rst, err := apiClient.ContainerExecCreate(context.Background(), nodeName,
types.ExecConfig{
container.ExecOptions{
AttachStdout: true,
AttachStderr: true,
Cmd: []string{script},
Expand Down

0 comments on commit 5fae158

Please sign in to comment.