GOLANG TEST IS FAILING WITH "spdy.go:45:54: too many arguments in call to spdy.NewRoundTripperWithProxy" WITH k8s.io/apimachinery v0.24.x
dineshputchala opened this issue · 3 comments
Issue: Terratest code fails with "../go/pkg/mod/k8s.io/client-go@v0.20.6/transport/spdy/spdy.go:45:54: too many arguments in call to spdy.NewRoundTripperWithProxy"
cat checknodes_test.go
package test
import (
"testing"
"fmt"
"github.com/gruntwork-io/terratest/modules/k8s"
"github.com/stretchr/testify/require"
)
func TestCheckNodes(t *testing.T) {
options := k8s.NewKubectlOptions("", "", "default")
nodes := k8s.GetNodes(t, options)
require.Equal(t, len(nodes), 4)
}
$ go mod init checknodes_test.go
go: creating new go.mod: module checknodes_test.go
go: to add module requirements and sums:
go mod tidy
$go mod tidy
go: finding module for package github.com/stretchr/testify/require
go: finding module for package github.com/gruntwork-io/terratest/modules/k8s
go: downloading github.com/stretchr/testify v1.7.1
go: finding module for package k8s.io/apimachinery/pkg/apis/meta/v1
go: downloading github.com/gruntwork-io/terratest v0.40.12
go: downloading k8s.io/apimachinery v0.24.1
go: found github.com/gruntwork-io/terratest/modules/k8s in github.com/gruntwork-io/terratest v0.40.12
go: found github.com/stretchr/testify/require in github.com/stretchr/testify v1.7.1
go: found k8s.io/apimachinery/pkg/apis/meta/v1 in k8s.io/apimachinery v0.24.1
go: downloading github.com/gruntwork-io/go-commons v0.8.0
go: downloading github.com/mitchellh/go-homedir v1.1.0
go: downloading k8s.io/api v0.20.6
go: downloading k8s.io/client-go v0.20.6
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading github.com/google/gofuzz v1.1.0
go: downloading sigs.k8s.io/yaml v1.2.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading github.com/aws/aws-sdk-go v1.40.56
go: downloading github.com/go-sql-driver/mysql v1.4.1
go: downloading github.com/google/uuid v1.2.0
go: downloading github.com/hashicorp/go-multierror v1.1.0
go: downloading github.com/pquerna/otp v1.2.0
go: downloading github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326
go: downloading golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
go: downloading github.com/go-errors/errors v1.0.2-0.20180813162953-d98b870cc4e0
go: downloading github.com/urfave/cli v1.22.2
go: downloading golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c
go: downloading k8s.io/klog/v2 v2.60.1
go: downloading github.com/imdario/mergo v0.3.11
go: downloading github.com/spf13/pflag v1.0.5
go: downloading golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a
go: downloading github.com/google/go-cmp v0.5.7
go: downloading gopkg.in/inf.v0 v0.9.1
go: downloading k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
go: downloading sigs.k8s.io/structured-merge-diff/v4 v4.2.1
go: downloading sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
go: downloading google.golang.org/appengine v1.6.7
go: downloading github.com/hashicorp/errwrap v1.0.0
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading cloud.google.com/go v0.83.0
go: downloading github.com/golang/protobuf v1.5.2
go: downloading github.com/googleapis/gnostic v0.4.1
go: downloading golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e
go: downloading github.com/go-logr/logr v1.2.0
go: downloading github.com/moby/spdystream v0.2.0
go: downloading github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5
go: downloading github.com/elazarl/goproxy v0.0.0-20190911111923-ecfe977594f1
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading github.com/json-iterator/go v1.1.12
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e
go: downloading github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc
go: downloading github.com/russross/blackfriday/v2 v2.1.0
go: downloading google.golang.org/protobuf v1.27.1
go: downloading golang.org/x/text v0.3.7
go: downloading golang.org/x/sys v0.0.0-20220209214540-3681064d5158
go: downloading github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
go: downloading github.com/modern-go/reflect2 v1.0.2
go: downloading github.com/kr/text v0.2.0
go: downloading github.com/jmespath/go-jmespath/internal/testify v1.5.1
$ go test checknodes_test.go -v
k8s.io/client-go/transport/spdy
../go/pkg/mod/k8s.io/client-go@v0.20.6/transport/spdy/spdy.go:45:54: too many arguments in call to spdy.NewRoundTripperWithProxy
have (*tls.Config, bool, bool, func(*http.Request) (*url.URL, error))
want (*tls.Config, func(*http.Request) (*url.URL, error))
FAIL command-line-arguments [build failed]
FAIL
Versions used:
$ go version
go version go1.18.2 linux/amd64
Experiencing the same exact issue, was working fine for months until May 8th and couldn't find a solution besides removing the "k8s.io/apimachinery/pkg/apis/meta/v1" import (and any code that uses it).
Also found this, but no solution too...
This issue is observed when golang test uses k8s.io/apimachinery v0.24.2 , not observed when using k8s.io/apimachinery v0.23.8
Issue observed:
go version go1.18.3 linux/amd64
github.com/gruntwork-io/terratest v0.40.17
github.com/stretchr/testify v1.7.4
k8s.io/apimachinery v0.24.2
Issue NOT observed:
go version go1.18.3 linux/amd64
github.com/gruntwork-io/terratest v0.40.17
github.com/stretchr/testify v1.7.4
k8s.io/apimachinery v0.23.8
Please check this issue !
solution in gruntwork-io/terratest#1134 works !