K8s-config-connector: Go module import path is broken

Created on 23 Feb 2021  路  4Comments  路  Source: GoogleCloudPlatform/k8s-config-connector

Describe the bug
The Go module import path for the new Go types and clients library released with v1.39.0 seems broken. The source is located at
_github.com/GoogleCloudPlatform/k8s-config-connector/generated_ but the import path is _github.com/GoogleCloudPlatform/k8s-config-connector_

ConfigConnector Version
v1.39.0

To Reproduce

> go get github.com/GoogleCloudPlatform/k8s-config-connector/generated
go: downloading github.com/GoogleCloudPlatform/k8s-config-connector v0.4.0
go: downloading github.com/GoogleCloudPlatform/k8s-config-connector/generated v0.0.0-20210222223536-d77ffcdd23f4
go get: github.com/GoogleCloudPlatform/k8s-config-connector/generated@none updating to
        github.com/GoogleCloudPlatform/k8s-config-connector/[email protected]: parsing go.mod:
        module declares its path as: github.com/GoogleCloudPlatform/k8s-config-connector
                but was required as: github.com/GoogleCloudPlatform/k8s-config-connector/generated

> go get github.com/GoogleCloudPlatform/k8s-config-connector          
go get: added github.com/GoogleCloudPlatform/k8s-config-connector v0.4.0

> go get github.com/GoogleCloudPlatform/[email protected]
go get: github.com/GoogleCloudPlatform/[email protected]: invalid version: unknown revision v1.39.0

Note that github.com/GoogleCloudPlatform/[email protected] is just some old tag that contains nothing useful

It might be possible to do something with a replace directive in my go.mod but that seems like a really bad idea.

FYI, @spew

bug

Most helpful comment

Hi @caieo,

With the 1.40.0 the import path now matches the actual path however there are two new problems:

  1. go.mod and go.sum are now gone, which means that the package is no longer Go modules enabled.
  2. The tag format you use 1.40.0 is not go compatible, it needs to be v1.40.0 or go won't recognize it as a semantic version, see the section called Semantic versions and modules here.
> go get github.com/GoogleCloudPlatform/[email protected]
go get: github.com/GoogleCloudPlatform/[email protected]: invalid version: unknown revision v1.40.0
> go get github.com/GoogleCloudPlatform/[email protected] 
go: downloading github.com/GoogleCloudPlatform/k8s-config-connector v1.0.0-rc1.0.20210227060641-f158208856e7
go get: added github.com/GoogleCloudPlatform/k8s-config-connector v1.0.0-rc1.0.20210227060641-f158208856e7

As you can see it is now possible to add a dependency to the package but you get the version v1.0.0-rc1.0.20210227060641-f158208856e7, which means nothing and the lack of Go module support can also lead to future dependency problems.

All 4 comments

Hi @yhrn, glad to hear you're trying out the go types and client! This was an oversight in our release script, I have a fix on the way and we'll have it patched soon. Sorry you ran into this.

Hi @caieo,

With the 1.40.0 the import path now matches the actual path however there are two new problems:

  1. go.mod and go.sum are now gone, which means that the package is no longer Go modules enabled.
  2. The tag format you use 1.40.0 is not go compatible, it needs to be v1.40.0 or go won't recognize it as a semantic version, see the section called Semantic versions and modules here.
> go get github.com/GoogleCloudPlatform/[email protected]
go get: github.com/GoogleCloudPlatform/[email protected]: invalid version: unknown revision v1.40.0
> go get github.com/GoogleCloudPlatform/[email protected] 
go: downloading github.com/GoogleCloudPlatform/k8s-config-connector v1.0.0-rc1.0.20210227060641-f158208856e7
go get: added github.com/GoogleCloudPlatform/k8s-config-connector v1.0.0-rc1.0.20210227060641-f158208856e7

As you can see it is now possible to add a dependency to the package but you get the version v1.0.0-rc1.0.20210227060641-f158208856e7, which means nothing and the lack of Go module support can also lead to future dependency problems.

In v1.41.0, Config Connector starts supporting version tags in the format of v0.0.0.

I can confirm this is now working as expected.

Was this page helpful?
0 / 5 - 0 ratings