Description of problem: When --dry-run flag is enabled i see that there is no indication of that in the cluster pod logs and also user seeing the messages below might think that the pod is actually getting evicted when it is not. I0518 15:03:46.280744 1 evictions.go:99] Evicted pod: "initcontainer-db54dc85b-2szp7" in namespace "test" Version-Release number of selected component (if applicable): ramakasturinarra@dhcp35-60 ocp_files]$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.5.0-0.nightly-2020-05-17-235851 True False 3h43m Cluster version is 4.5.0-0.nightly-2020-05-17-235851 How reproducible: Always Steps to Reproduce: 1. Enable the --dry-run flag in the kubedescheduler cluster object 2. Verify that it propagates to the cluster pod by running oc describe pod <cluster-pod> 3. Add a strategy like toomanyrestarts Actual results: Descheduler does not evict anything since --dry-run flag is enabled but the cluster logs shows that the pod is actually evicted even if it is not. I0518 15:03:46.280744 1 evictions.go:99] Evicted pod: "initcontainer-db54dc85b-2szp7" in namespace "test" Expected results: There should be a indication in the log which says that this is a dry run. Additional info:
Upstream PR: https://github.com/kubernetes-sigs/descheduler/pull/287
Verified bug with the payload below and i see that when ever dry run is enabled cluster logs indicate that "Evicted pod in dry run mode: <pod_name> in namespace <name>" [ramakasturinarra@dhcp35-60 ~]$ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.5.0-0.nightly-2020-05-27-234738 True False 9h Cluster version is 4.5.0-0.nightly-2020-05-27-234738 However for some of the strategies when dry run is enabled two log messages are shown where in which first one indicates it is a dry run but second one shows the pod is evicted and this might be creating confusion for the user, raised another bug(https://bugzilla.redhat.com/show_bug.cgi?id=1841187) to get this fixed and moving this to verified since the motto of this bug was to make sure that when in dry-run cluster logs are printed saying pods are getting evicted in dry run which works. Based on the above results moving the bug to verified state.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:2409