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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for handling API errors from Podman #584

Open
lirremotus opened this issue Oct 25, 2023 · 1 comment
Open

Support for handling API errors from Podman #584

lirremotus opened this issue Oct 25, 2023 · 1 comment

Comments

@lirremotus
Copy link

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The Coder (coder.com) application makes use of this Terraform provider to interact with Docker. For the most part, when replacing Docker with Podman, this continues to work very well, which is awesome! I have noticed a small inconsistency in how error messages are reported from the Podman API vs the Docker API that causes an error to be reported in Coder (although the functionality still works), and which I believe could be easily worked around here to allow more complete replacement of Docker with Podman in some situations.

When the Docker API returns an error indicating that there is no such container, the response is "No such container". Podman returns "no such container" (lowercase). My suggestion is to make containsIgnorableErrorMessage (in internal/provider/helpers.go) lowercase the errorMsg and ignorableErrorMessages that it takes in so that the comparison would work for either case, and allow more interoperability with the Podman API.

New or Affected Resource(s)

  • This appears to affect any resource that can return the "No such container" response, although any response returned with capitalization seems likely to be affected. I noticed this specifically with the resourceDockerContainerDelete function when it waits for the container to be deleted: if !containsIgnorableErrorMessage(err.Error(), "No such container", "is already in progress") {

Potential Terraform Configuration

References

@lirremotus
Copy link
Author

It looks like #583 will resolve this issue, since it implements the changes proposed here.

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

No branches or pull requests

1 participant