Skip to content

Commit

Permalink
Remove the use of wrapper script opm-auths
Browse files Browse the repository at this point in the history
The opm-auths is a wrapper script provided by dci-openshift-agent
that brings support for multi-entry registry authentication when
using opm.

The opm client lacked the functionality as reported in:
operator-framework/operator-registry#935

But lately it was added in:
operator-framework/operator-registry#1165

Now it is available in the stable ocp clients:
https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/
  • Loading branch information
tonyskapunk committed Jan 4, 2024
1 parent 63b4294 commit e715970
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 16 deletions.
3 changes: 0 additions & 3 deletions roles/create_pr/tasks/bundle_operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
chdir: "{{ work_dir }}/{{ fork_name }}/operators/{{ product_name }}"

- name: "Render bundle operator image"
vars:
opm_auths: "/usr/share/dci-openshift-agent/utils/opm-auths"
ansible.builtin.command: >
{{ opm_auths }}
{{ opm_tool_path }} render {{ operator.bundle_image }}
register: rendered_bundle
retries: 2
Expand Down
1 change: 0 additions & 1 deletion roles/fbc_catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fbc_bundles | Yes | undefined | A
fbc_expire | No | true | Whether or not to set an expiration label on the catalog
fbc_expire_time | No | 5h | The amount of time to set for the expiration label
fbc_index_image | Yes | undefined | Full reference for the image <registry>/namespace/image:tag
fbc_opm_auths | No | /usr/share/dci-openshift-agent/utils/opm-auths | Path to opm-auths a wrapper script to allow multi-regitsry auths in opm

## Requirements

Expand Down
1 change: 0 additions & 1 deletion roles/fbc_catalog/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
fbc_opm_args: ""
fbc_expire: true
fbc_expire_time: 5h
fbc_opm_auths: "/usr/share/dci-openshift-agent/utils/opm-auths"
...
2 changes: 0 additions & 2 deletions roles/fbc_catalog/tasks/add-bundle.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
- name: "Render bundle operator image"
ansible.builtin.shell: >
{{ fbc_opm_auths }}
{{ fbc_opm_cmd }} render {{ bundle }}
args:
chdir: "{{ fbc_tmp_dir }}"
Expand Down Expand Up @@ -52,7 +51,6 @@

- name: "Render bundle for {{ fbc_short_name }}"
ansible.builtin.shell: >
{{ fbc_opm_auths }}
{{ fbc_opm_cmd }} render {{ bundle }}
--output=yaml >> {{ fbc_tmp_dir }}/catalog/index.yml
args:
Expand Down
3 changes: 0 additions & 3 deletions roles/preflight/tasks/prepare_operator_metadata.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
- name: "Render bundle operator image"
vars:
opm_auths: "/usr/share/dci-openshift-agent/utils/opm-auths"
ansible.builtin.shell: >
{% if partner_creds | length %}
DOCKER_CONFIG={{ preflight_tmp_dir.path }}
{% endif %}
{{ opm_auths }}
{{ opm_tool_path }} render {{ operator.bundle_image }}
register: rendered_bundle
retries: 2
Expand Down
1 change: 0 additions & 1 deletion roles/prune_catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pc_source_catalog | Yes |
pc_destination_catalog | Yes | | Catalog containing the required operators
pc_operators | Yes | | The set of operators to keep in the pruned catalog. See examples below
pc_opm_args | No | "" | Arguments for opm command. Those will be applied globally for all opm calls
pc_opm_auths | No | /usr/share/dci-openshift-agent/utils/opm-auths| Path to opm-auths a wrapper script to allow multi-registry auths in opm
pc_expire | No | false | Whether or not to set an expiration label on the catalog
pc_expire_time | No | 5h | The amount of time to set for the expiration label
pc_maintainer | No | redhatci.ocp | Value for catalog's image maintainer label
Expand Down
1 change: 0 additions & 1 deletion roles/prune_catalog/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
pc_opm_args: ""
pc_expire: false
pc_expire_time: 5h
pc_opm_auths: "/usr/share/dci-openshift-agent/utils/opm-auths"
pc_maintainer: "redhatci.ocp"
pc_ignore_pull_errors: false
...
5 changes: 1 addition & 4 deletions roles/prune_catalog/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,11 @@
mode: "0755"

- name: "Render the source catalog"
vars:
opm_auths: "/usr/share/dci-openshift-agent/utils/opm-auths"
ansible.builtin.shell:
chdir: "{{ pc_tmp_dir }}"
cmd: >
set -x;
{{ opm_auths }}
opm render {{ pc_source_catalog }} >
{{ pc_opm_cmd }} render {{ pc_source_catalog }} >
index-packages
register: prune_result
changed_when: prune_result.rc == 0
Expand Down

0 comments on commit e715970

Please sign in to comment.