-
Notifications
You must be signed in to change notification settings - Fork 37
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
kind clusters: replace docker-cli commands with Docker Engine Go Client to improve podman compatibility #540
kind clusters: replace docker-cli commands with Docker Engine Go Client to improve podman compatibility #540
Conversation
Welcome @chzar! It looks like this is your first PR to knative-extensions/kn-plugin-quickstart 🎉 |
Hi @chzar. Thanks for your PR. I'm waiting for a knative-extensions member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
f4f1a30
to
0bdaaf1
Compare
0bdaaf1
to
9f08901
Compare
Thanks for the PR! You'll need to sign the CLA before we can merge this. |
Signed, sealed, delivered. |
When trying this with podman, I got the following error:
I don't use podman on a regular basis, so not sure if regular podman users would already have a workaround for the port issue or if we should think about changing the host port on the cluster... With docker, everything worked fine. |
I am on macOS and using podman machine so kind works out of the box. Perhaps changing to port 8080 or 9000 would be more appropriate for a test/demo setup? |
Yeah, I think that makes sense... would you want to do that change too? |
Sure. I can make a separate PR. This change should work for all MacOS/Windows users of docker/podman. For Linux users, the restrictions on binding Port 80 have always been present for both docker and podman - so nothing is broken that wasn't so before. |
func deleteContainerRegistry() *exec.Cmd { | ||
return exec.Command("docker", "rm", "-f", container_reg_name, "&&", "||", "true") | ||
func deleteContainerRegistry(dcli *dclient.Client) error { | ||
if err := dcli.ContainerRemove(context.Background(), container_reg_name, container.RemoveOptions{Force: true}); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to check if a registry container is running first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it matter if the container was running or stopped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, shouldn't have used the word "running" in my original comment... the issue isn't whether the registry container is running or stopped but rather if it exists or not.
Because the deleteContainerRegistry()
method now returns an error, the whole quickstart will fail if the registry container doesn't exist.
$ ./kn-quickstart kind --registry
Running Knative Quickstart using Kind
✅ Checking dependencies...
Kind version is: 0.23.0
💽 Installing local registry...
Pulling from library/registry: 2
Digest: sha256:ac0192b549007e22998eb74e8d8488dcfe70f1489520c3b144a6047ac5efbe90: %!s(<nil>)
Status: Image is up to date for registry:2: %!s(<nil>)
Error: creating cluster: failed to delete local registry: failed remove registry container: Error response from daemon: No such container: kind-registry
whereas before quickstart wouldn't fail when trying to delete a non-existent registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I follow you. I will improve the error handling such that it does not return an error in this case instead of trying to check for the existence of the registry prior to deletion. It's possible that the registry container is deleted by another client prior to my delete container api call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chzar, psschwei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
Replaced the docker-cli commands in kind.go with github.com/docker/docker/client
/kind enhancement
Fixes #408
Fixes #528
Release Note
Docs