From b840fd6780df050226c568e0da87b55856e9259d Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 11 Jul 2022 14:27:43 +0300 Subject: [PATCH 1/4] feat: add flag to run script Signed-off-by: Anatolii Bazko --- .../snip_preparing-images-for-a-restricted-environment.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc index 1a040d81cf..11f307acf9 100644 --- a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc +++ b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc @@ -40,6 +40,7 @@ $ bash prepare-restricted-environment.sh \ --prod_operator_bundle_name "{prod-operator-bundle-name}" \ --prod_operator_package_name "{prod-operator-package-name}" \ --prod_operator_version "v{prod-ver-patch}" \ - --my_registry "____" + --my_registry "____" \ + --my-catalog "____" ---- From 2fdbcec4797e6b2fe38429398ab41de7265b4588 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 15 Jul 2022 16:00:32 +0300 Subject: [PATCH 2/4] feat: Improve prepare-restricted-environment.sh script not to upload unnecessary images Signed-off-by: Anatolii Bazko --- .../prepare-restricted-environment.sh | 17 +++++------------ ...ing-images-for-a-restricted-environment.adoc | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/administration-guide/attachments/restricted-environment/prepare-restricted-environment.sh b/modules/administration-guide/attachments/restricted-environment/prepare-restricted-environment.sh index bc1fcf56da..b91e21737c 100644 --- a/modules/administration-guide/attachments/restricted-environment/prepare-restricted-environment.sh +++ b/modules/administration-guide/attachments/restricted-environment/prepare-restricted-environment.sh @@ -31,7 +31,6 @@ declare devworkspace_operator_index="${devworkspace_operator_index:?Define the v declare devworkspace_operator_package_name="devworkspace-operator" declare devworkspace_operator_version="${devworkspace_operator_version:?Define the variable}" declare prod_operator_index="${prod_operator_index:?Define the variable}" -declare prod_operator_bundle_name="${prod_operator_bundle_name:?Define the variable}" declare prod_operator_package_name="${prod_operator_package_name:?Define the variable}" declare prod_operator_version="${prod_operator_version:?Define the variable}" @@ -46,24 +45,18 @@ mkdir -p "${my_catalog}/${devworkspace_operator_package_name}" "${my_catalog}/${ echo "Fetching metadata for the ${devworkspace_operator_package_name} operator catalog channel, packages, and bundles." opm render "${devworkspace_operator_index}" \ | jq "select(\ - .name == \"${devworkspace_operator_package_name}\" \ - or .package == \"${devworkspace_operator_package_name}\" \ + .name == \"${devworkspace_operator_package_name}.${devworkspace_operator_version}\" \ + and .schema == \"olm.bundle\" \ )" \ > "${my_catalog}/${devworkspace_operator_package_name}/render.json" -# FIXME: filter only the required version to limit the number of related images to mirror. - # or (.package == \"${devworkspace_operator_package_name}\" and .schema == \"olm.channel\" ) \ - # or .name == \"${devworkspace_operator_package_name}.${devworkspace_operator_version}\" \ echo "Fetching metadata for the ${prod_operator_package_name} operator catalog channel, packages, and bundles." opm render "${prod_operator_index}" \ | jq "select(\ - .name == \"${prod_operator_package_name}\" \ - or .package == \"${prod_operator_package_name}\" \ + .name == \"${prod_operator_package_name}.${prod_operator_version}\" \ + and .schema == \"olm.bundle\" \ )" \ > "${my_catalog}/${prod_operator_package_name}/render.json" -# FIXME: filter only the required version to limit the number of related images to mirror. - # or (.package == \"${prod_operator_package_name}\" and .schema == \"olm.channel\" ) \ - # or .name == \"${prod_operator_bundle_name}.${prod_operator_version}\" \ echo "Creating the catalog dockerfile." if [ -f "${my_catalog}.Dockerfile" ]; then @@ -106,7 +99,7 @@ apiVersion: org.eclipse.che/v2 spec: containerRegistry: hostname: "$my_registry" - organization: "${my_catalog}" + organization: "$my_catalog" EOF echo "Removing index image from mappings.txt to prepare mirroring." diff --git a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc index 11f307acf9..842a2c1356 100644 --- a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc +++ b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc @@ -37,7 +37,6 @@ $ bash prepare-restricted-environment.sh \ --devworkspace_operator_index "{devworkspace-operator-index}" \ --devworkspace_operator_version "v{devworkspace-operator-version-patch}" \ --prod_operator_index "{prod-operator-index}" \ - --prod_operator_bundle_name "{prod-operator-bundle-name}" \ --prod_operator_package_name "{prod-operator-package-name}" \ --prod_operator_version "v{prod-ver-patch}" \ --my_registry "____" \ From d870c94f790af5865614b492a3703cf8e7b41327 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 15 Jul 2022 16:02:59 +0300 Subject: [PATCH 3/4] Fixups Signed-off-by: Anatolii Bazko --- .../snip_preparing-images-for-a-restricted-environment.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc index 842a2c1356..feb4a37d00 100644 --- a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc +++ b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc @@ -40,6 +40,6 @@ $ bash prepare-restricted-environment.sh \ --prod_operator_package_name "{prod-operator-package-name}" \ --prod_operator_version "v{prod-ver-patch}" \ --my_registry "____" \ - --my-catalog "____" + --my_catalog "____" ---- From e196194d6c99f3095289dfc3966d7a4fe533b7e2 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 19 Jul 2022 10:58:34 +0300 Subject: [PATCH 4/4] Update modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc Co-authored-by: Max Leonov --- .../snip_preparing-images-for-a-restricted-environment.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc index feb4a37d00..61cb457274 100644 --- a/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc +++ b/modules/administration-guide/partials/snip_preparing-images-for-a-restricted-environment.adoc @@ -40,6 +40,6 @@ $ bash prepare-restricted-environment.sh \ --prod_operator_package_name "{prod-operator-package-name}" \ --prod_operator_version "v{prod-ver-patch}" \ --my_registry "____" \ - --my_catalog "____" + --my_catalog "____" ----