K8s: add a remote services file config option to specify aggregation config (#83646)

This commit is contained in:
Charandas
2024-02-29 17:29:05 -08:00
committed by GitHub
parent 5d7a979199
commit b87ec69431
11 changed files with 260 additions and 19 deletions

View File

@@ -43,6 +43,13 @@ func (b *ServiceAPIBuilder) GetGroupVersion() schema.GroupVersion {
return service.SchemeGroupVersion
}
func addKnownTypes(scheme *runtime.Scheme, gv schema.GroupVersion) {
scheme.AddKnownTypes(gv,
&service.ExternalName{},
&service.ExternalNameList{},
)
}
func (b *ServiceAPIBuilder) InstallSchema(scheme *runtime.Scheme) error {
gv := service.SchemeGroupVersion
err := service.AddToScheme(scheme)
@@ -53,10 +60,10 @@ func (b *ServiceAPIBuilder) InstallSchema(scheme *runtime.Scheme) error {
// Link this version to the internal representation.
// This is used for server-side-apply (PATCH), and avoids the error:
// "no kind is registered for the type"
// addKnownTypes(scheme, schema.GroupVersion{
// Group: service.GROUP,
// Version: runtime.APIVersionInternal,
// })
addKnownTypes(scheme, schema.GroupVersion{
Group: service.GROUP,
Version: runtime.APIVersionInternal,
})
metav1.AddToGroupVersion(scheme, gv)
return scheme.SetVersionPriority(gv)
}