mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
K8s: Register group and kinds to internal version to fix apply (#97184)
* K8s: Register group and kinds to internal version to fix apply
This commit is contained in:
parent
14b49a0f61
commit
7b25804b55
@ -64,6 +64,16 @@ func (b *appBuilder) InstallSchema(scheme *runtime.Scheme) error {
|
||||
for _, kind := range kinds {
|
||||
scheme.AddKnownTypeWithName(gv.WithKind(kind.Kind()), kind.ZeroValue())
|
||||
scheme.AddKnownTypeWithName(gv.WithKind(kind.Kind()+"List"), kind.ZeroListValue())
|
||||
|
||||
// Link this group to the internal representation.
|
||||
// This is used for server-side-apply (PATCH), and avoids the error:
|
||||
// "no kind is registered for the type"
|
||||
gvInternal := schema.GroupVersion{
|
||||
Group: gv.Group,
|
||||
Version: runtime.APIVersionInternal,
|
||||
}
|
||||
scheme.AddKnownTypeWithName(gvInternal.WithKind(kind.Kind()), kind.ZeroValue())
|
||||
scheme.AddKnownTypeWithName(gvInternal.WithKind(kind.Kind()+"List"), kind.ZeroListValue())
|
||||
}
|
||||
}
|
||||
return scheme.SetVersionPriority(gv)
|
||||
|
Loading…
Reference in New Issue
Block a user