mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2025-09-15 14:49:36 +00:00
fix: add Ingress in GetParent switch case
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
This commit is contained in:
@@ -50,6 +50,16 @@ func GetParent(client *kubernetes.Client, meta metav1.ObjectMeta) (string, bool)
|
|||||||
return GetParent(client, ds.ObjectMeta)
|
return GetParent(client, ds.ObjectMeta)
|
||||||
}
|
}
|
||||||
return "DaemonSet/" + ds.Name, false
|
return "DaemonSet/" + ds.Name, false
|
||||||
|
|
||||||
|
case "Ingress":
|
||||||
|
ds, err := client.GetClient().NetworkingV1().Ingresses(meta.Namespace).Get(context.Background(), owner.Name, metav1.GetOptions{})
|
||||||
|
if err != nil {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
if ds.OwnerReferences != nil {
|
||||||
|
return GetParent(client, ds.ObjectMeta)
|
||||||
|
}
|
||||||
|
return "Ingress/" + ds.Name, false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user