Skip to content

Commit

Permalink
Fail if mirror issues (#50)
Browse files Browse the repository at this point in the history
* Fail if mirror issues
---------

Co-authored-by: Tony Garcia <[email protected]>
  • Loading branch information
betoredhat and tonyskapunk authored Nov 17, 2023
1 parent 932c125 commit 81d6ff3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
15 changes: 8 additions & 7 deletions roles/mirror_catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ Mirrors a catalog and its related images. Produces a file that can be used to se

## Role Variables

Name | Required | Default | Description
----------------|----------| --------|-------------
mc_oc_tool_path | Yes | | The path to the oc<sup>1</sup> binary, e.g. '/path/to/oc'
mc_catalog | Yes | | The Fully Qualified Artifact Reference, e.g. 'example.com/namespace/web:v1.0'
mc_registry | Yes | "" | The registry where the catalog will be mirrored, e.g. 'registry.example.com' or 'reg.example.com:4443'
mc_pullsecret | No | | The credential file to pull and/or push the images, e.g. '/path/to/pullsecret.json'
mc_is_type | No | icsp | The type of image source to use, choose between icsp (imageContentsourcePolicy) (default) or idms (imageDigestMirrorSet).
Name | Required | Type | Default | Description
--------------- | -------- | -------- | ------------
mc_oc_tool_path | Yes | string | | The path to the oc<sup>1</sup> binary, e.g. '/path/to/oc'
mc_catalog | Yes | string | | The Fully Qualified Artifact Reference, e.g. 'example.com/namespace/web:v1.0'
mc_registry | Yes | string | | The registry where the catalog will be mirrored, e.g. 'registry.example.com' or 'reg.example.com:4443'
mc_pullsecret | No | string | "" | The credential file to pull and/or push the images, e.g. '/path/to/pullsecret.json'
mc_is_type | No | string | icsp | The type of image source to use, choose between icsp (imageContentsourcePolicy) (default) or idms (imageDigestMirrorSet).
mc_continue_on_error| No | boolean | false | Continue even if there if there are errors during mirroring

<sup>1</sup> It's recommended to use a [stable version of oc](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/)

Expand Down
2 changes: 2 additions & 0 deletions roles/mirror_catalog/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
---
mc_is_type: "icsp"
mc_continue_on_error: false
...
3 changes: 2 additions & 1 deletion roles/mirror_catalog/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
state: directory
register: mc_tmp

- name: Mirror catalog manifests
- name: Mirror operators
shell:
cmd: >
set -x;
Expand All @@ -50,6 +50,7 @@
--index-filter-by-os="linux/amd64"
--insecure
--max-components=3
--continue-on-error={{ mc_continue_on_error }}
{% if mc_pullsecret is defined %}
--registry-config {{ mc_pullsecret }}
{% endif %}
Expand Down

0 comments on commit 81d6ff3

Please sign in to comment.