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

cmd/go: modfetch.Query omits mismatched major versions #26333

Closed
oiooj opened this issue Jul 11, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@oiooj
Copy link
Member

commented Jul 11, 2018

What did you do?

vgo mod -init && vgo mod -sync

What did you expect to see?

Generate a correct go.mod

What did you see instead?

$ vgo mod -init
go: creating new go.mod: module git.xxx.com/k8s/deployment
$ vgo mod -sync
resolving import "k8s.io/apimachinery/pkg/api/errors"
resolving import "k8s.io/client-go/util/retry"
resolving import "k8s.io/api/core/v1"
resolving import "k8s.io/api/extensions/v1beta1"
resolving import "k8s.io/apimachinery/pkg/apis/meta/v1"
resolving import "k8s.io/client-go/kubernetes"
resolving import "k8s.io/api/apps/v1"
resolving import "k8s.io/apimachinery/pkg/api/resource"
resolving import "k8s.io/client-go/util/homedir"
resolving import "k8s.io/client-go/tools/clientcmd"
go: finding k8s.io/api/extensions/v1beta1 latest
go: finding k8s.io/api/apps latest
go: finding k8s.io/api/core latest
go: finding k8s.io/apimachinery/pkg/api/resource latest
go: finding k8s.io/apimachinery/pkg/api/errors latest
go: finding k8s.io/apimachinery/pkg/apis/meta latest
go: finding k8s.io/api latest
go: finding k8s.io/api (latest)
go: adding k8s.io/api v0.0.0-20180711052118-183f3326a935
resolving import "k8s.io/apimachinery/pkg/util/intstr"
go: finding k8s.io/api/extensions latest
go: finding k8s.io/client-go/kubernetes latest
go: finding k8s.io/client-go/util/homedir latest
go: finding k8s.io/client-go/tools/clientcmd latest
go: finding k8s.io/client-go/util/retry latest
go: finding k8s.io/apimachinery/pkg/api latest
go: finding k8s.io/apimachinery/pkg/apis latest
go: finding k8s.io/apimachinery/pkg/util/intstr latest
go: finding k8s.io/client-go (latest)
go: adding k8s.io/client-go v1.5.1
go: finding k8s.io/client-go/tools latest
go: finding k8s.io/client-go/util latest
go: finding k8s.io/apimachinery/pkg latest
go: finding k8s.io/apimachinery/pkg/util latest
go: finding k8s.io/apimachinery latest
go: finding k8s.io/apimachinery (latest)
go: adding k8s.io/apimachinery v0.0.0-20180709171335-241e268dc8e0
go: import "git.xxx.com/k8s/deployment" ->
	import "k8s.io/client-go/util/homedir": open /Users/sosara/golang/src/mod/k8s.io/client-go@v1.5.1/util/homedir: no such file or directory
go: import "git.xxx.com/k8s/deployment/api" ->
	import "k8s.io/client-go/kubernetes": open /Users/sosara/golang/src/mod/k8s.io/client-go@v1.5.1/kubernetes: no such file or directory
go: import "git.xxx.com/k8s/deployment/api" ->
	import "k8s.io/client-go/tools/clientcmd": open /Users/sosara/golang/src/mod/k8s.io/client-go@v1.5.1/tools/clientcmd: no such file or directory
go: import "git.xxx.com/k8s/deployment/api" ->
	import "k8s.io/client-go/util/retry": open /Users/sosara/golang/src/mod/k8s.io/client-go@v1.5.1/util/retry: no such file or directory
resolving import "github.com/gogo/protobuf/proto"
resolving import "github.com/google/gofuzz"
resolving import "github.com/gogo/protobuf/sortkeys"
resolving import "github.com/golang/glog"
resolving import "github.com/modern-go/reflect2"
resolving import "golang.org/x/net/http2"
resolving import "github.com/stretchr/testify/require"
resolving import "github.com/json-iterator/go"
resolving import "gopkg.in/inf.v0"
resolving import "github.com/davecgh/go-spew/spew"
go: finding github.com/modern-go/reflect2 latest
go: finding github.com/golang/glog latest
go: finding github.com/modern-go/reflect2 (latest)
go: adding github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
resolving import "github.com/spf13/pflag"
go: finding github.com/golang/glog (latest)
go: adding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
resolving import "github.com/ghodss/yaml"
go: finding github.com/google/gofuzz latest
go: finding github.com/google/gofuzz (latest)
go: adding github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf
resolving import "github.com/stretchr/testify/assert"
go: finding github.com/gogo/protobuf/proto latest
go: finding github.com/gogo/protobuf/sortkeys latest
go: finding github.com/davecgh/go-spew/spew latest
go: finding github.com/gogo/protobuf (latest)
go: adding github.com/gogo/protobuf v1.0.0
go: finding github.com/json-iterator/go latest
go: finding golang.org/x/net/http2 latest
go: finding github.com/json-iterator/go (latest)
go: adding github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be
go: finding github.com/davecgh/go-spew (latest)
go: adding github.com/davecgh/go-spew v1.1.0
go: finding golang.org/x/net latest
go: finding golang.org/x/net (latest)
go: adding golang.org/x/net v0.0.0-20180710231904-039a4258aec0
go: finding github.com/stretchr/testify/require latest
go: finding github.com/stretchr/testify/assert latest
go: finding github.com/stretchr/testify (latest)
go: adding github.com/stretchr/testify v1.2.2
go: finding github.com/ghodss/yaml (latest)
go: adding github.com/ghodss/yaml v1.0.0
go: finding gopkg.in/inf.v0 (latest)
go: adding gopkg.in/inf.v0 v0.9.1
go: finding github.com/spf13/pflag (latest)
go: adding github.com/spf13/pflag v1.0.1

When I ran mod sync for my new project, vgo get k8s.io/client-go latest for me. But the result is k8s.io/client-go v1.5.1, It's too old, so the error occurred that some dirs not found. The import path k8s.io/client-go parsed as v1 by vgo, so the matched latest version is v1.5.1.

Actually, I need k8s.io/client-go v7.0.0. https://github.com/kubernetes/client-go/releases/tag/v7.0.0

I know this is basically working as intended, but maybe we need to handle this for old code and users. We should make users feel that using vgo is very simple.

@gopherbot gopherbot added this to the vgo milestone Jul 11, 2018

@rsc rsc modified the milestones: vgo, Go1.11 Jul 12, 2018

@rsc rsc added the modules label Jul 12, 2018

@rsc rsc changed the title x/vgo: modfetch.Query omits mismatched major versions cmd/go: modfetch.Query omits mismatched major versions Jul 12, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Jul 16, 2018

This has some overlap with #26286 and #26238.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 17, 2018

Duplicate of (or at least will be fixed by fix for) #26238.

@rsc rsc closed this Jul 17, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.