|
19 | 19 | - [Go Markers](#go-markers)
|
20 | 20 | - [OpenAPI](#openapi)
|
21 | 21 | - [Normalization and Validation](#normalization-and-validation)
|
| 22 | + - [Migrating existing unions](#migrating-existing-unions) |
22 | 23 | - [Open Questions](#open-questions)
|
23 | 24 | - [Test Plan](#test-plan)
|
24 | 25 | - [Prerequisite testing updates](#prerequisite-testing-updates)
|
@@ -133,7 +134,8 @@ functions (e.g. `pkg/apis/<group>/validation/validation.go`).
|
133 | 134 | incomplete information
|
134 | 135 |
|
135 | 136 | Another goal is to migrate at least one existing union to the new semantics in
|
136 |
| -order to verify that migration is possible. |
| 137 | +order to verify that migration is possible. Ideally migrate one of each type of |
| 138 | +existing union (discriminated and non-discriminated). |
137 | 139 |
|
138 | 140 | ### Non-Goals
|
139 | 141 |
|
@@ -374,6 +376,22 @@ currently done for existing union types.
|
374 | 376 |
|
375 | 377 | Objects must be validated AFTER the normalization process.
|
376 | 378 |
|
| 379 | +#### Migrating existing unions |
| 380 | + |
| 381 | +As mentioned, one of the goals is to migrate at least one existing union to |
| 382 | +using the new marker based union validation and normalization. While open |
| 383 | +questions remain around the priority and urgency of migrating existing unions, |
| 384 | +nonetheless we should be able to come to a consensus on which types to migrate |
| 385 | +first. |
| 386 | + |
| 387 | +For discriminated unions, a couple relatively straightforward discriminated types are |
| 388 | +`MetricSpec` and `MetricStatus`. These have clearly defined discriminator values |
| 389 | +that map one-to-one to a member field, which make them good candidates for |
| 390 | +initial migration. |
| 391 | + |
| 392 | +For non-discriminated unions, there are a few relatively straightforward types |
| 393 | +that make good candidates for initial migration, such as `ContainerState` |
| 394 | + |
377 | 395 | ### Open Questions
|
378 | 396 |
|
379 | 397 | A few open questions exist with the design that need to be resolved with SIG API
|
@@ -402,7 +420,8 @@ Machinery before moving forward.
|
402 | 420 | 4. Given that we want to migrate at least one existing union to use the new
|
403 | 421 | semantics, which union should we do? Must we upgrade both a discriminated and
|
404 | 422 | non-discriminated union for alpha or is only upgrading an existing
|
405 |
| - discriminated union sufficient? |
| 423 | + discriminated union sufficient? Thoughts on my proposed types of |
| 424 | + `MetricStatus` (discriminated) and `ContainerState` (non-discriminated). |
406 | 425 | 5. What should we default the discriminator value of a member field to if not
|
407 | 426 | specified in the go markers?
|
408 | 427 | a. the json representation of the field name
|
|
0 commit comments