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

Importing "sigs.k8s.io/e2e-framework/klient/conf" causes: k8s.io/api/flowcontrol/v1alpha1: module k8s.io/api@latest found (v0.29.3), but does not contain package k8s.io/api/flowcontrol/v1alpha1 #399

Open
pmalek opened this issue Apr 16, 2024 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pmalek
Copy link
Contributor

pmalek commented Apr 16, 2024

Problem statement

Trying to import sigs.k8s.io/e2e-framework/klient/conf fails with the following message:

go mod tidy
go: finding module for package k8s.io/api/flowcontrol/v1alpha1
go: e2e-framework-bug-352 tested by
        e2e-framework-bug-352.test imports
        sigs.k8s.io/e2e-framework/klient/conf imports
        k8s.io/client-go/rest tested by
        k8s.io/client-go/rest.test imports
        k8s.io/client-go/kubernetes/scheme imports
        k8s.io/api/flowcontrol/v1alpha1: module k8s.io/api@latest found (v0.29.3), but does not contain package k8s.io/api/flowcontrol/v1alpha1

This seems to be caused by https://pkg.go.dev/k8s.io/api@v0.29.3/flowcontrol now having v1alpha1 package anymore.

Not sure why there's a problem though since https://github.com/kubernetes/client-go/tree/v0.29.3/rest doesn't seem to import flowcontrol v1alpha1 🤔

How to reproduce:

package main

import (
	"testing"

	_ "sigs.k8s.io/e2e-framework/klient/conf"
)

func TestX(m *testing.T) {
}

go.mod

module e2e-framework-bug-352

go 1.22.2

require (
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/go-logr/logr v1.3.0 // indirect
	github.com/gogo/protobuf v1.3.2 // indirect
	github.com/golang/protobuf v1.5.4 // indirect
	github.com/google/gofuzz v1.2.0 // indirect
	github.com/imdario/mergo v0.3.15 // indirect
	github.com/json-iterator/go v1.1.12 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.2 // indirect
	github.com/spf13/pflag v1.0.5 // indirect
	golang.org/x/net v0.19.0 // indirect
	golang.org/x/oauth2 v0.7.0 // indirect
	golang.org/x/sys v0.15.0 // indirect
	golang.org/x/term v0.15.0 // indirect
	golang.org/x/text v0.14.0 // indirect
	golang.org/x/time v0.3.0 // indirect
	google.golang.org/appengine v1.6.7 // indirect
	google.golang.org/protobuf v1.33.0 // indirect
	gopkg.in/inf.v0 v0.9.1 // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
	k8s.io/api v0.29.3 // indirect
	k8s.io/apimachinery v0.29.3 // indirect
	k8s.io/client-go v0.27.4 // indirect
	k8s.io/klog/v2 v2.110.1 // indirect
	k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
	sigs.k8s.io/e2e-framework v0.3.0 // indirect
	sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
	sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
	sigs.k8s.io/yaml v1.3.0 // indirect
)

Workaround

replace k8s.io/api => k8s.io/api v0.28.8
@pmalek
Copy link
Contributor Author

pmalek commented Apr 16, 2024

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2024
@harshanarayana
Copy link
Contributor

@pmalek

module stuff

go 1.21.6

require sigs.k8s.io/e2e-framework v0.3.0

require (
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/go-logr/logr v1.2.4 // indirect
	github.com/gogo/protobuf v1.3.2 // indirect
	github.com/golang/protobuf v1.5.3 // indirect
	github.com/google/gofuzz v1.2.0 // indirect
	github.com/imdario/mergo v0.3.15 // indirect
	github.com/json-iterator/go v1.1.12 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.2 // indirect
	github.com/spf13/pflag v1.0.5 // indirect
	golang.org/x/net v0.10.0 // indirect
	golang.org/x/oauth2 v0.7.0 // indirect
	golang.org/x/sys v0.8.0 // indirect
	golang.org/x/term v0.8.0 // indirect
	golang.org/x/text v0.9.0 // indirect
	golang.org/x/time v0.3.0 // indirect
	google.golang.org/appengine v1.6.7 // indirect
	google.golang.org/protobuf v1.30.0 // indirect
	gopkg.in/inf.v0 v0.9.1 // indirect
	gopkg.in/yaml.v2 v2.4.0 // indirect
	k8s.io/apimachinery v0.27.4 // indirect
	k8s.io/client-go v0.27.4 // indirect
	k8s.io/klog/v2 v2.100.1 // indirect
	k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
	sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
	sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
	sigs.k8s.io/yaml v1.3.0 // indirect
)
package main

import (
	"os"
	"testing"

	_ "sigs.k8s.io/e2e-framework/klient/conf"
)

func TestMain(m *testing.M) {
	os.Exit(m.Run())
}
❯ go test .
ok  	stuff	0.295s [no tests to run]
❯ go mod why k8s.io/api/flowcontrol/v1alpha1
go: downloading github.com/rogpeppe/go-internal v1.11.0
# k8s.io/api/flowcontrol/v1alpha1
stuff
stuff.test
sigs.k8s.io/e2e-framework/klient/conf
k8s.io/client-go/rest
k8s.io/client-go/rest.test
k8s.io/client-go/kubernetes/scheme
k8s.io/api/flowcontrol/v1alpha1

Seem to be working fine for me though. Did not have to do a go mod replace

@davidgamero
Copy link

davidgamero commented Apr 22, 2024

in the latest k8s..io/api which is now v0.30.0, the flowcontrol/v1alpha api is no longer present as of this commit

this resulted in the same issue for me k8s.io/api/flowcontrol/v1alpha1: module k8s.io/api@latest found (v0.30.0), but does not contain package k8s.io/api/flowcontrol/v1alpha1

however, i can confirm that adding require sigs.k8s.io/e2e-framework v0.3.0 to my go.mod successfully executes go mod tidy

@harshanarayana
Copy link
Contributor

Changes required to enable v0.30.0 of k/* packages is still under way. xref: #401

@vladimirvivien
Copy link
Contributor

Can this one be closed then @davidgamero @harshanarayana ?

@harshanarayana
Copy link
Contributor

I believe so. @vladimirvivien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants