flux tree: Set CRDs GroupKind in output
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
@@ -298,12 +298,13 @@ func getHelmReleaseInventory(ctx context.Context, objectKey client.ObjectKey, ku
|
|||||||
fmt.Sprintf("%s/name", helmv2.GroupVersion.Group): hr.GetName(),
|
fmt.Sprintf("%s/name", helmv2.GroupVersion.Group): hr.GetName(),
|
||||||
fmt.Sprintf("%s/namespace", helmv2.GroupVersion.Group): hr.GetNamespace(),
|
fmt.Sprintf("%s/namespace", helmv2.GroupVersion.Group): hr.GetNamespace(),
|
||||||
}
|
}
|
||||||
|
crdKind := "CustomResourceDefinition"
|
||||||
var list apiextensionsv1.CustomResourceDefinitionList
|
var list apiextensionsv1.CustomResourceDefinitionList
|
||||||
if err := kubeClient.List(ctx, &list, selector); err == nil {
|
if err := kubeClient.List(ctx, &list, selector); err == nil {
|
||||||
for _, crd := range list.Items {
|
for _, crd := range list.Items {
|
||||||
found := false
|
found := false
|
||||||
for _, r := range result {
|
for _, r := range result {
|
||||||
if r.Name == crd.GetName() && r.GroupKind == crd.GroupVersionKind().GroupKind() {
|
if r.Name == crd.GetName() && r.GroupKind.Kind == crdKind {
|
||||||
found = true
|
found = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -311,8 +312,11 @@ func getHelmReleaseInventory(ctx context.Context, objectKey client.ObjectKey, ku
|
|||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
result = append(result, object.ObjMetadata{
|
result = append(result, object.ObjMetadata{
|
||||||
Name: crd.GetName(),
|
Name: crd.GetName(),
|
||||||
GroupKind: crd.GroupVersionKind().GroupKind(),
|
GroupKind: schema.GroupKind{
|
||||||
|
Group: apiextensionsv1.GroupName,
|
||||||
|
Kind: crdKind,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user