Repository navigation
use non-deprecated REGISTRY_OPENSHIFT_SERVER_ADDR variable to set the registry hostname - #6830
Conversation
|
/hold |
| - name: Update registry environment variables when pushing via dns | ||
| set_fact: | ||
| openshift_hosted_registry_env_vars: "{{ openshift_hosted_registry_env_vars | combine({'OPENSHIFT_DEFAULT_REGISTRY':'docker-registry.default.svc:5000'}) }}" | ||
| openshift_hosted_registry_env_vars: "{{ openshift_hosted_registry_env_vars | combine({'REGISTRY_OPENSHIFT_SERVER_ADDR':'docker-registry.default.svc:5000'}) }}" |
There was a problem hiding this comment.
@sdodson we need a way to remove the old value (OPENSHIFT_DEFAULT_REGISTRY) from the set of env vars because the old value takes precedence over the new value. Is there any example of how to do that?
There was a problem hiding this comment.
This code would only be invoked during an initial install. If we need to migrate from the old variable to the new variable we'll need to add a specific task to migrate that.
@kwoodson do we have an easy method to remove an env_var from a DC?
There was a problem hiding this comment.
we don't need to migrate (we continue to support the old value).
So if this is only going to run on new installs, then i think this is fine.
Do we currently have any code that attempts to migrate registry config/env today?
There was a problem hiding this comment.
@bparees The dockerregistry configuration is backward compatible. Never needed to migrate something.
There was a problem hiding this comment.
The only thing we're doing with the registry today during upgrade is updating the image tag to correspond to the upgraded version which triggers a re-deploy. I think back in 3.0/3.1 we made slight tweaks during upgrade but that code is long since dead.
There was a problem hiding this comment.
@legionus there would be a need to migrate if we're setting the new value and the old value is already set, and the user sets the new value to something different. Their change will not take effect.
Since the deprecated key always takes precedence, that means that installer must always maintain the deprecated key on existing installs.
Anyway it's moot since apparently we don't ever "update" the registry's configuration today. But if at some point we did want to update the registry's config during the ansible playbook run, we'd have to ensure we carried the deprecated key forward(updated it to the new value) or deleted it entirely so it was not used anymore.
|
LGTM |
|
/hold cancel |
|
@sdodson i guess this is ready for sign off |
| - name: Update registry environment variables when pushing via dns | ||
| set_fact: | ||
| openshift_hosted_registry_env_vars: "{{ openshift_hosted_registry_env_vars | combine({'OPENSHIFT_DEFAULT_REGISTRY':'docker-registry.default.svc:5000'}) }}" | ||
| openshift_hosted_registry_env_vars: "{{ openshift_hosted_registry_env_vars | combine({'REGISTRY_OPENSHIFT_SERVER_ADDR':'docker-registry.default.svc:5000'}) }}" |
There was a problem hiding this comment.
Is it possible to keep the variable with the naming scheme that we use?
How about?
OPENSHIFT_REGISTRY_SERVER_ADDR
There was a problem hiding this comment.
Sorry, this variable name is dictated by some docker distribution config conventions, we can't change it (also I really wouldn't want to introduce yet another supported variable name... we've already shipped support for 3 different variable names for this config setting (so we have 2 deprecated ones)).
|
@bparees thanks for the explanation. |
kwoodson
left a comment
There was a problem hiding this comment.
I'm good with this now.
/lgtm
|
/retest |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
Automatic merge from submit-queue. |
|
@bparees: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
Automatic merge from submit-queue. Revert "use non-deprecated REGISTRY_OPENSHIFT_SERVER_ADDR variable to set the registry hostname" Reverts #6830 @dmage @legionus the registry does not appear to actually respect this value properly: ``` $ oc logs docker-registry-1-knwnf -n default | grep URL time="2018-01-28T03:00:12.310853118Z" level=info msg="Using \"172.30.183.222:5000\" as Docker Registry URL" go.version=go1.9.2 instance.id=a82b7ca8-0b55-4567-92ef-2c1744e6074a $ oc get pod docker-registry-1-knwnf -o yaml | grep -A 2 ADDR -- - name: REGISTRY_OPENSHIFT_SERVER_ADDR value: docker-registry.default.svc:5000 ```
…_addr Automatic merge from submit-queue. Revert "use non-deprecated REGISTRY_OPENSHIFT_SERVER_ADDR variable to set the registry hostname" Reverts openshift#6830 @dmage @legionus the registry does not appear to actually respect this value properly: ``` $ oc logs docker-registry-1-knwnf -n default | grep URL time="2018-01-28T03:00:12.310853118Z" level=info msg="Using \"172.30.183.222:5000\" as Docker Registry URL" go.version=go1.9.2 instance.id=a82b7ca8-0b55-4567-92ef-2c1744e6074a $ oc get pod docker-registry-1-knwnf -o yaml | grep -A 2 ADDR -- - name: REGISTRY_OPENSHIFT_SERVER_ADDR value: docker-registry.default.svc:5000 ```
bug 1537593
https://bugzilla.redhat.com/show_bug.cgi?id=1537593