Skip to content

use non-deprecated REGISTRY_OPENSHIFT_SERVER_ADDR variable to set the registry hostname - #6830

Merged
openshift-merge-robot merged 1 commit into
openshift:masterfrom
bparees:registry_addr
Jan 24, 2018
Merged

openshift-merge-robot merged 1 commit into
openshift:masterfrom
bparees:registry_addr

Conversation

@bparees

@bparees bparees commented Jan 23, 2018

Copy link
Copy Markdown
Contributor

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 23, 2018
@bparees

bparees commented Jan 23, 2018

Copy link
Copy Markdown
Contributor Author

/hold
need to resolve some issues w/ how the registry currently processes this value.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2018
- 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'}) }}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bparees The dockerregistry configuration is backward compatible. Never needed to migrate something.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@bparees

bparees commented Jan 23, 2018

Copy link
Copy Markdown
Contributor Author

@dmage @legionus ptal

@legionus

Copy link
Copy Markdown
Contributor

LGTM

@bparees

bparees commented Jan 23, 2018

Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2018
@bparees

bparees commented Jan 23, 2018

Copy link
Copy Markdown
Contributor Author

@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'}) }}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to keep the variable with the naming scheme that we use?
How about?
OPENSHIFT_REGISTRY_SERVER_ADDR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)).

@kwoodson

Copy link
Copy Markdown
Contributor

@bparees thanks for the explanation.

@kwoodson kwoodson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with this now.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 24, 2018
@bparees

bparees commented Jan 24, 2018

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot
openshift-merge-robot merged commit 0b57e11 into openshift:master Jan 24, 2018
@openshift-ci-robot

Copy link
Copy Markdown

@bparees: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_install_crio 0da4565 link /test crio

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.

Details

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/test-infra repository. I understand the commands that are listed here.

openshift-merge-robot added a commit that referenced this pull request Jan 28, 2018
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
```
mjudeikis pushed a commit to mjudeikis/openshift-ansible that referenced this pull request Jan 29, 2018
…_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
```
@bparees
bparees deleted the registry_addr branch February 2, 2018 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants