Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change UpdateZarfAgentValues to rolling restart (#2644)
## Description This PR splits out a refactor that was done in #2625 #2625 (comment) Here is some context for why I refactored `UpdateZarfAgentValues`. In our e2e test suite, `TestConnectAndCreds` runs `zarf tools update-creds --confirm`. `update-creds` calls `UpdateZarfAgentValues` which used to delete all agent pods manually based on label selector and immediately return without waiting for the pods to be ready. `TestMetrics` is ran immediately after `TestConnectAndCreds`, and it attempts to establish a tunnel connection to the Zarf agent to test the /metrics endpoint. This test was failing because there were no running agent pods yet after deleting them. This is not a problem in our tests right now because we run assertions against the logging stack in the cluster in `TestConnectAndCreds`, which buys us enough time for the agent pods to come back up and running. I refactored `UpdateZarfAgentValues` to perform a rolling update of the agent deployment by modifying the Pod template rather than manually deleting pods, and added a wait to ensure the agent deployment is ready before returning. This approach ensures a controlled and graceful update process managed by Kubernetes and simplifies the code. Co-authored-by: Austin Abro <[email protected]>
- Loading branch information