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

GO111MODULE=on go get -u github.com/google/ko/cmd/ko can't find OpenAPIv2 #252

Closed
devingenx opened this issue Nov 25, 2020 · 6 comments · Fixed by #276
Closed

GO111MODULE=on go get -u github.com/google/ko/cmd/ko can't find OpenAPIv2 #252

devingenx opened this issue Nov 25, 2020 · 6 comments · Fixed by #276

Comments

@devingenx
Copy link

Go Version

~ >>> go version          
go version go1.15.5 linux/amd64

Go env

~ >>> go env  
GO111MODULE=""
GOARCH="amd64"
GOBIN="/usr/local/go/bin"
GOCACHE="/home/sascha/.cache/go-build"
GOENV="/home/sascha/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/sascha/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/sascha/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build790797265=/tmp/go-build -gno-record-gcc-switches"

What did I do?

~ >>> sudo GO111MODULE=on go get -u github.com/google/ko/cmd/ko
go: found github.com/google/ko/cmd/ko in github.com/google/ko v0.6.2
go: golang.org/x/mod upgrade => v0.3.0
go: google.golang.org/grpc upgrade => v1.33.2
go: golang.org/x/tools upgrade => v0.0.0-20201124202034-299f270db459
go: google.golang.org/genproto upgrade => v0.0.0-20201119123407-9b1e624d6bc4
go: golang.org/x/oauth2 upgrade => v0.0.0-20201109201403-9fd604954f58
go: golang.org/x/sys upgrade => v0.0.0-20201119102817-f84b799fce68
go: github.com/google/go-containerregistry upgrade => v0.1.4
go: golang.org/x/net upgrade => v0.0.0-20201110031124-69a78807bb2b
go: golang.org/x/xerrors upgrade => v0.0.0-20200804184101-5ec99f83aff1
go: github.com/go-openapi/jsonpointer upgrade => v0.19.5
go: github.com/alessio/shellescape upgrade => v1.4.1
go: golang.org/x/sync upgrade => v0.0.0-20201020160332-67f06af15bc9
go: github.com/golang/protobuf upgrade => v1.4.3
go: golang.org/x/text upgrade => v0.3.4
go: github.com/opencontainers/go-digest upgrade => v1.0.0
go: gopkg.in/yaml.v2 upgrade => v2.4.0
go: github.com/pelletier/go-toml upgrade => v1.8.1
go: google.golang.org/protobuf upgrade => v1.25.0
go: k8s.io/klog upgrade => v1.0.0
go: k8s.io/api upgrade => v0.19.4
go: github.com/spf13/pflag upgrade => v1.0.5
go: github.com/fsnotify/fsnotify upgrade => v1.4.9
go: github.com/imdario/mergo upgrade => v0.3.11
go: k8s.io/kube-openapi upgrade => v0.0.0-20201113171705-d219536bb9fd
go: golang.org/x/crypto upgrade => v0.0.0-20201124201722-c8d3bf9c5392
go: github.com/containerd/containerd upgrade => v1.4.1
go: github.com/magiconair/properties upgrade => v1.8.4
go: google.golang.org/appengine upgrade => v1.6.7
go: github.com/mailru/easyjson upgrade => v0.7.6
go: sigs.k8s.io/structured-merge-diff/v3 upgrade => v3.0.0
go: github.com/go-openapi/spec upgrade => v0.19.14
go: github.com/googleapis/gnostic upgrade => v0.5.3
go: github.com/json-iterator/go upgrade => v1.1.10
go: sigs.k8s.io/yaml upgrade => v1.2.0
go: sigs.k8s.io/kind upgrade => v0.9.0
go: github.com/go-openapi/jsonreference upgrade => v0.19.5
go: github.com/docker/cli upgrade => v20.10.0-rc1+incompatible
go: github.com/gogo/protobuf upgrade => v1.3.1
go: github.com/mattn/go-isatty upgrade => v0.0.12
go: github.com/PuerkitoBio/urlesc upgrade => v0.0.0-20170810143723-de5bf2ad4578
go: github.com/evanphx/json-patch/v5 upgrade => v5.1.0
go: github.com/spf13/cast upgrade => v1.3.1
go: github.com/davecgh/go-spew upgrade => v1.1.1
go: github.com/emicklei/go-restful upgrade => v2.15.0+incompatible
go: github.com/spf13/viper upgrade => v1.7.1
go: github.com/go-openapi/swag upgrade => v0.19.12
go: github.com/ghodss/yaml upgrade => v1.0.0
go: github.com/konsorten/go-windows-terminal-sequences upgrade => v1.0.3
go: github.com/spf13/jwalterweatherman upgrade => v1.1.0
go: github.com/mitchellh/mapstructure upgrade => v1.3.3
go: github.com/gregjones/httpcache upgrade => v0.0.0-20190611155906-901d90724c79
go: github.com/spf13/cobra upgrade => v1.1.1
go: github.com/sirupsen/logrus upgrade => v1.7.0
go: github.com/google/btree upgrade => v1.0.0
go: github.com/google/gofuzz upgrade => v1.2.0
go: github.com/spf13/afero upgrade => v1.4.1
go: github.com/modern-go/concurrent upgrade => v0.0.0-20180306012644-bacd9c7ef1dd
go: k8s.io/client-go upgrade => v11.0.0+incompatible
go: golang.org/x/time upgrade => v0.0.0-20200630173020-3af7569d3a1e
go: github.com/modern-go/reflect2 upgrade => v1.0.1
go: github.com/pkg/errors upgrade => v0.9.1
go: k8s.io/apimachinery upgrade => v0.19.4
go: k8s.io/cli-runtime upgrade => v0.19.4
go: github.com/Microsoft/go-winio upgrade => v0.4.15
go: k8s.io/utils upgrade => v0.0.0-20201110183641-67b214c5f920
go: github.com/PuerkitoBio/purell upgrade => v1.1.1
go: github.com/evanphx/json-patch upgrade => v4.9.0+incompatible
go: gopkg.in/yaml.v3 upgrade => v3.0.0-20200615113413-eeeca48fe776
go: finding module for package k8s.io/api/auditregistration/v1alpha1
go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
go: github.com/go-logr/logr upgrade => v0.3.0
go: sigs.k8s.io/structured-merge-diff/v4 upgrade => v4.0.2
go: gopkg.in/ini.v1 upgrade => v1.62.0
go: k8s.io/klog/v2 upgrade => v2.4.0
go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
go: finding module for package k8s.io/api/auditregistration/v1alpha1
go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
go: finding module for package k8s.io/api/auditregistration/v1alpha1
/root/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/discovery/discovery_client.go:29:2: module github.com/googleapis/gnostic@latest found (v0.5.3), but does not contain package github.com/googleapis/gnostic/OpenAPIv2
/root/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/kubernetes/scheme/register.go:26:2: module k8s.io/api@latest found (v0.19.4), but does not contain package k8s.io/api/auditregistration/v1alpha1

