You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-architecture/2019-03-19-go-modules.md
+41-26
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,11 @@ participating-sigs:
10
10
reviewers:
11
11
- "@sttts"
12
12
- "@lavalamp"
13
-
- "@cblecker"
14
-
- "@mattfarina"
15
13
approvers:
16
14
- "@smarterclayton"
17
15
- "@thockin"
18
16
creation-date: 2019-03-19
19
-
last-updated: 2019-03-26
17
+
last-updated: 2019-11-01
20
18
status: implementable
21
19
---
22
20
@@ -56,21 +54,15 @@ These checklist items _must_ be updated for the enhancement to be released.
56
54
57
55
-[x] kubernetes/enhancements issue in release milestone, which links to KEP: https://github.com/kubernetes/enhancements/issues/917
58
56
-[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
65
63
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.
@@ -103,6 +95,7 @@ In addition to simply keeping up with the go ecosystem, go modules provide many
103
95
* Provide accurate go.mod module descriptors for kubernetes/kubernetes and published staging components
104
96
* Enable use of published kubernetes components by `go module` aware consumers
105
97
* 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
106
99
107
100
## Proposal
108
101
@@ -167,13 +160,29 @@ See the [alternatives](#alternatives-to-publishing-staging-component-modules) se
167
160
168
161
As part of transitioning to go modules, we can select a versioning strategy.
169
162
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.
175
185
176
-
This proposes continuing to tag published components as-is (`kubernetes-1.x.y` for most components, `vX.0.0` for client-go).
177
186
This results in the following usage patterns:
178
187
179
188
Consumers:
@@ -182,10 +191,10 @@ Consumers:
182
191
* `go get` behavior (e.g. `go get client-go`):
183
192
* uses latest commits of transitive `k8s.io/...` dependencies (likely to break, as today)
184
193
* 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`
187
196
* 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`):
189
198
* uses `go.mod`-referenced versions of transitive `k8s.io/...` dependencies (unless overridden by top-level module, or conflicting peers referencing later versions)
190
199
* uses `go.mod`-referenced versions of transitive non-module-based dependencies (unless overridden by top-level module, or conflicting peers referencing later versions)
191
200
* consumers are limited to a single copy of kubernetes libraries among all dependencies (as they are today)
@@ -197,8 +206,11 @@ Compatibility implications:
197
206
* breaking go changes in each release impact consumers that have not pinned to particular tags/shas (as they do today)
198
207
* conflicting version requirements (direct or transitive) can result in impossible-to-build or impossible-to-update dependencies (as they do today)
199
208
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)
202
214
203
215
See the [alternatives](#alternative-versioning-strategies) section for other possible versioning strategies considered for the initial move to modules.
204
216
@@ -245,6 +257,8 @@ Not applicable
245
257
- 2019-03-19: Created
246
258
- 2019-03-26: Completed proposal
247
259
- 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
248
262
249
263
## Alternatives
250
264
@@ -354,3 +368,4 @@ and doesn't fully allow multiple versions of kubernetes components to coexist as
0 commit comments