forked from Hithomelabs/CFTunnels
Set Prune=true in redeployGitStack to fix container name conflict on redeploy #6
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/prune-containers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When portainer-automation redeploys the CFTunnels stack on Portainer, Docker returns a container name conflict because the existing container isn't removed first. This fix sets
Prune: truein the redeploy request body so Portainer removes the old containers before creating new ones.Changes
common/src/main/java/com/hithomelabs/common/portainer/client/PortainerApiClient.javaredeployGitStack, the second parameter toPortainerRedeployRequestconstructor changed fromfalsetotrue, setting thePrunefield totruein the JSON body sent to Portainer's API.Testing
Checkout
From your project repository, check out a new branch and test the changes.