bsdpot / nomad-pot-driver

Nomad task driver for launching freebsd jails.
Apache License 2.0
84 stars 14 forks source link

Fix container stop and destroy procedure #49

Closed grembo closed 10 months ago

grembo commented 10 months ago

These commands erroneously appended taskCfg.Args to both commands, resulting in various undesirable outcomes, depending on the value if taskCfg.Args. One obvious problem is, that the appended "-F" to pot-destroy never came into effect. Args starting with "-" could also make the commands do different things or fail completely.

While investigating, I found that there are more things wrong with this (partially due to how pot handles things).

As a result, this change removes using the stop command and instead relies on calling destroy -F. Destroying the container is done exactly one (enforced using an atomic counter), so double-destroy, which happened in the past and messed up things, should not happen anymore.

While there, bump plugin version.

grembo commented 10 months ago

There's more to it, I will fix and expand this.

grembo commented 10 months ago

@pizzamig @ebarriosjr Now this should be much cleaner. I haven't tested this in our staging environment yet, but I think there is a non-zero chance this will actually fix bsdpot/pot#272

grembo commented 10 months ago

@ebarriosjr Thanks for the review