Skip to content

Commit

Permalink
feat(Node Drain): Ignore DaemonSets (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanJosipovic authored Nov 10, 2024
1 parent ba5037b commit e35e01c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/KubeUI/ViewModels/ResourceListViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,6 +2107,14 @@ private async Task DrainNode(IList items)
{
if (pod.Value.Spec.NodeName == item.Value.Metadata.Name)
{
if (pod.Value.Metadata.OwnerReferences.Any(x => x.ApiVersion == V1DaemonSet.KubeGroup + "/" + V1DaemonSet.KubeApiVersion &&
x.Kind == V1DaemonSet.KubeKind &&
x.Controller == true &&
x.BlockOwnerDeletion == true))
{
continue;
}

V1Eviction evict = new()
{
ApiVersion = V1Eviction.KubeGroup + "/" + V1Eviction.KubeApiVersion,
Expand Down

0 comments on commit e35e01c

Please sign in to comment.