I tried replacing gnostic v0.5.3 with gnostic v0.4.0 in go.mod with

~ >>> cat go.mod
module github.com/google/ko

go 1.14

require (
	github.com/Microsoft/go-winio v0.4.15 // indirect
	github.com/alessio/shellescape v1.4.1 // indirect
	github.com/containerd/containerd v1.4.1 // indirect
	github.com/docker/cli v20.10.0-rc1+incompatible // indirect
	github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7
	github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960
	github.com/emicklei/go-restful v2.15.0+incompatible // indirect
	github.com/evanphx/json-patch v4.9.0+incompatible // indirect
	github.com/fsnotify/fsnotify v1.4.9
	github.com/go-openapi/jsonpointer v0.19.5 // indirect
	github.com/go-openapi/jsonreference v0.19.5 // indirect
	github.com/go-openapi/spec v0.19.14 // indirect
	github.com/go-openapi/swag v0.19.12 // indirect
	github.com/go-training/helloworld v0.0.0-20200225145412-ba5f4379d78b
	github.com/golang/protobuf v1.4.3 // indirect
	github.com/google/go-cmp v0.5.1
	github.com/google/go-containerregistry v0.1.4
	github.com/google/gofuzz v1.2.0 // indirect
	github.com/googleapis/gnostic v0.5.3 // indirect
	github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
	github.com/imdario/mergo v0.3.11 // indirect
	github.com/json-iterator/go v1.1.10 // indirect
	github.com/magiconair/properties v1.8.4 // indirect
	github.com/mattmoor/dep-notify v0.0.0-20190205035814-a45dec370a17
	github.com/mitchellh/mapstructure v1.3.3 // indirect
	github.com/opencontainers/go-digest v1.0.0 // indirect
	github.com/pelletier/go-toml v1.8.1 // indirect
	github.com/sirupsen/logrus v1.7.0 // indirect
	github.com/spf13/afero v1.4.1 // indirect
	github.com/spf13/cast v1.3.1 // indirect
	github.com/spf13/cobra v1.1.1
	github.com/spf13/jwalterweatherman v1.1.0 // indirect
	github.com/spf13/pflag v1.0.5
	github.com/spf13/viper v1.7.1
	golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirect
	golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect
	golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 // indirect
	golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
	golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
	golang.org/x/text v0.3.4 // indirect
	golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
	golang.org/x/tools v0.0.0-20201124202034-299f270db459
	google.golang.org/appengine v1.6.7 // indirect
	google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 // indirect
	google.golang.org/grpc v1.33.2 // indirect
	gopkg.in/ini.v1 v1.62.0 // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
	gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776
	gotest.tools/v3 v3.0.2 // indirect
	honnef.co/go/tools v0.0.1-2020.1.5 // indirect
	k8s.io/api v0.19.4 // indirect
	k8s.io/apimachinery v0.19.4
	k8s.io/cli-runtime v0.19.4
	k8s.io/client-go v1.5.1 // indirect
	k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd // indirect
	k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
	sigs.k8s.io/kind v0.9.0
	sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 // indirect
)

replace (
	github.com/googleapis/gnostic v0.5.3 => github.com/googleapis/gnostic v0.4.0
	k8s.io/api => k8s.io/api v0.18.8
	k8s.io/apimachinery => k8s.io/apimachinery v0.18.8
	k8s.io/cli-runtime => k8s.io/cli-runtime v0.18.8
	k8s.io/client-go => k8s.io/client-go v0.18.8
)

and got the same output as above, except the last two lines:

/root/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/discovery/discovery_client.go:29:2: module github.com/googleapis/gnostic@latest found (v0.5.3), but does not contain package github.com/googleapis/gnostic/OpenAPIv2
/root/go/pkg/mod/k8s.io/client-go@v11.0.0+incompatible/kubernetes/scheme/register.go:26:2: module k8s.io/api@latest found (v0.19.4), but does not contain package k8s.io/api/auditregistration/v1alpha1
@jonjohnsonjr
Copy link
Collaborator

Yeah... the capitalization changing here broke a lot of stuff. I know @nkubala has successfully unbroken this somewhat recently. What do we need to do?

@danielfbm
Copy link

any updates?

@nkubala
Copy link

nkubala commented Dec 14, 2020

sorry lost track of this one. v0.4.1 of gnostic addressed their issues with capitalization of openapiv2, which was picked up in client-go@v0.19.4. if you bump to those versions in your go.mod, this should* be fixed. I did this in skaffold in GoogleContainerTools/skaffold#5038 and it worked 🤷

* disclaimer: I didn't try any of this in your codebase, so if it doesn't work I'm sorry.

@jonjohnsonjr
Copy link
Collaborator

@nkubala is there something we can do in ko to help with this?

@nkubala
Copy link

nkubala commented Dec 16, 2020

@jonjohnsonjr I think you just want to do the same dependency pinning I did in the PR I linked?

@jonjohnsonjr
Copy link
Collaborator

@devingenx or @danielfbm if you can confirm that pinning that dep fixes your issue and have time, feel free to send a PR. I'm not running into this, so I'd have trouble actually knowing if the fix worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants