DataDog / extendeddaemonset

Kubernetes Extended Daemonset controller
Apache License 2.0
98 stars 13 forks source link

[controllers/eds] Fix "available" and "up to date" in `get eds` #127

Closed davidor closed 3 years ago

davidor commented 3 years ago

What does this PR do?

Fixes the "available" and "up to date" values in the kubectl get eds output.

"Available" should equal the sum of "available" of the active replica and the canary. There was a case where this was not working. When the canary duration expired and it became the active replica, "available" didn't take into account the replicas of the old set that were still there.

This PR also fixes a bug in the "Up to date" values. When there's a canary, "Up to date" should equal the number of replicas in the canary, but the code was adding the current ones plus the canary.

Notice that the base branch of this PR is v0.7

Describe your test plan

Set up a cluster with more than 1 worker node. You can use kind for that.

Deploy the example EDS: kubectl apply -f examples/foo-eds_v1.yaml.

Run kubectl get eds --watch and kubectl get ers --watch. And wait until all the desired replicas are available.

Deploy the v2 of the example kubectl apply -f examples/foo-eds_v2.yaml (Adjust the timeout so you don't have to wait for 5 minutes). Check these 2 things: