From 5847e7688566a384e1cbf45f228b26c12b20d6a2 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Fri, 23 Jan 2026 12:14:43 +0100 Subject: [PATCH 1/3] Try inline task --- .tekton/check-catalog-file-size-task.yaml | 74 ----------------------- .tekton/checks.yaml | 62 ++++++++++++++++++- 2 files changed, 60 insertions(+), 76 deletions(-) delete mode 100644 .tekton/check-catalog-file-size-task.yaml diff --git a/.tekton/check-catalog-file-size-task.yaml b/.tekton/check-catalog-file-size-task.yaml deleted file mode 100644 index 0d6c83d..0000000 --- a/.tekton/check-catalog-file-size-task.yaml +++ /dev/null @@ -1,74 +0,0 @@ -apiVersion: tekton.dev/v1 -kind: Task -metadata: - name: check-catalog-file-size - namespace: rh-acs-tenant -spec: - description: Checks the file size of the File Based Catalog files to ensure they are within acceptable limits. - params: - - name: SOURCE_ARTIFACT - description: The Trusted Artifact URI pointing to the artifact with - the application source code. This should be the result of the git-clone task, - results from other tasks might fail as dirty. - type: string - volumes: - - name: workdir - emptyDir: { } - stepTemplate: - volumeMounts: - - mountPath: /var/workdir - name: workdir - steps: - - name: use-trusted-artifact - image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:9b180776a41d9a22a1c51539f1647c60defbbd55b44bbebdd4130e33512d8b0d - args: - - use - - $(params.SOURCE_ARTIFACT)=/var/workdir/source - - name: check-catalog-file-size - image: registry.redhat.io/ubi9/ubi-minimal@sha256:7c5495d5fad59aaee12abc3cbbd2b283818ee1e814b00dbc7f25bf2d14fa4f0c - workingDir: /var/workdir/source - script: | - #!/usr/bin/env bash - set -euo pipefail - - cat <<'EOF' - Checking Catalog file sizes... - If this check fails, it means ACS likely contributes significant part to the size of the catalog image. - If we let our part of catalog grow uncontrollably, it _may_ cause problems anywhere in the supply - chain or on customers clusters. We don't know when it happens and how big the impact would be - but we don't want to be the ones who find this all out. Hence we put this check in place. - - When this check fails for you, you obviously want to proceed further with whatever important you - do. You may bump the limit just a bit to let your catalog update go through. It should be fine, we - started with somewhat conservative limits for you. Say, do +10MB or +10% limit increase. - If your update is bigger than that, it's time to stop and reconsider whatever you are doing. - - Right next after bumping the limit, you ought to pay the debt. Reach out to relevant ACS teams - (e.g., the Install team) and reach out to the OLM team to find out whether this size of the catalog - is safe or can cause issues and come up with a plan if the latter. - EOF - - # Maximum allowed file size in megabytes for catalog-bundle-object/rhacs-operator/catalog.json - max_old_format_size_mb="50" - # Maximum allowed file size in megabytes for catalog-csv-metadata/rhacs-operator/catalog.json - max_new_format_size_mb="28" - - old_format_file="catalog-bundle-object/rhacs-operator/catalog.json" - new_format_file="catalog-csv-metadata/rhacs-operator/catalog.json" - - du -h "$old_format_file" "$new_format_file" - - old_format_file_size_mb="$(stat -c %s "$old_format_file" | numfmt --to-unit=1M)" - new_format_file_size_mb="$(stat -c %s "$new_format_file" | numfmt --to-unit=1M)" - - if [[ $old_format_file_size_mb -gt $max_old_format_size_mb ]]; then - echo >&2 "ERROR: ${old_format_file} is bigger than ${old_format_file_size_mb}" - exit 1 - fi - - if [[ $new_format_file_size_mb -gt $max_new_format_size_mb ]]; then - echo >&2 "ERROR: ${new_format_file} is bigger than ${max_new_format_size_mb}" - exit 1 - fi - - echo "All catalog files are within their size limits" diff --git a/.tekton/checks.yaml b/.tekton/checks.yaml index 675c672..3fcfa56 100644 --- a/.tekton/checks.yaml +++ b/.tekton/checks.yaml @@ -127,5 +127,63 @@ spec: params: - name: SOURCE_ARTIFACT value: $(tasks.clone-repository.results.SOURCE_ARTIFACT) - taskRef: - name: check-catalog-file-size + taskSpec: + volumes: + - name: workdir + emptyDir: { } + stepTemplate: + volumeMounts: + - mountPath: /var/workdir + name: workdir + steps: + - name: use-trusted-artifact + image: quay.io/redhat-appstudio/build-trusted-artifacts:latest@sha256:9b180776a41d9a22a1c51539f1647c60defbbd55b44bbebdd4130e33512d8b0d + args: + - use + - $(tasks.clone-repository.results.SOURCE_ARTIFACT)=/var/workdir/source + - name: check-catalog-file-size + image: registry.redhat.io/ubi9/ubi-minimal@sha256:7c5495d5fad59aaee12abc3cbbd2b283818ee1e814b00dbc7f25bf2d14fa4f0c + workingDir: /var/workdir/source + script: | + #!/usr/bin/env bash + set -euo pipefail + + echo "Checking Catalog file sizes... + + If this check fails, it means ACS likely contributes significant part to the size of the catalog image. + If we let our part of catalog grow uncontrollably, it _may_ cause problems anywhere in the supply + chain or on customers clusters. We don't know when it happens and how big the impact would be + but we don't want to be the ones who find this all out. Hence we put this check in place. + + When this check fails for you, you obviously want to proceed further with whatever important you + do. You may bump the limit just a bit to let your catalog update go through. It should be fine, we + started with somewhat conservative limits for you. Say, do +10MB or +10% limit increase. + If your update is bigger than that, it's time to stop and reconsider whatever you are doing. + + Right next after bumping the limit, you ought to pay the debt. Reach out to relevant ACS teams + (e.g., the Install team) and reach out to the OLM team to find out whether this size of the catalog + is safe or can cause issues and come up with a plan if the latter. + EOF + + old_format_file="catalog-bundle-object/rhacs-operator/catalog.json" + new_format_file="catalog-csv-metadata/rhacs-operator/catalog.json" + + du -h "$old_format_file" "$new_format_file" + + old_format_file_size_mb="$(stat -c %s "$old_format_file" | numfmt --to-unit=1M)" + new_format_file_size_mb="$(stat -c %s "$new_format_file" | numfmt --to-unit=1M)" + + max_old_format_size_mb="50" + max_new_format_size_mb="28" + + if [[ "$old_format_file_size_mb" -gt "$max_old_format_size_mb" ]]; then + echo >&2 "ERROR: ${old_format_file} is bigger than ${old_format_file_size_mb}" + exit 1 + fi + + if [[ "$new_format_file_size_mb" -gt "$max_new_format_size_mb" ]]; then + echo >&2 "ERROR: ${new_format_file} is bigger than ${max_new_format_size_mb}" + exit 1 + fi + + echo "All catalog files are within their size limits" From 9739e7025e7983a93b9d9664fa468c81abc0e8f8 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Fri, 23 Jan 2026 12:17:02 +0100 Subject: [PATCH 2/3] Fix string --- .tekton/checks.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.tekton/checks.yaml b/.tekton/checks.yaml index 3fcfa56..6736d0d 100644 --- a/.tekton/checks.yaml +++ b/.tekton/checks.yaml @@ -162,8 +162,7 @@ spec: Right next after bumping the limit, you ought to pay the debt. Reach out to relevant ACS teams (e.g., the Install team) and reach out to the OLM team to find out whether this size of the catalog - is safe or can cause issues and come up with a plan if the latter. - EOF + is safe or can cause issues and come up with a plan if the latter." old_format_file="catalog-bundle-object/rhacs-operator/catalog.json" new_format_file="catalog-csv-metadata/rhacs-operator/catalog.json" From ba5f81f6a014e297288176dadfe31fa403363832 Mon Sep 17 00:00:00 2001 From: Misha Sugakov Date: Fri, 23 Jan 2026 12:19:17 +0100 Subject: [PATCH 3/3] Add a newline --- .tekton/checks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.tekton/checks.yaml b/.tekton/checks.yaml index 6736d0d..ad298b5 100644 --- a/.tekton/checks.yaml +++ b/.tekton/checks.yaml @@ -162,7 +162,8 @@ spec: Right next after bumping the limit, you ought to pay the debt. Reach out to relevant ACS teams (e.g., the Install team) and reach out to the OLM team to find out whether this size of the catalog - is safe or can cause issues and come up with a plan if the latter." + is safe or can cause issues and come up with a plan if the latter. + " old_format_file="catalog-bundle-object/rhacs-operator/catalog.json" new_format_file="catalog-csv-metadata/rhacs-operator/catalog.json"