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
* If dependencies allow it, we can move them to `k8s.io/{component}/pkg/apis/config/types.go`. Not having the external types there is intentional because the `pkg/` package tree is considered as "on-your-own-risks / no code compatibility guarantees", while `config/` is considered as a code API.
* The scheme package should expose `Scheme *runtime.Scheme`, `Codecs *serializer.CodecFactory`, and `AddToScheme(*runtime.Scheme)`, and have an `init()` method that runs `AddToScheme(Scheme)`
175
182
* For the move to a staging repo to be possible, the external API package must not depend on the core repo.
176
183
* Hence, all non-staging repo dependencies need to be removed/resolved before the package move.
177
184
* Conversions from the external type to the internal type will be kept in `{internal_api_path}/{external_version}`, like for `k8s.io/api`
178
-
* Defaulting code will be kept in this package, next to the conversions, if it already exists. We keep the decision about the destiny of defaulting open in this KEP.
185
+
* Defaulting code will be kept in this package, besides the conversion functions.
186
+
* The defaulting code here is specific for the usage of the component, and internal by design. If there are defaulting functions we
187
+
feel would be generally useful, they might be exposed in `k8s.io/{component}/config/{version}/defaults.go` as `RecommendedDefaultFoo`
188
+
functions that can be used by various consumers optionally.
189
+
* Add at least some kind of minimum validation coverage for the types (e.g. ranges for integer values, URL scheme/hostname/port parsing,
190
+
DNS name/label/domain validation) in the `{internal_api_path}/validation` package, targeting the internal API version. The consequence of
191
+
these validations targeting the internal type is that they can't be exposed in the `k8s.io/{component}` repo, but publishing more
192
+
functionality like that is out of scope for this KEP and left as a future task.
179
193
* Create a "shared types"-package with structs generic to all or many componentconfig API groups, in the `k8s.io/apimachinery`, `k8s.io/apiserver` and `k8s.io/controller-manager` repos, depending on the struct.
* These aren’t "real" API groups, but have both internal and external versions
195
+
* These aren’t "real" API groups, but they have both internal and external versions
182
196
* Conversions and internal types are published to the staging repo.
183
-
*Defaults are moved into the leaf groups using them as much as possible.
184
-
* Remove the monolithic `componentconfig/v1alpha1` API group
197
+
*Defaulting functions are of the `RecommendedDefaultFoo` format and opt-ins for consumers. No defaulting functions are registered in the scheme.
198
+
* Remove the monolithic `componentconfig/v1alpha1` API group (`pkg/apis/componentconfig`)
185
199
* Enable the staging bot to create the Github repos
186
-
*We do not add further defaulting, but merely keep the minimum defaulting in-place to keep the current behaviour, but remove those defaulting funcs which are not used today.
200
+
*Add API roundtrip (fuzzing), defaulting, conversion, JSON tag consistency and validation tests.
187
201
188
202
### Migration strategy per component or k8s.io repo
189
203
@@ -192,7 +206,7 @@ types of the core components’ ComponentConfig in a top-level `config/` package
192
206
***Not a "real" API group, instead shared packages only with both external and internal types.**
193
207
***External Package with defaulting (where absolutely necessary) & conversions**: `k8s.io/apimachinery/pkg/apis/config/v1alpha1/types.go`
* GenericComponentConfiguration (should be renamed to GenericControllerManagerConfiguration at the same time)
262
+
*`GenericComponentConfiguration` (which will be renamed to `GenericControllerManagerConfiguration`)
249
263
* Assignee: @stewart-yu
250
264
251
265
#### kube-controller-manager changes
@@ -304,13 +318,15 @@ Dep supports the import of sub-packages without inheriting dependencies from out
304
318
Objective: Done for v1.12
305
319
306
320
Implementation order:
307
-
* Start with the apiserver and apimachinery shared config repos, copy over the necessary structs as needed and create the external and internal API packages.
308
-
* Start with the scheduler as the first component.
309
-
* One PR for moving `KubeSchedulerConfiguration` to `staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go`, and the internal type to `pkg/scheduler/apis/config/types.go`.
310
-
* Set up the conversion for the external type by creating the package `pkg/scheduler/apis/config/v1alpha1`, without `types.go`, like how `k8s.io/api` is set up.
311
-
* This should be a pure code move.
321
+
* Start with copying over the necessary structs to the `k8s.io/apiserver` and `k8s.io/apimachinery ` shared config packages, with external and internal API versions. The defaulting pattern for these types are of the `RecommendedDefaultFoo` form, in other words defaulting is not part of the scheme.
322
+
* Remove as many unnecessary references to `pkg/apis/componentconfig` from the rest of the core repo as possible
323
+
* Make the types in `pkg/apis/componentconfig` reuse the newly-created types in `k8s.io/apiserver` and `k8s.io/apimachinery `.
324
+
* Start with the scheduler as the first component to be moved out.
325
+
* One PR for moving `KubeSchedulerConfiguration` to `staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go`, and the internal type to `pkg/scheduler/apis/config/types.go`.
326
+
* Set up the conversion for the external type by creating the package `pkg/scheduler/apis/config/v1alpha1`, without `types.go`, like how `k8s.io/api` is set up.
327
+
* This should be a pure code move.
312
328
* Set up staging publishing bot (async, non-critical)
313
-
* The kubelet, kube-proxy and controller-manager follow, each one independently.
329
+
* The kubelet, kube-proxy and kube-controller-manager types follow, each one independently.
0 commit comments