kubernetes-sigs / cli-utils

This repo contains binaries that built from libraries in cli-runtime.
Apache License 2.0
154 stars 77 forks source link

Bug: InventoryManager.SetObjectStatus doesn't actually update the object status #554

Closed karlkfi closed 2 years ago

karlkfi commented 2 years ago

Critical bug in InventoryManager.SetObjectStatus means that none of the calls to SetObjectStatus actually work. Surprisingly this still passes tests, but it's likely that the status output is wrong in many cases.

https://github.com/kubernetes-sigs/cli-utils/blob/master/pkg/inventory/manager.go#L68-L76

The objStatus input variable is being shaddowed by the for loop.

Because of the scoping of the for loop, the bug only applies if the object status was already set. This is probably why it hasn't failed tests. But this will change is we add planned pending actuations before the aply/prune task.