Minimizing/eliminating k8s.io/kubernetes imports in staging #998
Locked
ncdc
started this conversation in
Development
Replies: 4 comments 1 reply
-
I'm starting to work on this. It will make updating dependencies in our kube fork much easier, as @fabianvf was running into issues yesterday |
Beta Was this translation helpful? Give feedback.
0 replies
-
This makes sense, should I put the other two PRs on hold til this lands @ncdc ? |
Beta Was this translation helpful? Give feedback.
1 reply
-
This is done! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Upstream kube doesn't allow any k8s.io/kubernetes imports in staging repos, as staging repos are published separately and meant to be used by outside projects, and k8s.io/kubernetes is not (or it doesn't really offer any guarantees about being importable).
Our for of kube does break this rule for various reasons. I'd like to try to find ways to minimize or eliminate these.
staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/validation/validation.go: validateCustomResourceDefinitionSpec
The original code disallowed any CRDs for the core group (""). With our change, this lets through any CRD whose group is one of the built-in API groups (anything from https://github.com/kubernetes/api). I think we could probably replace this with a hard-coded list of allowed groups?
staging/src/k8s.io/apiextensions-apiserver/pkg/controller/openapi/builder/builder.go: packagePrefix hack
This is making sure that if there are CRDs for "dotless" kube APIs (anything from https://github.com/kubernetes/api without a dot: apps, batch, policy, extensions), the OpenAPI definitions for these refer to the kube APIs under k8s.io/api. I think we could probably also replace this with a hard-coded list.
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler_tableconverter_hack.go, staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/customresource_handler.go
This is used by crdHandler.getOrCreateServingInfoFor to swap in the custom go table conversion code for built-in types (e.g. deployments) when they are instead installed as CRDs. The only way I can think of to get rid of this import is to add a field to apiextensions apiserver ExtraConfig that's an interface with a function like
GetTableConverter(crd *apiextensionsv1.CustomResourceDefinition) rest.TableConverter
. Implement this interface in the kcp code, and plumb it in via ExtraConfig.Beta Was this translation helpful? Give feedback.
All reactions