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

Improve go modules fulfillment #1791

Closed
3 tasks done
Adirio opened this issue Nov 5, 2020 · 4 comments
Closed
3 tasks done

Improve go modules fulfillment #1791

Adirio opened this issue Nov 5, 2020 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@Adirio
Copy link
Contributor

Adirio commented Nov 5, 2020

  • Kubebuilder uses semantic versioning
  • Kubebuilder has a v2 or higher
  • Kubebuilder versions are listed on pkg.go.dev

Description

Although kubebuilder follows semantic versioning as required by go modules, only versions with major version 0 or 1 are actually obtainable by version with go modules. This can be seen in the link provided above.

The solution is to use a non-existent version and use the timestamp and commit hash to refer to a specific version. For example, operator SDK uses sigs.k8s.io/kubebuilder v1.0.9-0.20201021204649-36124ae2e027 which refers to 36124ae.

In order to solve this, go.mod file needs to be changed to include /v2 at the package name (module sigs.k8s.io/kubebuilder/v2) and internal imports need to reference to this same package.

I think it should definetely be implemented for future versions. However, I'm not sure what should be done with previous v2 versions. As previous versions are released, they are tagged and have their code compressed (it would change imports).

/kind feature

@Adirio Adirio added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 5, 2020
@Adirio
Copy link
Contributor Author

Adirio commented Nov 5, 2020

@camilamacedo86
Copy link
Member

I think it is totally fine we leave the previous versions as it is. See that kb has not been provided as lib before the plugins be offered.

@pwittrock
Copy link
Contributor

FYI -- for some reason this breaks pkger

@Adirio Adirio changed the title Improve go modules fullfillment Improve go modules fulfillment Dec 3, 2020
@camilamacedo86
Copy link
Member

The v2 branch was updated with that already.See: #1878
Then, for the next patch release, it will be done.

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

No branches or pull requests

3 participants