Skip to content

Commit a86bc7f

Browse files
committed
Adjust guidance on generics to include v1.24
Kubernetes v1.24 is built on Go 1.18, and will not revert to Go 1.17 at this point. Ergo, it should be allowed to use Go generics as soon as 1.24 is the oldest supported release.
1 parent 3c8b003 commit a86bc7f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

sig-architecture/generics.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Background
22

3-
In general, Kubernetes has not restricted using new Go features, we've quickly
3+
In general, Kubernetes has not restricted using new Go features. We've quickly
44
adopted new standard library types and methods and will continue to do so.
55

6-
Generally the latest stable go release is in use on the main development branch.
6+
Generally the latest stable Go release is in use on the main development branch.
77
This includes all of the staging libraries (client-go etc.) that originate in the
88
main [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) repository.
99

@@ -14,19 +14,21 @@ Now that v1.24.0 is out, use of generics should be allowed.
1414

1515
# Generics Policy
1616

17-
Generics may be used in Kubernetes starting in v1.25, with the following restrictions
18-
applying only until v1.24 is [out of support][version-support]:
17+
Generics may be used in Kubernetes starting in v1.24, with the following restrictions
18+
applying only until v1.23 is [out of support][version-support]:
1919

2020
- Generics should **not** be used in Kubernetes libraries used across multiple Kubernetes
21-
versions, that is the non "staged" libraries like:
21+
versions, that is the non "staged" libraries like:
2222
- [k8s.io/utils](https://github.com/kubernetes/utils)
2323
- [sigs.k8s.io/yaml](https://github.com/kubernetes-sigs/yaml)
2424
- [k8s.io/klog](https://github.com/kubernetes/klog)
2525
- etc.
2626

27-
- Generics should be **avoided** when writing Kubernetes bug fixes that are likely to be backported, to streamline cherry-picking to older release branches.
27+
- Generics should be **avoided** when writing Kubernetes bug fixes that are
28+
likely to be backported to v1.23 or older, to streamline cherry-picking to
29+
those release branches which predate Go 1.18.
2830

29-
These restrictions should be considered lifted when v1.24 is out of support.
31+
These restrictions should be considered lifted when v1.23 is out of support.
3032

3133
## Recommendations for Reviewers
3234

0 commit comments

Comments
 (0)