Bug 1367284 - rootdirectory configuration is hardcode when installer is using s3 as registry storage
Summary: rootdirectory configuration is hardcode when installer is using s3 as registr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Andrew Butcher
QA Contact: Johnny Liu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-16 06:33 UTC by Johnny Liu
Modified: 2017-03-08 18:26 UTC (History)
3 users (show)

Fixed In Version: openshift-ansible-3.3.26-1.git.0.f4e82a4.el7
Doc Type: Bug Fix
Doc Text:
Previously, the rootdirectory for S3 docker registry storage was hard coded in registry configuration. A new variable has been added to modify the S3 rootdirectory, eg. `openshift_hosted_registry_storage_s3_rootdirectory=/mydirectory` with a default value of `/registry`.
Clone Of:
Environment:
Last Closed: 2016-10-03 14:52:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1983 0 normal SHIPPED_LIVE OpenShift Container Platform 3.3 atomic-openshift-utils bug fix update 2016-10-03 18:51:38 UTC

Description Johnny Liu 2016-08-16 06:33:53 UTC
Description of problem:
Go through /usr/share/ansible/openshift-ansible/roles/openshift_hosted/templates/registry_config.j2:
{% if openshift.hosted.registry.storage.provider == 's3' %}
  s3:
    accesskey: {{ openshift.hosted.registry.storage.s3.accesskey }}
    secretkey: {{ openshift.hosted.registry.storage.s3.secretkey }}
    region: {{ openshift.hosted.registry.storage.s3.region }}
    bucket: {{ openshift.hosted.registry.storage.s3.bucket }}
    encrypt: false
    secure: true
    v4auth: true
    rootdirectory: /registry
    chunksize: "{{ openshift.hosted.registry.storage.s3.chunksize | default(26214400) }}"

The rootdirectory is hardcode to "/registry", it should be customized by  user.


Version-Release number of selected component (if applicable):
openshift-ansible-roles-3.3.11-1.git.4.eac15df.el7.noarch

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 openshift-github-bot 2016-09-09 20:37:08 UTC
Commit pushed to master at https://github.com/openshift/openshift-ansible

https://github.com/openshift/openshift-ansible/commit/6bf9b60c0e5be8ee9aa2f9bc76cdf5bbfac632b1
Merge pull request #2428 from abutcher/s3-rootdirectory

Bug 1367284 - rootdirectory configuration is hardcode when installer is using s3 as registry storage

Comment 3 Johnny Liu 2016-09-20 05:30:25 UTC
No available puddle build came out yet, waiting for new puddle include the fix.

Comment 4 Johnny Liu 2016-09-21 07:38:22 UTC
Re-test this bug with openshift-ansible-3.3.25-1.git.0.56ee824.el7, and Fail.

Seem like the above PR is not merged into the RPM.

# vi roles/openshift_hosted/templates/registry_config.j2
<--snip-->
{% if openshift.hosted.registry.storage.provider == 's3' %}
  s3:
    accesskey: {{ openshift.hosted.registry.storage.s3.accesskey }}
    secretkey: {{ openshift.hosted.registry.storage.s3.secretkey }}
    region: {{ openshift.hosted.registry.storage.s3.region }}
    bucket: {{ openshift.hosted.registry.storage.s3.bucket }}
    encrypt: false
    secure: true
    v4auth: true
    rootdirectory: /registry
    chunksize: "{{ openshift.hosted.registry.storage.s3.chunksize | default(26214400) }}"
<--snip-->

# rpm -qf roles/openshift_hosted/templates/registry_config.j2
openshift-ansible-roles-3.3.25-1.git.0.56ee824.el7.noarch

Comment 5 Scott Dodson 2016-09-21 21:12:08 UTC
Sorry, I missed that commit. Updated build in the puddle now.

Comment 6 Johnny Liu 2016-09-22 08:37:53 UTC
Verified this bug with openshift-ansible-3.3.26-1.git.0.f4e82a4.el7, and PASS.


Set the following line in inventory host file:
openshift_hosted_registry_storage_s3_rootdirectory=/installtest



# oc rsh docker-registry-2-tiuq9
sh-4.2$ cat /etc/registry/config.yml 
version: 0.1
log:
  level: debug
http:
  addr: :5000
storage:
  cache:
    blobdescriptor: inmemory
  s3:
    accesskey: xxxx
    secretkey: xxxx
    region: us-east-1
    bucket: yyyy
    encrypt: false
    secure: true
    v4auth: true
    rootdirectory: /installtest
    chunksize: "26214400"
auth:
  openshift:
    realm: openshift
middleware:
  registry:
  - name: openshift
  repository:
  - name: openshift
    options:
      pullthrough: True
  storage:
  - name: openshift


Trigger a sti build, image is pushed to the s3 bucket's correct dir successfully.

Comment 8 errata-xmlrpc 2016-10-03 14:52:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1983


Note You need to log in before you can comment on or make changes to this bug.