Skip to content

Commit 483a91a

Browse files
authored
Merge pull request #1350 from liggitt/go-module-tags
Update published modules with v0.x.y tags
2 parents c71c21d + 8183d5b commit 483a91a

File tree

1 file changed

+41
-26
lines changed

1 file changed

+41
-26
lines changed

keps/sig-architecture/2019-03-19-go-modules.md

+41-26
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ participating-sigs:
1010
reviewers:
1111
- "@sttts"
1212
- "@lavalamp"
13-
- "@cblecker"
14-
- "@mattfarina"
1513
approvers:
1614
- "@smarterclayton"
1715
- "@thockin"
1816
creation-date: 2019-03-19
19-
last-updated: 2019-03-26
17+
last-updated: 2019-11-01
2018
status: implementable
2119
---
2220

@@ -56,21 +54,15 @@ These checklist items _must_ be updated for the enhancement to be released.
5654

5755
- [x] kubernetes/enhancements issue in release milestone, which links to KEP: https://github.com/kubernetes/enhancements/issues/917
5856
- [x] KEP approvers have set the KEP status to `implementable`
59-
- [ ] Design details are appropriately documented
60-
- [ ] Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
61-
- [ ] Graduation criteria is in place
62-
- [ ] "Implementation History" section is up-to-date for milestone
63-
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
64-
- [ ] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
57+
- [x] Design details are appropriately documented
58+
- [x] Test plan is in place, giving consideration to SIG Architecture and SIG Testing input
59+
- [x] Graduation criteria is in place
60+
- [x] "Implementation History" section is up-to-date for milestone
61+
- [x] Supporting documentation e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
62+
- [x] User-facing documentation has been created
6563

66-
**Note:** Any PRs to move a KEP to `implementable` or significant changes once it is marked `implementable` should be approved by each of the KEP approvers. If any of those approvers is no longer appropriate than changes to that list should be approved by the remaining approvers and/or the owning SIG (or SIG-arch for cross cutting KEPs).
67-
68-
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
69-
70-
[kubernetes.io]: https://kubernetes.io/
7164
[kubernetes/enhancements]: https://github.com/kubernetes/enhancements/issues
7265
[kubernetes/kubernetes]: https://github.com/kubernetes/kubernetes
73-
[kubernetes/website]: https://github.com/kubernetes/website
7466

7567
## Summary
7668

@@ -103,6 +95,7 @@ In addition to simply keeping up with the go ecosystem, go modules provide many
10395
* Provide accurate go.mod module descriptors for kubernetes/kubernetes and published staging components
10496
* Enable use of published kubernetes components by `go module` aware consumers
10597
* Allow continued use of published kubernetes components by `go module` *unaware* consumers until go modules are enabled by default
98+
* Allow consumers of go modules to understand the versions of kubernetes libraries they are using
10699

107100
## Proposal
108101

