Skip to content

Commit 6e4dcb3

Browse files
authored
feat(AIP-148): move annotations from AIP-128 (#1183)
consolidating standard fields to make them more discoverable. fixes #1082
1 parent 0b516fb commit 6e4dcb3

2 files changed

Lines changed: 32 additions & 19 deletions

File tree

aip/general/0128.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,6 @@ message Book {
4949
}
5050
```
5151

52-
### Annotations
53-
54-
Declarative-friendly resources **must** include a
55-
`map<string, string> annotations` field to allow clients to store small amounts
56-
of arbitrary data.
57-
58-
The `annotations` field **must** use the [Kubernetes limits][] to maintain wire
59-
compatibility, and **should** require dot-namespaced annotation keys to prevent
60-
tools from trampling over one another.
61-
62-
**Note:** Annotations are distinct from various forms of labels. Labels can be
63-
used by server-side policies, such as IAM conditions. Annotations exist to
64-
allow client tools to store their own state information without requiring a
65-
database.
66-
67-
<!-- prettier-ignore -->
68-
[kubernetes limits]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set
69-
7052
### Reconciliation
7153

7254
If a resource takes time (more than a few seconds) for updates to be realized,
@@ -95,8 +77,16 @@ is a comprehensive reference to declarative-friendly guidance in other AIPs:
9577
- Resources **should not** implement soft-delete. If the id cannot be re-used,
9678
the resource **must** implement soft-delete and the undelete RPC: see AIP-164
9779

80+
81+
### Annotations
82+
83+
See [AIP-148 annotations]().
84+
9885
## Changelog
9986

87+
- **2023-07-13**: Move `annotations` from AIP-148.
10088
- **2023-06-17**: Definition of plane was removed and incorporated into AIP-111.
10189
- **2023-05-11**: Removed must on resource_id, which was upstreamed to a general
102-
must.
90+
must.
91+
92+
[AIP-148 annotations]: ./0148.md#annotations

aip/general/0148.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,26 @@ Resources that support soft delete **should** include this field.
118118
Services **may** provide a `purge_time` value that is inexact, but the resource
119119
**must not** be purged from the system before that time.
120120

121+
### Annotations
122+
123+
To store small amounts of arbitrary data, a `map<string, string> annotations`
124+
field **may** be added.
125+
126+
The `annotations` field **must** use the [Kubernetes limits][] to maintain wire
127+
compatibility, and **should** require dot-namespaced annotation keys to prevent
128+
tools from trampling over one another.
129+
130+
Examples of information that might be valuable to store in annotations include:
131+
132+
- For CI/CD, an identifier of the pipeline run or version control identifier
133+
used to propagate.
134+
135+
**Note:** Annotations are distinct from various forms of labels. Labels can be
136+
used by server-side policies, such as IAM conditions. Annotations exist to
137+
allow client tools to store their own state information without requiring a
138+
database.
139+
140+
121141
## Further reading
122142

123143
- For standardized codes, see AIP-143.
@@ -135,8 +155,11 @@ Before 2023-07, `purge_time` for soft-deleted resources was also called
135155

136156
## Changelog
137157

158+
- **2023-08-14**: Introduce the term `annotations` from AIP-128.
138159
- **2023-07-13**: Introduce the term `purge_time`.
139160
- **2021-04-06**: Require output only field behavior for `uid` and `delete_time`
140161
fields.
141162

163+
<!-- prettier-ignore -->
142164
[declarative-friendly resources]: ./0128.md#resources
165+
[kubernetes limits]: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/#syntax-and-character-set

0 commit comments

Comments
 (0)