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

Fix container stop and destroy procedure #49

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

grembo
Copy link
Contributor

@grembo grembo commented Dec 21, 2023

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 grembo added the bug Something isn't working label Dec 21, 2023
@grembo grembo marked this pull request as draft December 21, 2023 17:59
@grembo
Copy link
Contributor Author

grembo commented Dec 21, 2023

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

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 grembo changed the title Fix stop and destroy commands Fix container stop and destroy procedure Dec 21, 2023
@grembo grembo marked this pull request as ready for review December 21, 2023 20:42
@grembo
Copy link
Contributor Author

grembo commented Dec 21, 2023

@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

Copy link
Contributor

@ebarriosjr ebarriosjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grembo grembo merged commit fe74493 into bsdpot:master Dec 22, 2023
@grembo
Copy link
Contributor Author

grembo commented Dec 22, 2023

@ebarriosjr Thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants