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

Lowercase openapiv2 imports #741

Closed
mganta opened this issue Jan 31, 2020 · 25 comments
Closed

Lowercase openapiv2 imports #741

mganta opened this issue Jan 31, 2020 · 25 comments

Comments

@mganta
Copy link

mganta commented Jan 31, 2020

Build breaking changes due to google/gnostic#155

Need to update imports to github.com/googleapis/gnostic/openapiv2

Here is the error:
go get k8s.io/client-go/kubernetes
---> Running in 2aec6896da7e
package github.com/googleapis/gnostic/OpenAPIv2: cannot find package "github.com/googleapis/gnostic/OpenAPIv2"

@liggitt
Copy link
Member

liggitt commented Jan 31, 2020

Getting a specific version will make use of correct transitive versions. For example, go get k8s.io/client-go@v0.17.2

See the INSTALL.md in the repo root for details

@TUTUBIG
Copy link

TUTUBIG commented Mar 19, 2020

Getting a specific version will make use of correct transitive versions. For example, go get k8s.io/client-go@v0.17.2

See the INSTALL.md in the repo root for details

failed again and correct solution is to use a special version of github.com/googleapis/gnostic,such as v0.3.1

mkoertgen added a commit to mkoertgen/hello.aks that referenced this issue Mar 22, 2020
@nyetwurk
Copy link

Getting a specific version will make use of correct transitive versions. For example, go get k8s.io/client-go@v0.17.2

This does not work.

$ go get k8s.io/client-go@v0.17.2 ./...
go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
go: finding module for package github.com/googleapis/gnostic/OpenAPIv2
../../go/pkg/mod/k8s.io/client-go@v0.17.2/discovery/discovery_client.go:29:2: module github.com/googleapis/gnostic@latest found (v0.4.1), but does not contain package github.com/googleapis/gnostic/OpenAPIv2

@liggitt
Copy link
Member

liggitt commented Mar 24, 2020

try go get k8s.io/client-go@v0.17.2 alone

to see what else in your build is requiring a newer version of github.com/googleapis/gnostic, run:

go mod graph | grep github.com/googleapis/gnostic

@nyetwurk
Copy link

nyetwurk commented Mar 24, 2020

Had to do both at the same time

go get -u k8s.io/client-go@v0.17.2 github.com/googleapis/gnostic@v0.3.1 ./...

since another module depends on gnostic.

When will upstream be fixed?

@kubilesti
Copy link

kubilesti commented Mar 26, 2020

Same issue here. This is breaking my whole testing suite.

@nyetwurk
Copy link

Please update at least one of the semver client-go versions i can reference (not master), TIA :)

@liggitt
Copy link
Member

liggitt commented Mar 31, 2020

Existing client-go versions will not be updated. Updating this dependency is being looked at in kubernetes/kubernetes#89704 and kubernetes/kube-openapi#189, targeting Kubernetes 1.19.

branden added a commit to mesosphere/kubernetes-base-addons that referenced this issue Apr 21, 2020
branden added a commit to mesosphere/kubernetes-base-addons that referenced this issue Apr 21, 2020
branden added a commit to mesosphere/kubernetes-base-addons that referenced this issue Apr 21, 2020
jan-eat added a commit to jan-eat/terraform-provider-kubernetes-alpha that referenced this issue Jun 4, 2020
kubernetes/client-go#741
Can upgrade to 0.4.2 once kubernetes 1.19 is released.
alexsomesan added a commit to hashicorp/terraform-provider-kubernetes-alpha that referenced this issue Jun 11, 2020
* downgraded gnostic to 0.4.0 due to this issue:
kubernetes/client-go#741
Can upgrade to 0.4.2 once kubernetes 1.19 is released.

* adding auth plugin to clients.go

inspired by kubernetes/client-go#242

appears to resolve #46

probably also fixes #54

Co-authored-by: Alex Somesan <alex.somesan@gmail.com>
@vishutrilio
Copy link

Had to do both at the same time

go get -u k8s.io/client-go@v0.17.2 github.com/googleapis/gnostic@v0.3.1 ./...

since another module depends on gnostic.

When will upstream be fixed?

Thank you so much

@InfluencerNGZK
Copy link

Had to do both at the same time

go get -u k8s.io/client-go@v0.17.2 github.com/googleapis/gnostic@v0.3.1 ./...

since another module depends on gnostic.

When will upstream be fixed?

Same issue here but only happens on ubuntu. On windows github.com/googleapis/gnostic@v0.5.1 is fine.

@najork
Copy link

najork commented Feb 2, 2021

For those of you developing on macOS (or any other case-insensitive filesystem), I had to do the following in order for git to properly detect the filename change:

  1. Upgrade the client-go dependency to v0.19.x+
  2. rm -rf vendor/github.com/googleapis/gnostic and create an intermediate commit
  3. Rerun go mod vendor to retrieve the files and create a new commit

@nobody4t
Copy link

nobody4t commented Feb 3, 2021

I have to use replace to get a compatible version and it works.

@lboix
Copy link

lboix commented Mar 25, 2021

Using Kubernetes 1.14, here is the workaround my team and I found to fix this.

In your go.mod file, use:

k8s.io/api kubernetes-1.14.0
k8s.io/apimachinery kubernetes-1.14.0
k8s.io/client-go kubernetes-1.14.0

Then run:

go mod tidy
go mod vendor

And version / commit your /vendor folder (build was unable to pass on our Gitlab runner without this).

We are planning to migrate to Kubernetes 1.19 soon. We will be able after that to use the up-to-date Go client version and remove the /vendor folder, I will let you know.

Hope it helps, have a great day!

@ReOneK
Copy link

ReOneK commented Jun 8, 2021

Had to do both at the same time

go get -u k8s.io/client-go@v0.17.2 github.com/googleapis/gnostic@v0.3.1 ./...

since another module depends on gnostic.

When will upstream be fixed?

Good job!

@wdma
Copy link

wdma commented Jun 21, 2021

This solution did not work for me (versions updated to reflect mine)

go get -u k8s.io/client-go@v0.21.2 github.com/googleapis/gnostic@v0.4.1 ./...

I also tried this suggestion and failed (again, versions are updated to reflect my system)

In your go.mod file, use:

k8s.io/api kubernetes-1.21.2
k8s.io/apimachinery kubernetes-1.21.2
k8s.io/client-go kubernetes-1.21.2

I think I am missing something. I have basic Go skills, and this error has taken days of my time. Please help!

bobcatfish added a commit to bobcatfish/experimental that referenced this issue Jul 21, 2021
Building the custom task on my mac was working just fine but once we
started to build it with CI it failed with
`no required module provides package github.com/googleapis/gnostic/OpenAPIv2`

Turns out this is a known issue:
kubernetes/client-go#741

Kinda at a loss as to why other custom tasks aren't running into this
and my understanding of go mod is so shallow that I feel like I'm
writing with a crayon to fix this (nothing against crayons, they make
cool marks) - but anyway I tried to copy what the pipeline go.mod had
done since I think that's where the original version came from anyway
https://github.com/tektoncd/pipeline/blob/main/go.mod
bobcatfish added a commit to bobcatfish/experimental that referenced this issue Aug 13, 2021
Building the custom task on my mac was working just fine but once we
started to build it with CI it failed with
`no required module provides package github.com/googleapis/gnostic/OpenAPIv2`

Turns out this is a known issue:
kubernetes/client-go#741

Kinda at a loss as to why other custom tasks aren't running into this
and my understanding of go mod is so shallow that I feel like I'm
writing with a crayon to fix this (nothing against crayons, they make
cool marks) - but anyway I tried to copy what the pipeline go.mod had
done since I think that's where the original version came from anyway
https://github.com/tektoncd/pipeline/blob/main/go.mod
bobcatfish added a commit to bobcatfish/experimental that referenced this issue Aug 27, 2021
Building the custom task on my mac was working just fine but once we
started to build it with CI it failed with
`no required module provides package github.com/googleapis/gnostic/OpenAPIv2`

Turns out this is a known issue:
kubernetes/client-go#741

Kinda at a loss as to why other custom tasks aren't running into this
and my understanding of go mod is so shallow that I feel like I'm
writing with a crayon to fix this (nothing against crayons, they make
cool marks) - but anyway I tried to copy what the pipeline go.mod had
done since I think that's where the original version came from anyway
https://github.com/tektoncd/pipeline/blob/main/go.mod
bobcatfish added a commit to bobcatfish/experimental that referenced this issue Sep 2, 2021
Building the custom task on my mac was working just fine but once we
started to build it with CI it failed with
`no required module provides package github.com/googleapis/gnostic/OpenAPIv2`

Turns out this is a known issue:
kubernetes/client-go#741

Kinda at a loss as to why other custom tasks aren't running into this
and my understanding of go mod is so shallow that I feel like I'm
writing with a crayon to fix this (nothing against crayons, they make
cool marks) - but anyway I tried to copy what the pipeline go.mod had
done since I think that's where the original version came from anyway
https://github.com/tektoncd/pipeline/blob/main/go.mod
tekton-robot pushed a commit to tektoncd/experimental that referenced this issue Sep 2, 2021
Building the custom task on my mac was working just fine but once we
started to build it with CI it failed with
`no required module provides package github.com/googleapis/gnostic/OpenAPIv2`

Turns out this is a known issue:
kubernetes/client-go#741

Kinda at a loss as to why other custom tasks aren't running into this
and my understanding of go mod is so shallow that I feel like I'm
writing with a crayon to fix this (nothing against crayons, they make
cool marks) - but anyway I tried to copy what the pipeline go.mod had
done since I think that's where the original version came from anyway
https://github.com/tektoncd/pipeline/blob/main/go.mod
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

No branches or pull requests