Skip to content

Commit

Permalink
Update workloads.go (#705)
Browse files Browse the repository at this point in the history
Fix issue with empty kind field
Signed-off-by: Andrii Kotelnikov <[email protected]>
  • Loading branch information
andrusha19 committed Jun 14, 2024
1 parent 9689f74 commit 10e9b77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/workloads/workloads.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func getPodsFromWorkload(target types.AppDetails, allPods *kcorev1.PodList, dyna
func GetPodOwnerTypeAndName(pod *kcorev1.Pod, dynamicClient dynamic.Interface) (parentType, parentName string, err error) {
for _, owner := range pod.GetOwnerReferences() {
parentName = owner.Name
parentType = strings.ToLower(owner.Kind)
if owner.Kind == "StatefulSet" || owner.Kind == "DaemonSet" {
return strings.ToLower(owner.Kind), parentName, nil
}
Expand Down

0 comments on commit 10e9b77

Please sign in to comment.