Skip to content

Commit cc81c41

Browse files
committed
Add order-preserving requirement for resource name patterns
Fixes b/356396132
1 parent f55c4ae commit cc81c41

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

aip/general/0123.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ message Topic {
7878
- Pattern variables **must** be unique within any given pattern. (e.g.
7979
`projects/{abc}/topics/{abc}` is invalid; this is usually a natural
8080
corollary of collection identifiers being unique within a pattern.)
81+
- Resources with [multiple patterns][aip-4231#multi-pattern-resources]) **must**
82+
preserve ordering: new patterns **must** be added at the end of the list, and
83+
existing patterns **must not** be removed or re-ordered, as this breaks client
84+
library backward compatibility.
8185
- Singular **must** be the lower camel case of the type.
8286
- Pattern variables **must** be the singular form of the resource type e.g.
8387
a pattern variable representing a `Topic` resource ID is named `{topic}`.
@@ -110,6 +114,7 @@ such as UpperCamelCase and snake_case.
110114

111115
<!-- prettier-ignore-start -->
112116
[aip-122]: ./0122.md
117+
[aip-4231]: ./4231.md
113118
[API Group]: https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-groups
114119
[nested collections]: ./0122.md#collection-identifiers
115120
[Object]: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#types-kinds
@@ -119,9 +124,10 @@ such as UpperCamelCase and snake_case.
119124

120125
## Changelog
121126

122-
- **2023-09-19**: Prohibit duplicate pattern variables.
123-
- **2023-05-06**: Adding requirement of singular and plural.
124-
- **2023-01-28**: Clarifying guidance for the resource type name.
127+
- **2024-08-07**: Added multi-pattern ordering compatibility requirements.
128+
- **2023-09-19**: Prohibited duplicate pattern variables.
129+
- **2023-05-06**: Added requirement of singular and plural.
130+
- **2023-01-28**: Clarified guidance for the resource type name.
125131
- **2022-10-28**: Added pattern variable format guidance.
126132
- **2020-05-14**: Added pattern uniqueness.
127133
- **2019-12-05**: Added guidance on patterns.

aip/general/0180.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ version.
243243
- For compatibility with client library resource name parsing, see [AIP-4231][]
244244
- For compatibility with client library method signatures, see [AIP-4232][]
245245
- For compatibility around field presence changes, see [AIP-149][].
246+
- For compatibility around resource types, see [AIP-123][].
246247

247248
## Changelog
248249

250+
- **2024-08-07**: Added reference to resource type compatibility.
249251
- **2024-06-05**: Added reference to field presence compatibility.
250252
- **2023-07-26**: Added reference to field behavior compatibility.
251253
- **2023-07-26**: Added note on APIs which have limited clients.
@@ -256,6 +258,7 @@ version.
256258

257259
<!-- prettier-ignore-start -->
258260
[aip-122]: ./0122.md
261+
[aip-123]: ./0123.md
259262
[aip-149]: ./0149.md
260263
[aip-151]: ./0151.md
261264
[aip-158]: ./0158.md

0 commit comments

Comments
 (0)