We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18b2ada commit e27e293Copy full SHA for e27e293
internal/dao/registry.go
@@ -424,6 +424,13 @@ func loadCRDs(f Factory, m ResourceMetas) {
424
var meta metav1.APIResource
425
meta.Kind = crd.Spec.Names.Kind
426
meta.Group = crd.Spec.Group
427
+ // Since CRD names are cluster scoped they need to be unique, however, it is allowed
428
+ // to have the CRDs with the same names in different groups. Because of that, the
429
+ // returned `crd.Name` values have the group as a suffix, for example
430
+ // "ciliumnetworkpolicies.cilium.io".
431
+ //
432
+ // `Name` field of `meta/v1/APIResource` is supposed to be the plural name of the
433
+ // resource, without the group. Because of that we need to trim the group suffix.
434
meta.Name = strings.TrimSuffix(crd.Name, "."+meta.Group)
435
436
meta.SingularName = crd.Spec.Names.Singular
0 commit comments