Bug 1274134
| Summary: | "--insecure-registry" flag for "oc new-app" doesn't work without running docker daemon | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Kenjiro Nakayama <knakayam> |
| Component: | Build | Assignee: | Ben Parees <bparees> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Wenjing Zheng <wzheng> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 3.0.0 | CC: | aos-bugs, bparees, dmcphers, knakayam, wewang |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-23 14:25:44 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Kenjiro Nakayama
2015-10-22 03:34:52 UTC
* Root cause is here, InsecureRegistry option will not set if docker daemon is not running.
- ./pkg/cmd/cli/cmd/newapp.go
~~~~
dockerClient, _, err := dockerutil.NewHelper().GetClient()
if err == nil {
if err = dockerClient.Ping(); err == nil {
config.SetDockerClient(dockerClient)
}
}
if err != nil {
glog.V(2).Infof("No local Docker daemon detected: %v", err)
}
~~~
- ./pkg/generate/app/cmd/newapp.go
~~~
// SetDockerClient sets the passed Docker client in the application configuration
func (c *AppConfig) SetDockerClient(dockerclient *docker.Client) {
c.dockerSearcher = app.DockerClientSearcher{
Client: dockerclient,
RegistrySearcher: c.dockerRegistrySearcher(),
Insecure: c.InsecureRegistry,
}
}
~~~~
Kenjiro, the insecure registry option should be used in the registry client, even if the docker daemon is not set:
- ./pkg/generate/app/cmd/newapp.go
~~~
func (c *AppConfig) dockerRegistrySearcher() app.Searcher {
return app.DockerRegistrySearcher{
Client: dockerregistry.NewClient(),
AllowInsecure: c.InsecureRegistry,
}
}
func (c *AppConfig) ensureDockerSearcher() {
if c.dockerSearcher == nil {
c.dockerSearcher = c.dockerRegistrySearcher()
}
}
~~~
Would it be possible to try with the latest version of the origin oc binary as the client and --loglevel=8? We should have more information now, including whether the connection to the registry is made securely or insecurely.
Cesar,
> Would it be possible to try with the latest version of the origin oc binary as the client and --loglevel=8? We should have more information now, including whether the connection to the registry is made securely or insecurely.
I have already told the customer the workaround (running docker daemon). So I will setup it by myself and inform you.
Please allow me some time.
Thank you. It looks like I don't need ot provide the information. nope, should be fixed now. This fix is available in OpenShift Enterprise 3.1. |