@@ -167,13 +160,29 @@ See the [alternatives](#alternatives-to-publishing-staging-component-modules) se
167160
168161
As part of transitioning to go modules, we can select a versioning strategy.
169162
170-
Current state:
171-
* `client-go` tags a major version on every kubernetes release
172-
* other components tag a (non-semver) `kubernetes-1.x.y` version on each release
173-
* no import rewriting occurs
174-
* consumers can only make use of a single version of each component
163+
State prior to adoption of go modules:
164+
* `client-go` tagged a major version on every kubernetes release
165+
* all components tagged a (non-semver) `kubernetes-1.x.y` version on each release
166+
* no import rewriting occurred
167+
* consumers could only make use of a single version of each component in a build
168+
169+
State after adoption of go modules:
170+
* all components tagged a (non-semver) `kubernetes-1.x.y` version on each release
171+
* no import rewriting occurred
172+
* consumers could only make use of a single version of each component in a build
173+
174+
This proposes publishing components with the following tags:
175+
* Non-semver tags of `kubernetes-1.x.y` (corresponding to kubernetes `v1.x.y`)
176+
* Semver tags of `v0.x.y` (corresponding to kubernetes `v1.x.y`)
177+
178+
`v0.x.y` accurately convey the current guarantees around the go APIs release-to-release.
179+
The semver tags are preserved in the go.mod files of consuming components,
180+
allowing them to see what versions of kubernetes libraries they are using.
181+
Without semver tags, downstream components see "pseudo-versions" like
182+
`v0.0.0-20181208010431-42b417875d0f` in their go.mod files, making it
183+
extremely difficult to see if there are version mismatches between the
184+
kubernetes libraries they are using.
175185
176-
This proposes continuing to tag published components as-is (`kubernetes-1.x.y` for most components, `vX.0.0` for client-go).
177186
This results in the following usage patterns:
178187
179188
Consumers:
@@ -182,10 +191,10 @@ Consumers:
182191
* `go get` behavior (e.g. `go get client-go`):
183192
* uses latest commits of transitive `k8s.io/...` dependencies (likely to break, as today)
184193
* uses latest commits of transitive non-module-based dependencies (likely to break, as today)
185-
* module-based consumers
186-
* reference published module versions as `v0.0.0-$date-$sha`
194+
* module-based consumers using a specific version
195+
* reference published module versions as `v0.x.y` or `kubernetes-1.x.y`
187196
* import `k8s.io/apimachinery/...` (as they do today)
188-
* `go get` behavior (e.g. `GO111MODULE=on go get client-go@v15.0.0`):
197+
* `go get` behavior (e.g. `GO111MODULE=on go get k8s.io/client-go@v0.17.0` or `GO111MODULE=on go get k8s.io/[email protected].0`):
189198
* uses `go.mod`-referenced versions of transitive `k8s.io/...` dependencies (unless overridden by top-level module, or conflicting peers referencing later versions)
190199
* uses `go.mod`-referenced versions of transitive non-module-based dependencies (unless overridden by top-level module, or conflicting peers referencing later versions)
191200
* consumers are limited to a single copy of kubernetes libraries among all dependencies (as they are today)
@@ -197,8 +206,11 @@ Compatibility implications:
197206
* breaking go changes in each release impact consumers that have not pinned to particular tags/shas (as they do today)
198207
* conflicting version requirements (direct or transitive) can result in impossible-to-build or impossible-to-update dependencies (as they do today)
199208
200-
Allowed versioning changes:
201-
* modules published this way can transition to semantic import versioning in the future
209+
This would not limit future changes to our versioning strategy:
210+
* modules published and tagged this way could transition to semantic import versioning in the future, if desired
211+
* modules published and tagged this way could transition to v1.x.y semver tagging in the future, if desired
212+
(this would require enforcement of go API compatibility in perpetuity, and prevent removal of *any* go API element,
213+
so we are unlikely to pursue this approach, but adding v0.x.y tags now does not remove the option)
202214
203215
See the [alternatives](#alternative-versioning-strategies) section for other possible versioning strategies considered for the initial move to modules.
204216
@@ -245,6 +257,8 @@ Not applicable
245257
- 2019-03-19: Created
246258
- 2019-03-26: Completed proposal
247259
- 2019-03-26: Marked implementable
260+
- 2019-04-03: Implemented go module support
261+
- 2019-11-01: Added proposal for tagging published modules with v0.x.y
248262
249263
## Alternatives
250264
@@ -354,3 +368,4 @@ and doesn't fully allow multiple versions of kubernetes components to coexist as
354368
* https://golang.org/cmd/go/#hdr-The_go_mod_file
355369
* https://golang.org/cmd/go/#hdr-Maintaining_module_requirements
356370
* https://golang.org/cmd/go/#hdr-Module_compatibility_and_semantic_versioning
371+
* [discussion of tagging with v0.x.y](https://github.com/kubernetes/kubernetes/issues/84608)

0 commit comments

Comments
 (0)