@@ -118,17 +118,17 @@ Masters). This State Abstraction is a mutable, durable dictionary where keys
118118and values are opaque strings. As controllers only need the capability to
119119persist an immutable point in time snapshot of target Object states to
120120implement a revision history, we propose to use an immutable durable dictionary,
121- and we introduce the AnyState object for this purpose.
121+ and we introduce the ControllerHistory object for this purpose.
122122
123123``` golang
124- // AnyState implements an immutable dictionary of state data to allow for a
124+ // ControllerHistory implements an immutable dictionary of state data to allow for a
125125// point in time snapshot. Clients are responsible for serializing
126126// and deserializing the objects that contain their internal state and mapping
127127// them to a set of keys.
128- // Once an AnyState has been successfully created, it can not be updated. The
128+ // Once an ControllerHistory has been successfully created, it can not be updated. The
129129// API Server will fail validation of all update requests that attempt to mutate
130- // the Data field. AnyStates may, however, be deleted.
131- type AnyState struct {
130+ // the Data field. ControllerHistorys may, however, be deleted.
131+ type ControllerHistory struct {
132132 metav1.TypeMeta
133133 // +optional
134134 metav1.ObjectMeta
@@ -143,13 +143,13 @@ type AnyState struct {
143143```
144144
145145## API Server
146- The API Server must support the creation and deletion of AnyState objects.
146+ The API Server must support the creation and deletion of ControllerHistory objects.
147147As we have no mechanism for declarative immutability, the API server must fail
148- any update request that updates the ` .Data ` field of an AnyState Object.
148+ any update request that updates the ` .Data ` field of an ControllerHistory Object.
149149
150150## Controllers
151151This section is presented as a generalization of how an arbitrary controller
152- can use AnyState to persist a history of revisions to its specification type
152+ can use ControllerHistory to persist a history of revisions to its specification type
153153Objects. The technique is applicable, without loss of generality, to the
154154existing Kuberentes controllers that have Pod as a generated type.
155155
@@ -183,28 +183,28 @@ Object, a controller will do the following.
183183
1841841 . The controller will serialize all the fields of the Object's target object
185185state using JSON encoding.
186- 1 . The controller will populate the ` .Data ` of an AnyState object by
186+ 1 . The controller will populate the ` .Data ` of an ControllerHistory object by
187187associating the serialized fields with keys that correspond to the fields'
188188names.
189189 - e.g ` PodTemplateSpecs ` should be stored at the ` "Template" ` key.
1901901 . The controller will store the specification type Objects ` .Generation ` at the
191191` "ControllerGeneration" ` key.
192- - This value provides providence for the created AnyState .
192+ - This value provides providence for the created ControllerHistory .
1931931 . The controller will store a unique, monotonically increasing
194194[ revision number] ( #revision-number-selection ) in the Revision field.
195- 1 . The controller will compute the [ hash] ( #hashing ) of the AnyState 's ` .Data ` .
196- 1 . The controller will attach a label to the AnyState so that it is selectable
195+ 1 . The controller will compute the [ hash] ( #hashing ) of the ControllerHistory 's ` .Data ` .
196+ 1 . The controller will attach a label to the ControllerHistory so that it is selectable
197197with a low probability of overlap.
198198 - ControllerRefs will be used as the authoritative test for ownership.
199199 - The specification type Object's ` .Selector ` should be used where
200200 applicable.
201201 - Alternatively, a Kind unique label may be set to the ` .Name ` of the
202202 specification type Object.
2032031 . The controller will add a ControllerRef indicating the specification type
204- Object as the owner of the AnyState in the AnyState 's ` .OwnerReferences ` .
204+ Object as the owner of the ControllerHistory in the ControllerHistory 's ` .OwnerReferences ` .
2052051 . The controller will use the hash from above, along with a user identifiable
206- prefix, to [ generate a unique ` .Name ` ] ( #unique-name-generation ) for the AnyState .
207- 1 . The controller will persist the AnyState via the API Server.
206+ prefix, to [ generate a unique ` .Name ` ] ( #unique-name-generation ) for the ControllerHistory .
207+ 1 . The controller will persist the ControllerHistory via the API Server.
208208 - Note that, in practice, creation occurs concurrently with
209209 [ collision resolution] ( #collision-resolution ) .
210210
@@ -227,13 +227,13 @@ specification type Object's revision history.
227227To reconstruct the history of a specification type Object, a controller will do
228228the following.
229229
230- 1 . Select all AnyState Objects labeled as described
230+ 1 . Select all ControllerHistory Objects labeled as described
231231[ above] ( #version-snapshot-creation ) .
232- 1 . Filter any AnyStates that do not have a ControllerRef in their
232+ 1 . Filter any ControllerHistories that do not have a ControllerRef in their
233233` .OwnerReferences ` indicating ownership by the Object.
234- 1 . Sort the AnyStates by the value associated with the
234+ 1 . Sort the ControllerHistories by the value associated with the
235235` "Revision" ` key.
236- 1 . This produces a strictly ordered set of AnyStates that comprises the ordered
236+ 1 . This produces a strictly ordered set of ControllerHistories that comprises the ordered
237237revision history of the specification type Object.
238238
239239### History Maintenance
@@ -246,12 +246,12 @@ specification type Object it will do the following.
2462461 . The controller will
247247[ reconstruct the Object's revision history] ( #history-reconstruction ) .
248248 - Note that the process of reconstructing the Object's history filters any
249- AnyStates not owned by the Object.
250- 1 . The controller will filter any AnyStates that represent a live version.
251- 1 . If the number of remaining AnyStates is greater than the configured
249+ ControllerHistories not owned by the Object.
250+ 1 . The controller will filter any ControllerHistories that represent a live version.
251+ 1 . If the number of remaining ControllerHistories is greater than the configured
252252` RevisionHistoryLimit ` , the controller will delete them, in order with respect
253253to the value mapped to their ` .Revisions ` , until the number
254- of remaining AnyStates is equal to the ` RevisionHistoryLimit ` .
254+ of remaining ControllerHistories is equal to the ` RevisionHistoryLimit ` .
255255
256256This ensures that the number of recorded, non-live revisions is less than or
257257equal to the configured ` RevisionHistoryLimit ` .
@@ -264,26 +264,26 @@ target state update or rollback. We propose two methods that controllers may
264264use to track live versions and their association with generated Objects.
265265
2662661 . The most straightforward method is labeling. In this method the generated
267- Objects are labeled with the ` .Name ` of the AnyState object that corresponds to
267+ Objects are labeled with the ` .Name ` of the ControllerHistory object that corresponds to
268268the version of the target Object state that was used to generate them. As we
269- have taken care to ensure the uniqueness of the ` .Names ` of the AnyStates ,
269+ have taken care to ensure the uniqueness of the ` .Names ` of the ControllerHistories ,
270270this approach is reasonable.
271271 - A revision is considered to be live while any generated Object labeled
272272 with its ` .Name ` is live.
273273 - This method has the benefit of providing visibility, via the label, to
274274 users with respect to the historical providence of a generated Object.
275275 - The primary drawback is the lack of support for using garbage collection
276276 to ensure that only non-live version snapshots are collected.
277- 1 . Controllers may also use the ` OwnerReferences ` field of the AnyState to
277+ 1 . Controllers may also use the ` OwnerReferences ` field of the ControllerHistory to
278278record all Objects that are generated from target Object state version
279- represented by the AnyState as its owners.
279+ represented by the ControllerHistory as its owners.
280280 - A revision is considered to be live while any generated Object that owns
281281 it is live.
282282 - This method allows for the implementation of generic garbage collection.
283283 - The primary drawback with this method is that the book keeping is complex,
284284 and deciding if a generated Object corresponds to a particular revision
285285 will require testing each Object for membership in the ` OwnerReferences `
286- of all AnyStates .
286+ of all ControllerHistories .
287287
288288At the cost of the complexity of implementing both labeling and ownership,
289289controllers may use a combination of both approaches to mitigate the
@@ -306,19 +306,19 @@ Since we [track the version of](#version-tracking) of generated Objects, this
306306reduces to deciding if the version of the target Object state associated with
307307the generated Object is equivalent to the current target Object state.
308308Even though [ hashing] ( #hashing ) is used to generate the ` .Name ` of the
309- AnyStates used to encapsulate versions of the target Object state, as we do
309+ ControllerHistories used to encapsulate versions of the target Object state, as we do
310310not require cryptographically strong collision resistance, and given we use a
311311[ collision resolution] ( #collision-resolution ) technique, we can't use the
312- [ generated names] ( #unique-name-generation ) of AnyStates to decide equality.
312+ [ generated names] ( #unique-name-generation ) of ControllerHistories to decide equality.
313313
314- We propose that two AnyStates can be considered equal if their ` .Data ` is
314+ We propose that two ControllerHistories can be considered equal if their ` .Data ` is
315315equivalent, but that it is not sufficient to compare the serialized
316316representation of the their ` .Data ` . Consider that the addition of new fields
317317to the Objects that represent the target Object state may cause the serialized
318318representation of those Objects to be unequal even when they are semantically
319319equivalent.
320320
321- The controller should deserialize the values of the AnyStates representing their
321+ The controller should deserialize the values of the ControllerHistories representing their
322322target Object state and perform a deep, semantic equality test. Here all
323323differences that do not constitute a mutation to the target Object state are
324324disregarded during the equivalence test.
@@ -373,11 +373,11 @@ contained at a particular revision.
373373
374374## Tests
375375
376- 1 . Controllers can create an AnyState containing a revision of their target
376+ 1 . Controllers can create an ControllerHistory containing a revision of their target
377377Object state.
3783781 . Controllers can reconstruct their revision history.
379- 1 . Controllers can't update an AnyState 's ` .Data ` .
380- 1 . Controllers can delete an AnyState to maintain their history with respect to
379+ 1 . Controllers can't update an ControllerHistory 's ` .Data ` .
380+ 1 . Controllers can delete an ControllerHistory to maintain their history with respect to
381381the configured ` RevisionHistoryLimit ` .
382382
383383## Appendix
@@ -408,7 +408,7 @@ will start with `n := 0` and compute `s' := H'(s,n)`, incrementing `n` when
408408return ` n,s' ` .
409409
410410For our purposes, the implementation of the ` exists ` function will attempt to
411- create a ` .Named ` AnyState via the API Server using a
411+ create a ` .Named ` ControllerHistory via the API Server using a
412412[ unique name generation] ( #unique-name-generation ) . If creation fails, due to a
413413conflict, the method returns false.
414414
0 commit comments