Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
karlkfi opened this issue Feb 25, 2022 · 0 comments · Fixed by #556
Closed

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

karlkfi opened this issue Feb 25, 2022 · 0 comments · Fixed by #556

Comments

@karlkfi
Copy link
Contributor

karlkfi commented Feb 25, 2022

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.

karlkfi added a commit to karlkfi/cli-utils that referenced this issue Feb 25, 2022
- Pass TaskContext into TaskBuilder.Build
- Combine dependency graph for apply and prune objects.
  This is required to catch dependencies that would have been deleted.
- Replace graph.SortObjs into DependencyGraph + Sort + HydrateSetList
- Replace graph.ReverseSortObjs with ReverseSetList to perform on the
  combined (apply + prune) set list.
- Add planned pending applies and prune to the InventoryManager
  before executing the task queue.
  This allows the DependencyFilter to validate against the planned
  actuation strategy of objects that haven't been applied/pruned yet.
- Add the dependency graph to the TaskContext, for the
  DependencyFilter to use.
  This can be removed in the future if the filters are managed by the
  solver.
- Make Graph.Sort non-destructive, so the graph can be re-used by the
  DependencyFilter.
- Add Graph.EdgesFrom and EdgesTo for the DependencyFilter to use.
  This requires storing the reverse edge list.
- Add an e2e test for the DependencyFilter
- Add an e2e test for the LocalNamespaceFilter

Fixes kubernetes-sigs#526
Fixes kubernetes-sigs#528
Fixes kubernetes-sigs#554
@karlkfi karlkfi changed the title bug: InventoryManager.SetObjectStatus doesn't actually update the object status Bug: InventoryManager.SetObjectStatus doesn't actually update the object status Feb 25, 2022
karlkfi added a commit to karlkfi/cli-utils that referenced this issue Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant