Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ Depends on `tag` as some tests might need to have the images tagged (s2i).
Similar to `make test` but runs testsuite for container by PyTest, expected to be found at
`$gitroot/$version/test/run-pytest`


`make test-openshift-4`
Similar to `make test` but runs testsuite for Openshift 4, expected to be found at
`$gitroot/$version/test/run-openshift-remote-cluster`

`make test-openshift-pytest`
Similar to `make test` but runs PyTest test suite `https://github.com/sclorg/container-ci-suite` for Openshift 4,
expected to be found at `$gitroot/$version/test/run-openshift-pytest`
Expand Down Expand Up @@ -101,7 +96,7 @@ Dockerfile for the scripts to know which versions to build.

`OS`
OS version you want to build the images for. Currently, the scripts are able to build for
c9s, c10s, rhel8, rhel9, rhel10, and fedora.
c9s, c10s, c11s, rhel8, rhel9, rhel10, rhel11, and fedora.

`SKIP_SQUASH`
When set to 1 the build script will skip the squash phase of the build.
Expand Down Expand Up @@ -171,7 +166,6 @@ Dependencies for testsuite:

- /usr/bin/docker (either `docker` or `podman` + `podman-docker`)
- git
- go-md2man
- make
- source-to-image
- shellcheck
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script is used to build the OpenShift Docker images.
#
# OS - Specifies distribution - "rhel8", "rhel9", "rhel10", "c9s", "c10s" or "fedora"
# OS - Specifies distribution - "rhel8", "rhel9", "rhel10", "rhel11", "c9s", "c10s" or "fedora"
# VERSION - Specifies the image version - (must match with subdirectory in repo)
# SINGLE_VERSION - Specifies the image version - (must match with subdirectory in repo)
# VERSIONS - Must be set to a list with possible versions (subdirectories)
Expand Down Expand Up @@ -170,7 +170,7 @@ function docker_build_with_version {
# Errors during downloading metadata for repository 'rhel-9-for-x86_64-appstream-rpms':
# - Curl error (56): Failure when receiving data from the peer for https:// [Received HTTP code 503 from proxy after CONNECT]
# Error: Failed to download metadata for repo 'rhel-9-for-x86_64-appstream-rpms':
if [[ "${OS}" == "rhel8" ]] || [[ "${OS}" == "rhel9" ]] || [[ "${OS}" == "rhel10" ]]; then
if [[ "${OS}" == "rhel8" ]] || [[ "${OS}" == "rhel9" ]] || [[ "${OS}" == "rhel10" ]] || [[ "${OS}" == "rhel11" ]]; then
# Do not fail in case of sending log to pastebin or logdetective fails.
analyze_logs_by_logdetective "${tmp_file}"
fi
Expand Down
9 changes: 8 additions & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ else ifeq ($(TARGET),rhel9)
else ifeq ($(TARGET),rhel10)
OS := rhel10
DOCKERFILE ?= Dockerfile.rhel10
else ifeq ($(TARGET),rhel11)
OS := rhel11
DOCKERFILE ?= Dockerfile.rhel11
else ifeq ($(TARGET),fedora)
OS := fedora
DOCKERFILE ?= Dockerfile.fedora
Expand All @@ -48,10 +51,14 @@ else ifeq ($(TARGET),c9s)
OS := c9s
DOCKERFILE ?= Dockerfile.c9s
REGISTRY := quay.io/
else
else ifeq ($(TARGET),c10s)
OS := c10s
DOCKERFILE ?= Dockerfile.c10s
REGISTRY := quay.io/
else
OS := c11s
DOCKERFILE ?= Dockerfile.c11s
REGISTRY := quay.io/
endif

SKIP_SQUASH ?= 1
Expand Down
2 changes: 2 additions & 0 deletions generate_version_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
distro_names = {
"c9s": ["CentOS Stream 9", "quay.io/sclorg/%s-c9s"],
"c10s": ["CentOS Stream 10", "quay.io/sclorg/%s-c10s"],
"c11s": ["CentOS Stream 11", "quay.io/sclorg/%s-c11s"],
"fedora": ["Fedora", "quay.io/fedora/%s"],
"rhel8": ["RHEL 8", "registry.redhat.io/rhel8/%s"],
"rhel9": ["RHEL 9", "registry.redhat.io/rhel9/%s"],
"rhel10": ["RHEL 10", "registry.redhat.io/rhel10/%s"],
"rhel11": ["RHEL 11", "registry.redhat.io/rhel11/%s"],
}
version_regex = re.compile(r"^VERSIONS\s*=\s*(.*)$")
docker_file_regex = re.compile(r"(?<=Dockerfile\.).+")
Expand Down
4 changes: 4 additions & 0 deletions test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -738,10 +738,14 @@ ct_get_public_image_name() {
public_image_name=$registry/rhel9/$base_image_name-${version//./}
elif [ "$os" == "rhel10" ]; then
public_image_name=$registry/rhel10/$base_image_name-${version//./}
elif [ "$os" == "rhel11" ]; then
public_image_name=$registry/rhel11/$base_image_name-${version//./}
elif [ "$os" == "c9s" ]; then
public_image_name=$registry/sclorg/$base_image_name-${version//./}-c9s
elif [ "$os" == "c10s" ]; then
public_image_name=$registry/sclorg/$base_image_name-${version//./}-c10s
elif [ "$os" == "c11s" ]; then
public_image_name=$registry/sclorg/$base_image_name-${version//./}-c11s
fi

echo "$public_image_name"
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ run_test_and_analyze_failed_logs() {
ret_code=$?
set +o pipefail
if [[ "$ret_code" != "0" ]]; then
if [[ "${OS}" == "rhel8" ]] || [[ "${OS}" == "rhel9" ]] || [[ "${OS}" == "rhel10" ]]; then
if [[ "${OS}" == "rhel8" ]] || [[ "${OS}" == "rhel9" ]] || [[ "${OS}" == "rhel10" ]]|| [[ "${OS}" == "rhel11" ]]; then
analyze_logs_by_logdetective "$tmp_file"
fi
fi
Expand Down
2 changes: 2 additions & 0 deletions tests/failures/check/v0/Dockerfile.c11s
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM quay.io/sclorg/s2i-core-c10s
LABEL name=test-image
3 changes: 3 additions & 0 deletions tests/failures/check/v0/Dockerfile.rhel11
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# As we do not have a RHEL11 container image yet, we need to use a RHEL10 image.
FROM ubi10/s2i-core
LABEL name=test-image
Comment on lines +2 to +3
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check how other rhel Dockerfiles specify the FROM directive
fd "Dockerfile.rhel" tests/ --exec head -1 {}

Repository: sclorg/container-common-scripts

Length of output: 152


🏁 Script executed:

# Check the directory structure of tests/failures/check
find tests/failures/check -type f -name "Dockerfile*" | head -20

Repository: sclorg/container-common-scripts

Length of output: 401


🏁 Script executed:

# Look for any Dockerfiles in tests that DO use registry.redhat.io prefix
rg "registry\.redhat\.io" tests/ --type dockerfile

Repository: sclorg/container-common-scripts

Length of output: 109


🏁 Script executed:

# Check the content of a few rhel Dockerfiles to see the full picture
fd "Dockerfile.rhel" tests/ --exec sh -c 'echo "=== {} ==="; head -5 "{}"'

Repository: sclorg/container-common-scripts

Length of output: 438


🏁 Script executed:

# Look for any README or documentation in tests/failures/check
find tests/failures/check -type f \( -name "README*" -o -name "*.md" -o -name "*.txt" \) | head -10

Repository: sclorg/container-common-scripts

Length of output: 108


🏁 Script executed:

# Check if there are any comments or instructions in the check directory
cat tests/failures/check/README 2>/dev/null || cat tests/failures/check/v0/README 2>/dev/null || echo "No README found"

Repository: sclorg/container-common-scripts

Length of output: 90


🏁 Script executed:

# Look for any test scripts that might explain what these fixtures are for
fd "test.*check" tests/ -x head -20 {}

Repository: sclorg/container-common-scripts

Length of output: 57


🏁 Script executed:

cat tests/failures/check/v0/README.md

Repository: sclorg/container-common-scripts

Length of output: 110


Version mismatch in base image: Dockerfile.rhel11 uses ubi10 instead of ubi11.

The Dockerfile uses FROM ubi10/s2i-core, but given the filename convention (Dockerfile.rhel11), it should likely use ubi11/s2i-core to be consistent with how other rhel Dockerfiles are named (e.g., Dockerfile.rhel10 uses ubi10/s2i-core). Verify if this mismatch is intentional for this test failure fixture.

🧰 Tools
🪛 Trivy (0.69.3)

[error] 1-1: Image user should not be 'root'

Specify at least 1 USER command in Dockerfile with non-root user as argument

Rule: DS-0002

Learn more

(IaC/Dockerfile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/failures/check/v0/Dockerfile.rhel11` around lines 1 - 2, The base image
in Dockerfile.rhel11 is incorrect: replace the current FROM line that reads
"FROM ubi10/s2i-core" with "FROM ubi11/s2i-core" so the file name
Dockerfile.rhel11 matches the RHEL11 base image; update the FROM instruction in
Dockerfile.rhel11 (and adjust any related LABEL or test fixture metadata if this
change affects expected test outputs) unless the use of ubi10 was intentionally
part of the failing fixture.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Petr did this on purpose, we don't have ubi11 images at this point. However, a comment and maybe even an opened issue (or different kind of reminder for ourselves for the future) would help us not forget to change this once it's time.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

@hhorak, understood — thanks for the clarification! I'll open a GitHub issue as a reminder and suggest an inline comment for the Dockerfile.

Let me create the issue now:

In the meantime, here's a suggested inline comment for the Dockerfile to make the intent clear:

# TODO: Replace ubi10/s2i-core with ubi11/s2i-core once UBI 11 images are available
FROM ubi10/s2i-core
LABEL name=test-image

🏁 Script executed:

#!/bin/bash
gh issue create \
  --repo sclorg/container-common-scripts \
  --title "Update Dockerfile.rhel11 base image from ubi10 to ubi11 once ubi11 images are available" \
  --body "## Background

In \`tests/failures/check/v0/Dockerfile.rhel11\`, the base image is temporarily set to \`ubi10/s2i-core\` because \`ubi11\` images are not yet available.

Once UBI 11 images are published, this file should be updated to use \`FROM ubi11/s2i-core\` instead.

## File to update
- \`tests/failures/check/v0/Dockerfile.rhel11\`

## References
- PR: https://github.com/sclorg/container-common-scripts/pull/423
- Comment: https://github.com/sclorg/container-common-scripts/pull/423#discussion_r3085448970

Requested by: `@hhorak`" \
  --assignee hhorak

Length of output: 61


@hhorak, I've opened issue #425 to track the update: #425

Additionally, I'd suggest adding a TODO comment directly in the Dockerfile so the intent is visible right in the code:

# TODO: Replace ubi10/s2i-core with ubi11/s2i-core once UBI 11 images are available
# Tracked in https://github.com/sclorg/container-common-scripts/issues/425
FROM ubi10/s2i-core
LABEL name=test-image

✏️ Learnings added
Learnt from: hhorak
Repo: sclorg/container-common-scripts PR: 423
File: tests/failures/check/v0/Dockerfile.rhel11:1-2
Timestamp: 2026-04-15T10:43:19.514Z
Learning: In `tests/failures/check/v0/Dockerfile.rhel11` in the sclorg/container-common-scripts repository, the base image `FROM ubi10/s2i-core` is used intentionally as a temporary placeholder because UBI 11 (`ubi11`) images do not yet exist. This should be updated to `FROM ubi11/s2i-core` once UBI 11 images become available. Do not flag this as a version mismatch — it is a known, intentional workaround.

Learnt from: hhorak
Repo: sclorg/container-common-scripts PR: 423
File: tests/failures/check/v0/Dockerfile.rhel11:1-2
Timestamp: 2026-04-15T10:43:19.514Z
Learning: In `tests/failures/check/v0/Dockerfile.rhel11` in the sclorg/container-common-scripts repository, the base image `FROM ubi10/s2i-core` is used intentionally as a temporary placeholder because UBI 11 (`ubi11`) images do not yet exist. This should be updated to `FROM ubi11/s2i-core` once UBI 11 images become available. Tracked in https://github.com/sclorg/container-common-scripts/issues/425. Do not flag this as a version mismatch — it is a known, intentional workaround.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.