-
Notifications
You must be signed in to change notification settings - Fork 4.8k
registry: allow to override the DOCKER_REGISTRY_URL and default to in… #14882
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
Conversation
|
[test] |
| return nil, fmt.Errorf("%s variable must be set when running outside Kubernetes cluster", DockerRegistryURLEnvVar) | ||
| } | ||
| } | ||
| context.GetLogger(ctx).Infof("Using %q as Docker Registry URL", registryAddr) |
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.
this will help with debuging :-)
|
@smarterclayton && others: why we have two variables here |
|
[testextended][extended:core(registry|imageapi|ImagePrune|ImageQuota)] |
| if len(os.Getenv("DOCKER_REGISTRY_SERVICE_HOST")) > 0 && len(os.GetEnv("DOCKER_REGISTRY_SERVICE_PORT")) > 0 { | ||
| registryAddr = os.Getenv("DOCKER_REGISTRY_SERVICE_HOST") + ":" + os.Getenv("DOCKER_REGISTRY_SERVICE_PORT") | ||
| } else { | ||
| return nil, fmt.Errorf("%s variable must be set when running outside Kubernetes cluster", DockerRegistryURLEnvVar) |
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.
outside of
552dc6e to
29dc955
Compare
|
@miminar made one more change. I deprecated the REGISTRY_DEFAULT_URL in favor of OPENSHIFT_DEFAULT_REGISTRY (i kept the old there for backward compatibility, but with warning). I also updated both Dockerfiles and tests. |
|
If for some reason OPENSHIFT_DEFAULT_REGISTRY is not set this will still work based on IP, correct? Just want to make sure we can back out any changes in the installer at the last minute and still expect the old behavior to work. |
| context.GetLogger(ctx).Infof("DEPRECATED: %q is deprecated, use the %q instead", DockerRegistryURLEnvVar, OpenShiftDefaultRegistry) | ||
| } | ||
| if len(registryAddr) == 0 { | ||
| if len(os.Getenv("DOCKER_REGISTRY_SERVICE_HOST")) > 0 && len(os.GetEnv("DOCKER_REGISTRY_SERVICE_PORT")) > 0 { |
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.
This is somewhat challenging in the future - we don't want to call the service "docker-registry" forever. I expect both name of service and location of service to change in the future. Also, this is something that we typically inject, vs hardcoding. However, since it's a fallback, I'm ok with it. Leave a TODO "this may change"
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.
sure, added todo. if this change we can still use the OPENSHIFT_DEFAULT_REGISTRY to set the hostname and the port as env variable.
|
compilation failure... re-[test]-ing |
|
Evaluated for origin test up to 84a6d02 |
Yes, this has a fallback so nothing should break. If that variable is set for registry then the registry should create image streams with that URL (which should fix the BZ?). I think there might be a change needed on ansible side where we set that var for the registry (in registry DC). So we have to set it on two places (for master and for registry). With this PR both vars should have the same name for the sake of consistency. |
|
@miminar extended test passed :-) |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2680/) (Base Commit: 247631a) (PR Branch Commit: 84a6d02) |
because they don't utilize the dns name? 😄 |
|
@miminar but it proves it does not break anything ;-) i'm going to run some tests locally |
|
Evaluated for origin testextended up to 84a6d02 |
|
continuous-integration/openshift-jenkins/testextended FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin_extended/760/) (Base Commit: bbb9647) (PR Branch Commit: 84a6d02) (Extended Tests: core(registry|imageapi|ImagePrune|ImageQuota)) |
|
Ha .. I told you that extended tests need to be updated before merging #13428: Update: should be fixed in #14509 |
|
@miminar tested locally and it seems to work :-) i can see the docker-registry DNS in image streams after build/etc. guess we are safe to merge? |
|
@smarterclayton @bparees @jim-minter THIS is causing the new-app flake. See: https://gist.github.com/mfojtik/7720890674d2e7927ee00b3b25e090ca We need this in and updated playbook to set this variable for our registry cc / @sdodson [merge][severity:blocker] |
|
Good catch! Do we need #14509 before this is merged? |
|
Evaluated for origin merge up to 84a6d02 |
|
@Kargakis i don't think so |
|
@mfojtik just to be clear, this is all I should be setting, correct? |
|
@sdodson after this PR, yes (you have to set it for docker-registry DC, so the pod runs with this var set). You can then check the docker-registry pod log if it runs with proper registry url. |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1185/) (Base Commit: faae9ac) (PR Branch Commit: 84a6d02) (Extended Tests: blocker) (Image: devenv-rhel7_6413) |
Attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=1463499 and ublock the possiblity of using DNS for the registry.