You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contributors/devel/sig-architecture/api_changes.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1096,7 +1096,7 @@ Previously, annotations were used for experimental alpha features, but are no lo
1096
1096
1097
1097
The preferred approach adds an alpha field to the existing object, and ensures it is disabled by default:
1098
1098
1099
-
1. Add a feature gate to the API server to control enablement of the newfield (and associated function):
1099
+
1. Add a [feature gate](feature-gates.md) to the API server to control enablement of the new field:
1100
1100
1101
1101
In [staging/src/k8s.io/apiserver/pkg/features/kube_features.go](https://git.k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/features/kube_features.go):
1102
1102
@@ -1118,7 +1118,8 @@ The preferred approach adds an alpha field to the existing object, and ensures i
1118
1118
* ensure the field is [optional](api-conventions.md#optional-vs-required)
1119
1119
* add the `omitempty`struct tag
1120
1120
* add the `// +optional` comment tag
1121
-
* ensure the field is entirely absent from API responses when empty (optional fields should be pointers, anyway)
1121
+
* add the `// +featureGate=<gate-name>` comment tag
1122
+
* ensure the field is entirely absent from API responses when empty (optional fields must be pointers)
1122
1123
* include details about the alpha-level in the field description
1123
1124
1124
1125
```go
@@ -1131,6 +1132,7 @@ The preferred approach adds an alpha field to the existing object, and ensures i
1131
1132
// width indicates how wide the object is.
1132
1133
// This field is alpha-level and is only honored by servers that enable the Frobber2D feature.
1133
1134
// +optional
1135
+
// +featureGate=Frobber2D
1134
1136
Width *int32 `json:"width,omitempty"`
1135
1137
}
1136
1138
```
@@ -1243,7 +1245,7 @@ Older versions of expected API clients must be able handle the new value in a sa
1243
1245
* If the enum field drives behavior of a single component, ensure all versions of that component
1244
1246
that will encounter API objects containing the new value handle it properly or fail safe.
1245
1247
For example, a new allowed value in a `Pod` enum field consumed by the kubelet must be handled
1246
-
safely by kubelets up to two versions older than the first API server release that allowed the new value.
1248
+
safely by kubelets up to three versions older than the first API server release that allowed the new value.
1247
1249
* If an API drives behavior that is implemented by external clients (like `Ingress` or `NetworkPolicy`),
1248
1250
the enum field must explicitly indicate that additional values may be allowed in the future,
1249
1251
and define how unrecognized values must be handled by clients. If this was not done in the first release
@@ -1268,7 +1270,7 @@ Release 2:
1268
1270
This ensures a cluster with multiple servers at skewed releases (which happens during a rolling upgrade),
1269
1271
will not allow data to be persisted which the previous release of the API server would choke on.
1270
1272
1271
-
Typically, a feature gate is used to do this rollout, starting in alpha and disabled by default in release 1,
1273
+
Typically, a [feature gate](feature-gates.md) is used to do this rollout, starting in alpha and disabled by default in release 1,
1272
1274
and graduating to beta and enabled by default in release 2.
1273
1275
1274
1276
1. Add a feature gate to the API server to control enablement of the new enum value (and associated function):
0 commit comments