Skip to content

Commit

Permalink
prega boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 10, 2024
1 parent 1c3ab9a commit e146b5b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
3 changes: 2 additions & 1 deletion paramfiles/prega.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: dev-preview
tag: 4.18.0-ec.1
disconnected_prega_operators:
prega: true
disconnected_operators:
- name: cluster-logging
channels:
- name: stable-6.0
Expand Down
2 changes: 1 addition & 1 deletion plans/kcli_plan_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ disconnected_operators_deploy_after_openshift: false
disconnected_certified_operators: []
disconnected_community_operators: []
disconnected_marketplace_operators: []
disconnected_prega_operators: []
disconnected_operators_version:
disconnected_certified_operators_version:
disconnected_community_operators_version:
Expand All @@ -68,6 +67,7 @@ disconnected_extra_images: []
disconnected_extra_catalogs: []
disconnected_extra_releases: []
disconnected_clean_pull_secret: false
prega: false
nfs: false
imageregistry: false
go_version: 1.13.8
Expand Down
5 changes: 3 additions & 2 deletions scripts/04_disconnected_olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cp -f /root/openshift_pull.json /root/.docker/config.json
envsubst < /root/scripts/mirror-config.yaml.sample > /root/mirror-config.yaml

rm -rf /root/oc-mirror-workspace || true
oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output || oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output || oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output
oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history --max-nested-paths 5 docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output || oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history --max-nested-paths 5 docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output || oc-mirror --config /root/mirror-config.yaml --max-per-registry 20 --ignore-history --max-nested-paths 5 docker://$LOCAL_REGISTRY > /tmp/mirror-registry-output

# When there are no new images to be mirrored, oc-mirror will not generate the icsp and catalogsource files, so we need to get them generated by ourselves
if [ $(grep -c "No new images detected" /tmp/mirror-registry-output) -eq 1 ] ; then
Expand All @@ -64,9 +64,10 @@ if [ $(grep -c "No new images detected" /tmp/mirror-registry-output) -eq 1 ] ; t
python3 /root/bin/mapping_to_icsp.py -m /root/oc-mirror-workspace/mapping.txt -o /root/oc-mirror-workspace/results-mapping/ -c /root/mirror-config.yaml
fi

{% if disconnected_prega_operators|length > 0 %}
{% if prega %}
[ ! -d /root/idms ] || rm -rf /root/idms
mkdir /root/idms
cp /root/oc-mirror-workspace/results-*/*imageContentSourcePolicy.yaml
sed -i -e '/source:/!b;/bundle/b;/cincinnati/b;s,quay.io/prega/test/,registry.redhat.io/,' /root/oc-mirror-workspace/results-*/*imageContentSourcePolicy.yaml
oc adm migrate icsp /root/oc-mirror-workspace/results-*/*imageContentSourcePolicy.yaml --dest-dir /root/idms
{% endif %}
Expand Down
35 changes: 3 additions & 32 deletions scripts/mirror-config.yaml.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{% if disconnected_prega_operators|length > 0 %}
{% set disconnected_operators = [] %}
{% endif %}
apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
storageConfig:
Expand All @@ -13,13 +10,10 @@ mirror:
# minVersion: 4.10.24
# maxVersion: 4.10.24
# graph: true
operators: # Operators we want to mirror
operators:
{% if disconnected_operators %}
{% if disconnected_operators_version %}
- catalog: registry.redhat.io/redhat/redhat-operator-index:{{ disconnected_operators_version }}
{% else %}
- catalog: registry.redhat.io/redhat/redhat-operator-index:v${OCP_RELEASE}
{% endif %}
{% set catalog = 'quay.io/prega/prega-operator-index' if prega else 'registry.redhat.io/redhat/redhat-operator-index' %}
- catalog: {{ catalog }}:{{ disconnected_operators_version or 'v${OCP_RELEASE}' }}
packages:
{% for package in disconnected_operators %}
{% if package.name is defined %}{# Comment: Support new syntax allowing to further filtering #}
Expand Down Expand Up @@ -122,29 +116,6 @@ mirror:
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_prega_operators %}
- catalog: quay.io/prega/prega-operator-index:v${OCP_RELEASE}
packages:
{% for package in disconnected_prega_operators %}
{% if package.name is defined %}
- name: {{ package.name }}
{% else %}
- name: {{ package }}
{% endif %}
{% if package.channels is defined and package.channels|length > 0 %}
channels:
{% for channel in package.channels %}
- name: {{ channel.name }}
{% if channel.minVersion is defined %}
minVersion: {{ channel.minVersion }}
{% endif %}
{% if channel.maxVersion is defined %}
maxVersion: {{ channel.maxVersion }}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if disconnected_extra_catalogs %}
{% for catalog_image in disconnected_extra_catalogs %}
- catalog: {{ catalog_image }}
Expand Down

0 comments on commit e146b5b

Please sign in to comment.