Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,21 @@ private V1Node doDrain() throws KubectlException, ApiException, IOException {

validatePods(allPods.getItems());

boolean isDaemonSetPod;
for (V1Pod pod : allPods.getItems()) {
isDaemonSetPod = false;
// at this point we know, that we have to ignore daemon set pods
if (pod.getMetadata().getOwnerReferences() != null) {
for (V1OwnerReference ref : pod.getMetadata().getOwnerReferences()) {
if (ref.getKind().equals("DaemonSet")) {
continue;
isDaemonSetPod = true;
break;
}
}
}
deletePod(api, pod.getMetadata().getName(), pod.getMetadata().getNamespace());
if (!isDaemonSetPod) {
deletePod(api, pod.getMetadata().getName(), pod.getMetadata().getNamespace());
}
}
return node;
}
Expand Down
Loading