@@ -323,9 +323,10 @@ worked before the change.
323
323
values of a given field will not be able to handle the new values. However, removing a
324
324
value from an enumerated set * can* be a compatible change, if handled properly (treat the
325
325
removed value as deprecated but allowed). For enumeration-like fields that expect to add
326
- new values in the future, such as ` reason ` fields, please document that expectation clearly
327
- in the API field descriptions. Clients should treat such sets of values as potentially
328
- open-ended.
326
+ new values in the future, such as ` reason ` fields, document that expectation clearly
327
+ in the API field description in the first release the field is made available,
328
+ and describe how clients should treat an unknown value. Clients should treat such
329
+ sets of values as potentially open-ended.
329
330
330
331
* For [ Unions] ( api-conventions.md#unions ) , sets of fields where at most one should
331
332
be set, it is acceptable to add a new option to the union if the [ appropriate
@@ -1035,7 +1036,8 @@ to the following existing enum field:
1035
1036
type Frobber struct {
1036
1037
// restartPolicy may be set to "Always" or "Never".
1037
1038
// Additional policies may be defined in the future.
1038
- // Unrecognized policies should be treated as "Never".
1039
+ // Clients should expect to handle additional values,
1040
+ // and treat unrecognized values in this field as "Never".
1039
1041
RestartPolicy string ` json:" policy"
1040
1042
}
1041
1043
```
@@ -1059,6 +1061,9 @@ Release 1:
1059
1061
1060
1062
* Only allow the new enum value when updating existing objects that already contain the new enum value
1061
1063
* Disallow it in other cases (creation, and update of objects that do not already contain the new enum value)
1064
+ * Verify that known clients handle the new value as expected, honoring the new value or using previously defined "unknown value" behavior,
1065
+ (depending on whether the associated feature gate is enabled or not)
1066
+
1062
1067
1063
1068
Release 2:
1064
1069
@@ -1122,7 +1127,7 @@ The recommended place to do this is in the REST storage strategy's Validate/Vali
1122
1127
func validationOptionsForFrobber(newFrobber, oldFrobber *api.Frobber) validation.FrobberValidationOptions {
1123
1128
opts := validation.FrobberValidationOptions{
1124
1129
// allow if the feature is enabled
1125
- AllowRestartPolicyOnTuesday: utilfeature.DefaultFeatureGate.Enabled(features.Frobber2D )
1130
+ AllowRestartPolicyOnTuesday: utilfeature.DefaultFeatureGate.Enabled(features.FrobberRestartPolicyOnTuesday )
1126
1131
}
1127
1132
1128
1133
if oldFrobber == nil {
0 commit comments