-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
bad --insecure-registry values cause: Job for docker.service failed because the control process exited with error code. #8790
Comments
Yeah, we should probably do a sanity check for URL parameters. Help wanted! |
@sharifelgamal I've been looking at a validation function. Are these all the supported formats for the registry or am I missing something?
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@kadern0 - I did some digging and discovered that we pass the value directly to dockerd's
That suggests to me that the only valid forms should be:
I can confirm that this bug still occurs at master. Honestly, you could probably solve 95% of issues by providing a regular expression that asserts that the value contains only alphanumerics, slashes, colons, dashes, square brackets, or dots (basically: DNS, IPv4, IPv6, or CIDR) |
Thanks for your answer, @tstromberg. This should be easy to achieve with regular expressions although it might be interesting looking at using some validator within the ClusterConfig struct although this change will be bigger. I mention this because it seems to me this function is not 100% correct since it won't reject some malformed URLs (like this "http://;;..,,----__???**"): minikube/cmd/minikube/cmd/start.go Line 1108 in 129eefd
With the validator in place, many validation functions could be either removed or simplified. |
@tstromberg, this one is fixed by #9977 |
Hello, would it be possible to also consider IP and hostname in the regexp without having to mention a port ? In our situation, until 1.17, we were using --insecure-registry dockerhub.example.com in our CI/CD with all K8S manifests pointing to docker images built with tag of kind dockerhub.example.com/xxx/yyy With 1.17+, to pass the validation, I have to set --insecure-registry dockerhub.example.com:80 (which means the same thing) but the result is that no K8S pod can start as images with tag of kind dockerhub.example.com/xxx/yyy are tried to be pulled in a secure way because it does not precisely match the insecure registry setting which contain the port... Changing all the jobs that build our docker images in order to add port 80 to the tag is not really an option as we would like to keep consistency in our tags (as they are parsed by some other internal tools we have) Thanks ! |
@tstromberg it seems we might need to update the validation fuction according to docker's insecure registry validation (port is not mandatory): Do you agree? |
Steps to reproduce the issue:
Full output of failed command:
Full output of
minikube start
command used, if not already included:🔥 virtualbox VM (CPUs=2, Memory=3900MB, Disk=20000MB) 를 생성하는 중 ...
😿 Failed to start virtualbox VM. "minikube start" may fix it: creating host: create: provisioning: ssh command error:
command : sudo diff -u /lib/systemd/system/docker.service /lib/systemd/system/docker.service.new || { sudo mv /lib/systemd/system/docker.service.new /lib/systemd/system/docker.service; sudo systemctl -f daemon-reload && sudo systemctl -f enable docker && sudo systemctl -f restart docker; }
err : Process exited with status 1
output : diff: can't stat '/lib/systemd/system/docker.service': No such file or directory
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
❌ [DOCKER_RESTART_FAILED] error provisioning host Failed to start host: creating host: create: provisioning: ssh command error:
command : sudo diff -u /lib/systemd/system/docker.service /lib/systemd/system/docker.service.new || { sudo mv /lib/systemd/system/docker.service.new /lib/systemd/system/docker.service; sudo systemctl -f daemon-reload && sudo systemctl -f enable docker && sudo systemctl -f restart docker; }
err : Process exited with status 1
output : diff: can't stat '/lib/systemd/system/docker.service': No such file or directory
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
💡 Suggestion: Remove the incompatible --docker-opt flag if one was provided
⁉️ Related issue: #7070
What I expect
minikube start --insecure-registry=$REGISTRY_IP:$REGISTRY_PORT
, but those env was not enrolled in bash.--insecure-registry "localhost:5000"
before creating local registry does not failed in current versionversion info
The text was updated successfully, but these errors were encountered: