Skip to content

add distgen support#295

Open
ndavidova wants to merge 6 commits into
masterfrom
ndavidov/distgen
Open

add distgen support#295
ndavidova wants to merge 6 commits into
masterfrom
ndavidov/distgen

Conversation

@ndavidova

@ndavidova ndavidova commented May 25, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added automated generation for standard and micro Apache HTTP Server container images across supported RHEL, CentOS Stream, and Fedora variants.
    • Added consistent Source-to-Image workflows, startup configuration, SSL certificate handling, logging, and non-privileged execution support.
    • Added support for newer Enterprise Linux 10-based image builds.
  • Documentation

    • Updated usage guidance, image examples, supported variants, environment variables, SSL configuration, and troubleshooting instructions.
  • Chores

    • Simplified image metadata and build configuration for more consistent image naming and tagging.

@ndavidova

Copy link
Copy Markdown
Contributor Author

[test]

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

Pull Request validation

Failed

🔴 Failed or pending statuses:

  • CodeRabbit[pending]

🔴 Approval - missing or changes were requested

Success

🟢 Review - Reviewed by a member


Triggered by Workflow Run

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

Testing Farm results

namecomposearchstatusstarted (UTC)timelogs
Fedora - 2.4Fedora-latestx86_64✅ passed03.06.2026 06:11:126min 8stest pipeline
Fedora - 2.4-microFedora-latestx86_64✅ passed02.06.2026 09:18:096min 40stest pipeline
CentOS Stream 10 - 2.4CentOS-Stream-10x86_64✅ passed03.06.2026 06:11:1311min 29stest pipeline
CentOS Stream 9 - 2.4-microCentOS-Stream-9x86_64✅ passed01.06.2026 12:36:2210min 48stest pipeline
CentOS Stream 10 - 2.4-microCentOS-Stream-10x86_64✅ passed02.06.2026 09:00:349min 51stest pipeline
RHEL8 - 2.4RHEL-8.10.0-Nightlyx86_64✅ passed03.06.2026 06:11:1414min 17stest pipeline
RHEL10 - Unsubscribed host - 2.4RHEL-10.2-Nightlyx86_64✅ passed03.06.2026 06:11:1119min 12stest pipeline
RHEL10 - 2.4RHEL-10.2-Nightlyx86_64✅ passed03.06.2026 06:11:1419min 57stest pipeline
RHEL9 - Unsubscribed host - 2.4RHEL-9.8.0-Nightlyx86_64✅ passed03.06.2026 06:11:1119min 7stest pipeline
RHEL9 - 2.4RHEL-9.8.0-Nightlyx86_64✅ passed03.06.2026 06:11:1121min 49stest pipeline
Fedora - PyTest - 2.4Fedora-latestx86_64✅ passed01.06.2026 12:34:166min 7stest pipeline
RHEL10 - Unsubscribed host - PyTest - 2.4RHEL-10.2-Nightlyx86_64✅ passed01.06.2026 12:36:2739min 26stest pipeline
RHEL9 - Unsubscribed host - PyTest - 2.4RHEL-9.8.0-Nightlyx86_64✅ passed01.06.2026 12:34:2241min 17stest pipeline
CentOS Stream 9 - 2.4CentOS-Stream-9x86_64✅ passed09.06.2026 13:45:379min 36stest pipeline
CentOS Stream 9 - PyTest - 2.4-microCentOS-Stream-9x86_64✅ passed01.06.2026 12:36:239min 44stest pipeline
Fedora - PyTest - 2.4-microFedora-latestx86_64✅ passed01.06.2026 12:42:437min 31stest pipeline
CentOS Stream 9 - PyTest - 2.4CentOS-Stream-9x86_64✅ passed01.06.2026 12:23:599min 18stest pipeline
RHEL9 - PyTest - OpenShift 4 - 2.4RHEL-9.8.0-Nightlyx86_64✅ passed01.06.2026 12:51:0634min 15stest pipeline
RHEL10 - PyTest - OpenShift 4 - 2.4RHEL-10.2-Nightlyx86_64✅ passed01.06.2026 12:48:4448min 44stest pipeline
CentOS Stream 10 - PyTest - 2.4-microCentOS-Stream-10x86_64✅ passed01.06.2026 12:24:0110min 30stest pipeline
RHEL8 - PyTest - OpenShift 4 - 2.4RHEL-8.10.0-Nightlyx86_64✅ passed01.06.2026 12:47:091h 16min 8stest pipeline
RHEL8 - PyTest - 2.4RHEL-8.10.0-Nightlyx86_64✅ passed01.06.2026 12:23:5957min 34stest pipeline
CentOS Stream 10 - PyTest - 2.4CentOS-Stream-10x86_64✅ passed01.06.2026 12:23:599min 50stest pipeline
RHEL10 - PyTest - 2.4RHEL-10.2-Nightlyx86_64✅ passed01.06.2026 12:24:001h 3min 4stest pipeline
RHEL9 - PyTest - 2.4RHEL-9.8.0-Nightlyx86_64✅ passed01.06.2026 12:36:1947min 3stest pipeline

@ndavidova

Copy link
Copy Markdown
Contributor Author

[test-all]

@ndavidova
ndavidova marked this pull request as ready for review May 28, 2026 15:05
@ndavidova
ndavidova requested a review from phracek May 29, 2026 11:28

@phracek phracek left a comment

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.

It looks good. I hit only some issues.

Testing Farm and quay.io have some outtages.

So please wait till they are back and online again.

Comment thread 2.4/Dockerfile.fedora Outdated
Comment thread .github/workflows/container-tests.yml
Comment thread 2.4/Dockerfile.rhel10 Outdated
Comment thread 2.4/Dockerfile.rhel9 Outdated

@phracek phracek left a comment

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.

Thanks for this task. Great.

@phracek

phracek commented Jun 2, 2026

Copy link
Copy Markdown
Member

[test]

@phracek

phracek commented Jun 3, 2026

Copy link
Copy Markdown
Member

[test]

@phracek phracek left a comment

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.

@ndavidova Please add also manifest file for '-micro' image.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c741363-df1c-4ad8-a5d2-0b9735b23e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd8f95 and 4dd1c43.

📒 Files selected for processing (115)
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/.exclude-c8s
  • 2.4-micro/2.4-micro
  • 2.4-micro/Dockerfile.c10s
  • 2.4-micro/Dockerfile.c9s
  • 2.4-micro/Dockerfile.fedora
  • 2.4-micro/core-scripts
  • 2.4-micro/root
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4-micro/s2i
  • 2.4-micro/test
  • 2.4-micro/test/__init__.py
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/examples
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/run
  • 2.4-micro/test/run-openshift-pytest
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/sample-test-app
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/settings.py
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/2.4
  • 2.4/Dockerfile.c10s
  • 2.4/Dockerfile.c9s
  • 2.4/Dockerfile.fedora
  • 2.4/Dockerfile.rhel10
  • 2.4/Dockerfile.rhel8
  • 2.4/Dockerfile.rhel9
  • 2.4/root
  • 2.4/root/usr/bin/run-httpd
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/s2i
  • 2.4/s2i/bin/assemble
  • 2.4/s2i/bin/run
  • 2.4/s2i/bin/usage
  • 2.4/test
  • 2.4/test/__init__.py
  • 2.4/test/check_imagestreams.py
  • 2.4/test/conftest.py
  • 2.4/test/examples
  • 2.4/test/imagestreams
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/run
  • 2.4/test/run-openshift-pytest
  • 2.4/test/run-openshift-remote-cluster
  • 2.4/test/run-pytest
  • 2.4/test/sample-test-app
  • 2.4/test/self-signed-ssl
  • 2.4/test/settings.py
  • 2.4/test/test-lib-httpd.sh
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4/test/test-lib.sh
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_container_httpd.py
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/utils.sh
  • Makefile
  • manifest-micro.yml
  • manifest.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/Dockerfile.micro
  • src/README.md
  • src/root/README.md
  • src/root/usr/bin/run-httpd
  • src/root/usr/libexec/httpd-prepare
  • src/root/usr/share/container-scripts/httpd/README.md
  • src/root/usr/share/container-scripts/httpd/common.sh
  • src/root/usr/share/container-scripts/httpd/passwd.template
  • src/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • src/s2i/bin/assemble
  • src/s2i/bin/run
  • src/s2i/bin/usage
  • test/examples
  • test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • test/pre-init-test-app/index.html
  • test/run-openshift-remote-cluster
  • test/self-signed-ssl
  • test/test-lib-httpd.sh
  • test/test-lib-openshift.sh
  • test/test-lib-remote-openshift.sh
  • test/test-openshift.yaml
  • test/utils.sh
💤 Files with no reviewable changes (67)
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/sample-test-app
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/2.4
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/test/run-openshift-pytest
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/test_container_httpd.py
  • 2.4-micro/test/settings.py
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/run
  • 2.4-micro/2.4-micro
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/test/test-lib-httpd.sh
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/test/run-openshift-remote-cluster
  • 2.4-micro/test/run
  • 2.4/test/settings.py
  • 2.4-micro/test/run-openshift-pytest
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/s2i/bin/run
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/root/usr/bin/run-httpd
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/examples
  • 2.4/test/sample-test-app
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4/s2i/bin/usage
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4/test/self-signed-ssl
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/examples
  • 2.4/s2i/bin/assemble
  • 2.4/test/run-pytest
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/test/conftest.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4/test/imagestreams
  • 2.4/test/check_imagestreams.py
  • 2.4-micro/test/init.py
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/test/init.py
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/test/test-lib.sh
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4/test/utils.sh

📝 Walkthrough

Walkthrough

The change introduces specification-driven generation for regular and micro HTTPD images, consolidates runtime and S2I assets under shared source paths, updates Dockerfile variants, and adds documentation and test asset links.

Changes

HTTPD image generation and runtime

Layer / File(s) Summary
Generation specifications and manifests
Makefile, manifest*.yml, specs/multispec.yml
Adds version-aware image generation with distro matrices, Dockerfile mappings, and symlink rules.
Parameterized image builds
src/Dockerfile*, 2.4/Dockerfile.*, 2.4-micro/Dockerfile.*
Templates package installation, metadata, version handling, and artifact paths across regular and micro image variants.
HTTPD runtime and S2I assets
src/root/..., src/s2i/..., 2.4*/root, 2.4*/s2i, 2.4*/core-scripts
Adds shared HTTPD startup, configuration, certificate, privilege, MPM, and S2I behavior, with generated image paths linked to shared assets.
Documentation and test asset consolidation
src/README.md, src/root/README.md, test/*, 2.4*/test
Adds container usage documentation and consolidates test applications, helpers, utilities, and references.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Generator
  participant Manifest
  participant Dockerfile
  participant Image
  Generator->>Manifest: Select version-specific manifest
  Manifest->>Dockerfile: Apply distro and symlink rules
  Dockerfile->>Image: Install packages and copy shared assets
Loading

Suggested reviewers: phracek

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely captures the main change: adding distgen support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ndavidov/distgen

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@phracek phracek left a comment

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.

It looks like micro is a symlink from 2.4-micro. It should be real file.

Comment thread src/Dockerfile
HTTPD_SHORT_VERSION={{ spec.short }} \
NAME=httpd

ENV SUMMARY="Platform for running Apache httpd ${HTTPD_VERSION} or building httpd-based application" \

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.

This duplicity can be removed. Let's use once.
Please remove 'simple' and 'combined' and we can have only 'combined'.

Only:

ENV HTTPD_VERSION={{ spec.version }} \
    HTTPD_SHORT_VERSION={{ spec.short }} \
    NAME=httpd

is fine.

Comment thread src/Dockerfile Outdated
Virtual hosting allows one Apache installation to serve many different Web sites."

{% if spec.var_style == "dollar" %}
LABEL summary="$SUMMARY" \

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.

Label should be done once.

Let's use only $DESCRIPTION. We do not need both variants.

Comment thread src/Dockerfile Outdated
io.openshift.expose-services="8080:http,8443:https" \
io.openshift.tags="builder,httpd,httpd-{{ spec.short }}" \
name="{{ spec.img_name }}" \
{% if spec.version_label %}

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.

This can be removed at all.

Comment thread src/Dockerfile Outdated
{% if spec.extra_install %}
RUN {{ spec.extra_install }}
INSTALL_PKGS="{{ spec.pkgs }}" && \
{{ spec.pkg_manager }} install -y --setopt=tsflags=nodocs ${INSTALL_PKGS} && \

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.

Let's use only 'dnf'. It is available since RHEL8.

Comment thread src/Dockerfile Outdated
HTTPD_DATA_ORIG_PATH=/var/www \
HTTPD_LOG_PATH=/var/log/httpd

{% if spec.copy_version %}

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.

This condition is not needed. Let's unifi it.

Comment thread src/Dockerfile Outdated
COPY ${HTTPD_VERSION}/root /
{% endif %}

{% if spec.fedora_specific %}

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.

This is not needed at all. Please remove it.

Comment thread src/Dockerfile Outdated
# Reset permissions of filesystem to default values
{% else %}
# Reset permissions of filesystem to default values
{% endif %}

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.

Till this.

@phracek

phracek commented Jun 16, 2026

Copy link
Copy Markdown
Member

[test]

@frenzymadness frenzymadness left a comment

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.

Just two comments from me.

Comment thread Makefile

generate:
for version in ${VERSIONS} ; do \
if [[ "$$version" == *-micro ]]; then \

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.

[[ ]] are bash-specific and if we run this on a system where /bin/sh is not bash, it will fail. We can either require bash here in the Makefile or switch this to a POSIX-compatible variant.

Comment thread manifest.yml Outdated
Comment on lines +30 to +31
- src: .
dest: "2.4"

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.

This creates a following symlink inside the 2.4 directory: 2.4 -> .

@ndavidova

Copy link
Copy Markdown
Contributor Author

[test]

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 9

🧹 Nitpick comments (2)
specs/multispec.yml (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional refactor: Remove unused pkg_manager configuration.

The PR objective notes that spec.pkg_manager was replaced directly with dnf in the templates. If the generator template no longer interpolates pkg_manager, this key (and its occurrences across other distributions in this file) is dead configuration and can be safely removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/multispec.yml` at line 15, Remove the unused pkg_manager configuration
key from the multispec definitions, including its occurrences for other
distributions, after confirming the generator templates no longer interpolate
it. Leave the template behavior and all unrelated distribution settings
unchanged.
test/utils.sh (1)

36-46: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Quote the $cmd variable passed to eval.

Using eval $cmd without quotes causes word splitting before eval processes the arguments, which can break test commands that contain complex quoting or spaces. Use eval "$cmd" to preserve the exact command string.

♻️ Proposed fix
 function run_command {
     local cmd="$1"
     local expected="${2:-0}"
     local msg="${3:-Running command '$cmd'}"
     print_result working "$msg"
-    eval $cmd
+    eval "$cmd"
     local res="$?"
-    status=`get_status "$res" "$expected"`
+    status=$(get_status "$res" "$expected")
     print_result "$status" "$msg"
     return "$res"
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/utils.sh` around lines 36 - 46, Update the eval invocation in
run_command to pass cmd as a quoted argument, preserving embedded spaces and
quoting while leaving the surrounding command execution and status handling
unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specs/multispec.yml`:
- Line 125: Correct the registry hostname from quya.io to quay.io in
specs/multispec.yml:125-125, then regenerate the Dockerfile or directly update
2.4/Dockerfile.fedora:31-31 so its usage label uses quay.io as well.
- Line 57: Replace the empty version_label in specs/multispec.yml with a valid
non-empty value consistent with the other variants, or omit the field when no
version label is intended. Regenerate or update 2.4/Dockerfile.rhel10 so its
LABEL metadata no longer contains version=""; ensure both sites reflect the
chosen valid-or-omitted behavior.

In `@src/root/usr/bin/run-httpd`:
- Line 18: Update the argument expansion in the httpd exec command to use quoted
"$@" so each argument passed to the script retains its original boundaries,
including spaces.

In `@src/root/usr/libexec/httpd-prepare`:
- Around line 8-10: Replace the recursive a+rwx permissions in the httpd
preparation flow with group-scoped access limited to the users that assemble
configuration, and remove world-write access from the main, drop-in, and modules
configuration paths. Ensure TLS private-key files and storage receive
restrictive permissions while preserving necessary read/write access for the
intended service group.

In `@src/root/usr/share/container-scripts/httpd/common.sh`:
- Around line 193-198: Update process_ssl_certs to quote the dir-based path
expansions in both directory checks and the mv command, preventing word
splitting and ensuring paths containing spaces are handled safely.
- Around line 173-190: Quote all dir-based path expansions in
process_config_files, including the httpd-cfg and deprecated cfg directory
checks, ls glob paths, cp sources, and rm targets, so paths containing spaces or
shell metacharacters are handled safely without changing the existing
configuration-copy behavior.

In `@src/s2i/bin/run`:
- Around line 5-7: Update the exec invocation in the run script to pass
positional arguments as a quoted expansion, preserving spaces, wildcard
characters, and original argument boundaries.

In `@src/s2i/bin/usage`:
- Around line 1-5: Make the shell used by the usage script compatible with the
conditional in the DISTRO branch: either change the shebang to /bin/bash to
support the existing [[ $DISTRO =~ rhel* ]] expression, or rewrite that
condition with POSIX [ ] syntax while preserving correct RHEL detection.

In `@test/pre-init-test-app/index.html`:
- Line 1: Prepend the HTML5 doctype declaration to the static fixture content in
index.html, before the existing sample text, so browsers render it in standards
mode.

---

Nitpick comments:
In `@specs/multispec.yml`:
- Line 15: Remove the unused pkg_manager configuration key from the multispec
definitions, including its occurrences for other distributions, after confirming
the generator templates no longer interpolate it. Leave the template behavior
and all unrelated distribution settings unchanged.

In `@test/utils.sh`:
- Around line 36-46: Update the eval invocation in run_command to pass cmd as a
quoted argument, preserving embedded spaces and quoting while leaving the
surrounding command execution and status handling unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c741363-df1c-4ad8-a5d2-0b9735b23e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd8f95 and 4dd1c43.

📒 Files selected for processing (115)
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/.exclude-c8s
  • 2.4-micro/2.4-micro
  • 2.4-micro/Dockerfile.c10s
  • 2.4-micro/Dockerfile.c9s
  • 2.4-micro/Dockerfile.fedora
  • 2.4-micro/core-scripts
  • 2.4-micro/root
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4-micro/s2i
  • 2.4-micro/test
  • 2.4-micro/test/__init__.py
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/examples
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/run
  • 2.4-micro/test/run-openshift-pytest
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/sample-test-app
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/settings.py
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/2.4
  • 2.4/Dockerfile.c10s
  • 2.4/Dockerfile.c9s
  • 2.4/Dockerfile.fedora
  • 2.4/Dockerfile.rhel10
  • 2.4/Dockerfile.rhel8
  • 2.4/Dockerfile.rhel9
  • 2.4/root
  • 2.4/root/usr/bin/run-httpd
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/s2i
  • 2.4/s2i/bin/assemble
  • 2.4/s2i/bin/run
  • 2.4/s2i/bin/usage
  • 2.4/test
  • 2.4/test/__init__.py
  • 2.4/test/check_imagestreams.py
  • 2.4/test/conftest.py
  • 2.4/test/examples
  • 2.4/test/imagestreams
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/run
  • 2.4/test/run-openshift-pytest
  • 2.4/test/run-openshift-remote-cluster
  • 2.4/test/run-pytest
  • 2.4/test/sample-test-app
  • 2.4/test/self-signed-ssl
  • 2.4/test/settings.py
  • 2.4/test/test-lib-httpd.sh
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4/test/test-lib.sh
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_container_httpd.py
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/utils.sh
  • Makefile
  • manifest-micro.yml
  • manifest.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/Dockerfile.micro
  • src/README.md
  • src/root/README.md
  • src/root/usr/bin/run-httpd
  • src/root/usr/libexec/httpd-prepare
  • src/root/usr/share/container-scripts/httpd/README.md
  • src/root/usr/share/container-scripts/httpd/common.sh
  • src/root/usr/share/container-scripts/httpd/passwd.template
  • src/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • src/s2i/bin/assemble
  • src/s2i/bin/run
  • src/s2i/bin/usage
  • test/examples
  • test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • test/pre-init-test-app/index.html
  • test/run-openshift-remote-cluster
  • test/self-signed-ssl
  • test/test-lib-httpd.sh
  • test/test-lib-openshift.sh
  • test/test-lib-remote-openshift.sh
  • test/test-openshift.yaml
  • test/utils.sh
💤 Files with no reviewable changes (67)
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/sample-test-app
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/2.4
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/test/run-openshift-pytest
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/test_container_httpd.py
  • 2.4-micro/test/settings.py
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/run
  • 2.4-micro/2.4-micro
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/test/test-lib-httpd.sh
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/test/run-openshift-remote-cluster
  • 2.4-micro/test/run
  • 2.4/test/settings.py
  • 2.4-micro/test/run-openshift-pytest
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/s2i/bin/run
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/root/usr/bin/run-httpd
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/examples
  • 2.4/test/sample-test-app
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4/s2i/bin/usage
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4/test/self-signed-ssl
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/examples
  • 2.4/s2i/bin/assemble
  • 2.4/test/run-pytest
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/test/conftest.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4/test/imagestreams
  • 2.4/test/check_imagestreams.py
  • 2.4-micro/test/init.py
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/test/init.py
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/test/test-lib.sh
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4/test/utils.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 9

🧹 Nitpick comments (2)
specs/multispec.yml (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Optional refactor: Remove unused pkg_manager configuration.

The PR objective notes that spec.pkg_manager was replaced directly with dnf in the templates. If the generator template no longer interpolates pkg_manager, this key (and its occurrences across other distributions in this file) is dead configuration and can be safely removed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/multispec.yml` at line 15, Remove the unused pkg_manager configuration
key from the multispec definitions, including its occurrences for other
distributions, after confirming the generator templates no longer interpolate
it. Leave the template behavior and all unrelated distribution settings
unchanged.
test/utils.sh (1)

36-46: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Quote the $cmd variable passed to eval.

Using eval $cmd without quotes causes word splitting before eval processes the arguments, which can break test commands that contain complex quoting or spaces. Use eval "$cmd" to preserve the exact command string.

♻️ Proposed fix
 function run_command {
     local cmd="$1"
     local expected="${2:-0}"
     local msg="${3:-Running command '$cmd'}"
     print_result working "$msg"
-    eval $cmd
+    eval "$cmd"
     local res="$?"
-    status=`get_status "$res" "$expected"`
+    status=$(get_status "$res" "$expected")
     print_result "$status" "$msg"
     return "$res"
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/utils.sh` around lines 36 - 46, Update the eval invocation in
run_command to pass cmd as a quoted argument, preserving embedded spaces and
quoting while leaving the surrounding command execution and status handling
unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@specs/multispec.yml`:
- Line 125: Correct the registry hostname from quya.io to quay.io in
specs/multispec.yml:125-125, then regenerate the Dockerfile or directly update
2.4/Dockerfile.fedora:31-31 so its usage label uses quay.io as well.
- Line 57: Replace the empty version_label in specs/multispec.yml with a valid
non-empty value consistent with the other variants, or omit the field when no
version label is intended. Regenerate or update 2.4/Dockerfile.rhel10 so its
LABEL metadata no longer contains version=""; ensure both sites reflect the
chosen valid-or-omitted behavior.

In `@src/root/usr/bin/run-httpd`:
- Line 18: Update the argument expansion in the httpd exec command to use quoted
"$@" so each argument passed to the script retains its original boundaries,
including spaces.

In `@src/root/usr/libexec/httpd-prepare`:
- Around line 8-10: Replace the recursive a+rwx permissions in the httpd
preparation flow with group-scoped access limited to the users that assemble
configuration, and remove world-write access from the main, drop-in, and modules
configuration paths. Ensure TLS private-key files and storage receive
restrictive permissions while preserving necessary read/write access for the
intended service group.

In `@src/root/usr/share/container-scripts/httpd/common.sh`:
- Around line 193-198: Update process_ssl_certs to quote the dir-based path
expansions in both directory checks and the mv command, preventing word
splitting and ensuring paths containing spaces are handled safely.
- Around line 173-190: Quote all dir-based path expansions in
process_config_files, including the httpd-cfg and deprecated cfg directory
checks, ls glob paths, cp sources, and rm targets, so paths containing spaces or
shell metacharacters are handled safely without changing the existing
configuration-copy behavior.

In `@src/s2i/bin/run`:
- Around line 5-7: Update the exec invocation in the run script to pass
positional arguments as a quoted expansion, preserving spaces, wildcard
characters, and original argument boundaries.

In `@src/s2i/bin/usage`:
- Around line 1-5: Make the shell used by the usage script compatible with the
conditional in the DISTRO branch: either change the shebang to /bin/bash to
support the existing [[ $DISTRO =~ rhel* ]] expression, or rewrite that
condition with POSIX [ ] syntax while preserving correct RHEL detection.

In `@test/pre-init-test-app/index.html`:
- Line 1: Prepend the HTML5 doctype declaration to the static fixture content in
index.html, before the existing sample text, so browsers render it in standards
mode.

---

Nitpick comments:
In `@specs/multispec.yml`:
- Line 15: Remove the unused pkg_manager configuration key from the multispec
definitions, including its occurrences for other distributions, after confirming
the generator templates no longer interpolate it. Leave the template behavior
and all unrelated distribution settings unchanged.

In `@test/utils.sh`:
- Around line 36-46: Update the eval invocation in run_command to pass cmd as a
quoted argument, preserving embedded spaces and quoting while leaving the
surrounding command execution and status handling unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c741363-df1c-4ad8-a5d2-0b9735b23e5b

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd8f95 and 4dd1c43.

📒 Files selected for processing (115)
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/.exclude-c8s
  • 2.4-micro/2.4-micro
  • 2.4-micro/Dockerfile.c10s
  • 2.4-micro/Dockerfile.c9s
  • 2.4-micro/Dockerfile.fedora
  • 2.4-micro/core-scripts
  • 2.4-micro/root
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4-micro/s2i
  • 2.4-micro/test
  • 2.4-micro/test/__init__.py
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/examples
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/run
  • 2.4-micro/test/run-openshift-pytest
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/sample-test-app
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/settings.py
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/2.4
  • 2.4/Dockerfile.c10s
  • 2.4/Dockerfile.c9s
  • 2.4/Dockerfile.fedora
  • 2.4/Dockerfile.rhel10
  • 2.4/Dockerfile.rhel8
  • 2.4/Dockerfile.rhel9
  • 2.4/root
  • 2.4/root/usr/bin/run-httpd
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/s2i
  • 2.4/s2i/bin/assemble
  • 2.4/s2i/bin/run
  • 2.4/s2i/bin/usage
  • 2.4/test
  • 2.4/test/__init__.py
  • 2.4/test/check_imagestreams.py
  • 2.4/test/conftest.py
  • 2.4/test/examples
  • 2.4/test/imagestreams
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/run
  • 2.4/test/run-openshift-pytest
  • 2.4/test/run-openshift-remote-cluster
  • 2.4/test/run-pytest
  • 2.4/test/sample-test-app
  • 2.4/test/self-signed-ssl
  • 2.4/test/settings.py
  • 2.4/test/test-lib-httpd.sh
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4/test/test-lib.sh
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_container_httpd.py
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/utils.sh
  • Makefile
  • manifest-micro.yml
  • manifest.yml
  • specs/multispec.yml
  • src/Dockerfile
  • src/Dockerfile.micro
  • src/README.md
  • src/root/README.md
  • src/root/usr/bin/run-httpd
  • src/root/usr/libexec/httpd-prepare
  • src/root/usr/share/container-scripts/httpd/README.md
  • src/root/usr/share/container-scripts/httpd/common.sh
  • src/root/usr/share/container-scripts/httpd/passwd.template
  • src/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • src/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • src/s2i/bin/assemble
  • src/s2i/bin/run
  • src/s2i/bin/usage
  • test/examples
  • test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • test/pre-init-test-app/index.html
  • test/run-openshift-remote-cluster
  • test/self-signed-ssl
  • test/test-lib-httpd.sh
  • test/test-lib-openshift.sh
  • test/test-lib-remote-openshift.sh
  • test/test-openshift.yaml
  • test/utils.sh
💤 Files with no reviewable changes (67)
  • 2.4-micro/test/imagestreams
  • 2.4-micro/test/sample-test-app
  • 2.4/test/test_ocp_imagestreams.py
  • 2.4/2.4
  • 2.4-micro/test/test_ocp_shared_helm_template.py
  • 2.4/test/run-openshift-pytest
  • 2.4-micro/test/test_ocp_integration.py
  • 2.4/test/test_ocp_shared_helm_template.py
  • 2.4/test/pre-init-test-app/httpd-pre-init/modify_index.sh
  • 2.4/test/pre-init-test-app/index.html
  • 2.4/test/test_container_httpd.py
  • 2.4-micro/test/settings.py
  • 2.4/test/test-lib-openshift.sh
  • 2.4/test/run
  • 2.4-micro/2.4-micro
  • 2.4-micro/test/test-lib-openshift.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/20-copy-config.sh
  • 2.4/test/test-lib-httpd.sh
  • 2.4-micro/test/test_ocp_ex_template.py
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/20-copy-config.sh
  • 2.4/test/run-openshift-remote-cluster
  • 2.4-micro/test/run
  • 2.4/test/settings.py
  • 2.4-micro/test/run-openshift-pytest
  • 2.4/root/usr/share/container-scripts/httpd/post-assemble/40-ssl-certs.sh
  • 2.4/s2i/bin/run
  • 2.4/test/test_container_httpd_s2i.py
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/40-ssl-certs.sh
  • 2.4/root/usr/bin/run-httpd
  • 2.4/test/test_ocp_integration.py
  • 2.4/test/examples
  • 2.4/test/sample-test-app
  • 2.4-micro/test/check_imagestreams.py
  • 2.4-micro/test/test-lib.sh
  • 2.4-micro/test/test-lib-remote-openshift.sh
  • 2.4/s2i/bin/usage
  • 2.4-micro/test/test_container_httpd.py
  • 2.4-micro/.build-args-c9s
  • 2.4-micro/test/test_ocp_imagestreams.py
  • 2.4/test/self-signed-ssl
  • 2.4/test/test_ocp_ex_template.py
  • 2.4/test/test_ocp_imagestream_s2i.py
  • 2.4-micro/test/self-signed-ssl
  • 2.4-micro/test/test_container_httpd_s2i.py
  • 2.4-micro/test/run-openshift-remote-cluster
  • 2.4-micro/test/examples
  • 2.4/s2i/bin/assemble
  • 2.4/test/run-pytest
  • 2.4/root/usr/share/container-scripts/httpd/passwd.template
  • 2.4/test/conftest.py
  • 2.4-micro/test/conftest.py
  • 2.4-micro/test/test_ocp_shared_helm_imagestreams.py
  • 2.4-micro/test/test_ocp_imagestream_s2i.py
  • 2.4/test/imagestreams
  • 2.4/test/check_imagestreams.py
  • 2.4-micro/test/init.py
  • 2.4/root/usr/libexec/httpd-prepare
  • 2.4/test/init.py
  • 2.4/test/test-openshift.yaml
  • 2.4/test/test_ocp_shared_helm_imagestreams.py
  • 2.4/test/test-lib-remote-openshift.sh
  • 2.4-micro/test/run-pytest
  • 2.4-micro/test/test-lib-httpd.sh
  • 2.4/root/usr/share/container-scripts/httpd/pre-init/10-set-mpm.sh
  • 2.4/test/test-lib.sh
  • 2.4-micro/root/usr/share/container-scripts/httpd/common.sh
  • 2.4/test/utils.sh
🛑 Comments failed to post (9)
specs/multispec.yml (2)

57-57: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Provide a non-empty version label or omit it in the template.

Defining version_label as an empty string generates a version="" label in the Dockerfile. Empty label values for standard metadata (like version) cause validation failures in downstream build pipelines such as Konflux and Red Hat Container Certification.

  • specs/multispec.yml#L57-L57: Provide a valid value (e.g., "1", matching other variants) or implement a way to completely omit the label if intended.
  • 2.4/Dockerfile.rhel10#L29-L29: Remove or populate the empty version="" label (this file will likely be regenerated).
📍 Affects 2 files
  • specs/multispec.yml#L57-L57 (this comment)
  • 2.4/Dockerfile.rhel10#L29-L29
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/multispec.yml` at line 57, Replace the empty version_label in
specs/multispec.yml with a valid non-empty value consistent with the other
variants, or omit the field when no version label is intended. Regenerate or
update 2.4/Dockerfile.rhel10 so its LABEL metadata no longer contains
version=""; ensure both sites reflect the chosen valid-or-omitted behavior.

125-125: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fix the typo in the registry URL.

There is a typo in the registry URL (quya.io instead of quay.io), which propagates to the generated Dockerfile's usage label.

  • specs/multispec.yml#L125-L125: Change quya.io to quay.io.
  • 2.4/Dockerfile.fedora#L31-L31: Change quya.io to quay.io (or simply regenerate the Dockerfile after fixing the spec).
📍 Affects 2 files
  • specs/multispec.yml#L125-L125 (this comment)
  • 2.4/Dockerfile.fedora#L31-L31
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@specs/multispec.yml` at line 125, Correct the registry hostname from quya.io
to quay.io in specs/multispec.yml:125-125, then regenerate the Dockerfile or
directly update 2.4/Dockerfile.fedora:31-31 so its usage label uses quay.io as
well.
src/root/usr/bin/run-httpd (1)

18-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Quote $@ to preserve argument boundaries.

Using unquoted $@ causes arguments containing spaces to be split into multiple separate arguments. Use "$@" to ensure arguments are passed exactly as provided.

🐛 Proposed fix
-exec httpd -D FOREGROUND $@
+exec httpd -D FOREGROUND "$@"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

exec httpd -D FOREGROUND "$@"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/root/usr/bin/run-httpd` at line 18, Update the argument expansion in the
httpd exec command to use quoted "$@" so each argument passed to the script
retains its original boundaries, including spaces.
src/root/usr/libexec/httpd-prepare (1)

8-10: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not make HTTPD configuration and TLS storage world-writable.

a+rwx grants every container user write access to httpd.conf/ssl.conf and the TLS directory, allowing an unprivileged application to alter server behavior or replace certificate/key material. Use group-scoped permissions where assembly requires writes, then apply restrictive permissions to private keys.

Also applies to: 22-23

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/root/usr/libexec/httpd-prepare` around lines 8 - 10, Replace the
recursive a+rwx permissions in the httpd preparation flow with group-scoped
access limited to the users that assemble configuration, and remove world-write
access from the main, drop-in, and modules configuration paths. Ensure TLS
private-key files and storage receive restrictive permissions while preserving
necessary read/write access for the intended service group.
src/root/usr/share/container-scripts/httpd/common.sh (2)

173-190: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Quote variables in path expansions to prevent word splitting.

Unquoted variables like ${dir} in cp and rm commands can cause unintended word splitting or globbing if the directory path contains spaces or special characters, potentially leading to incorrect file operations or unintended deletions.

🛡️ Proposed fixes for quoting
 process_config_files() {
   local dir=${1:-.}
-  if [ -d ${dir}/httpd-cfg ]; then
+  if [ -d "${dir}/httpd-cfg" ]; then
     echo "---> Copying httpd configuration files..."
-    if [ "$(ls -A ${dir}/httpd-cfg/*.conf)" ]; then
-      cp -v ${dir}/httpd-cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
-      rm -rf ${dir}/httpd-cfg
+    if [ "$(ls -A "${dir}"/httpd-cfg/*.conf 2>/dev/null)" ]; then
+      cp -v "${dir}"/httpd-cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
+      rm -rf "${dir}/httpd-cfg"
     fi
   else
-    if [ -d ${dir}/cfg ]; then
+    if [ -d "${dir}/cfg" ]; then
       echo "---> Copying httpd configuration files from deprecated './cfg' directory, use './httpd-cfg' instead..."
-      if [ "$(ls -A ${dir}/cfg/*.conf)" ]; then
-        cp -v ${dir}/cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
-        rm -rf ${dir}/cfg
+      if [ "$(ls -A "${dir}"/cfg/*.conf 2>/dev/null)" ]; then
+        cp -v "${dir}"/cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
+        rm -rf "${dir}/cfg"
       fi
     fi
   fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

process_config_files() {
  local dir=${1:-.}
  if [ -d "${dir}/httpd-cfg" ]; then
    echo "---> Copying httpd configuration files..."
    if [ "$(ls -A "${dir}"/httpd-cfg/*.conf 2>/dev/null)" ]; then
      cp -v "${dir}"/httpd-cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
      rm -rf "${dir}/httpd-cfg"
    fi
  else
    if [ -d "${dir}/cfg" ]; then
      echo "---> Copying httpd configuration files from deprecated './cfg' directory, use './httpd-cfg' instead..."
      if [ "$(ls -A "${dir}"/cfg/*.conf 2>/dev/null)" ]; then
        cp -v "${dir}"/cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
        rm -rf "${dir}/cfg"
      fi
    fi
  fi
}
🧰 Tools
🪛 ast-grep (0.44.1)

[error] 178-178: Recursive rm is given an unquoted variable expansion as a target. If the variable is empty, contains whitespace, or holds glob characters, word splitting and pathname expansion can make rm delete unintended paths (e.g. rm -rf $dir with dir="" or dir="/ tmp"). Always double-quote the expansion and guard against empty values: rm -rf -- "${dir:?dir is unset}".
Context: ${dir}
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(rm-rf-unquoted-variable-bash)


[error] 185-185: Recursive rm is given an unquoted variable expansion as a target. If the variable is empty, contains whitespace, or holds glob characters, word splitting and pathname expansion can make rm delete unintended paths (e.g. rm -rf $dir with dir="" or dir="/ tmp"). Always double-quote the expansion and guard against empty values: rm -rf -- "${dir:?dir is unset}".
Context: ${dir}
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(rm-rf-unquoted-variable-bash)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/root/usr/share/container-scripts/httpd/common.sh` around lines 173 - 190,
Quote all dir-based path expansions in process_config_files, including the
httpd-cfg and deprecated cfg directory checks, ls glob paths, cp sources, and rm
targets, so paths containing spaces or shell metacharacters are handled safely
without changing the existing configuration-copy behavior.

Source: Linters/SAST tools


193-198: 🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Quote variables in path expansions to prevent word splitting.

Similar to the config copying function, the ${dir} variable should be quoted to prevent word splitting when moving the SSL directory, which mitigates the risk of command injection or clobbering unintended files.

🛡️ Proposed fixes for quoting
 process_ssl_certs() {
   local dir=${1:-.}
-  if [ -d ${dir}/httpd-ssl/private ] && [ -d ${dir}/httpd-ssl/certs ]; then
+  if [ -d "${dir}/httpd-ssl/private" ] && [ -d "${dir}/httpd-ssl/certs" ]; then
     echo "---> Moving the httpd-ssl directory included in the source to a directory that isn't exposed by httpd..."
-    mv ${dir}/httpd-ssl ${HTTPD_APP_ROOT}
+    mv "${dir}/httpd-ssl" "${HTTPD_APP_ROOT}"
   fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

process_ssl_certs() {
  local dir=${1:-.}
  if [ -d "${dir}/httpd-ssl/private" ] && [ -d "${dir}/httpd-ssl/certs" ]; then
    echo "---> Moving the httpd-ssl directory included in the source to a directory that isn't exposed by httpd..."
    mv "${dir}/httpd-ssl" "${HTTPD_APP_ROOT}"
  fi
🧰 Tools
🪛 ast-grep (0.44.1)

[warning] 196-196: mv/cp is invoked with an unquoted variable argument (e.g. mv $src $dst). Unquoted expansions undergo word splitting and pathname (glob) expansion, so a value containing spaces, */?/[, or leading - can split into extra arguments, expand to unintended files, or be parsed as an option — leading to files being moved/overwritten/clobbered at attacker-controlled paths. Always double-quote the expansion and terminate options with --: mv -- "$src" "$dst".
Context: mv ${dir}/httpd-ssl ${HTTPD_APP_ROOT}
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(mv-cp-unquoted-variable-bash)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/root/usr/share/container-scripts/httpd/common.sh` around lines 193 - 198,
Update process_ssl_certs to quote the dir-based path expansions in both
directory checks and the mv command, preventing word splitting and ensuring
paths containing spaces are handled safely.

Source: Linters/SAST tools

src/s2i/bin/run (1)

5-7: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Preserve the original argument boundaries.

exec run-httpd $@ splits arguments and expands globs, so valid runtime arguments containing spaces or wildcard characters are not forwarded intact. Use exec run-httpd "$@".

Proposed fix
 export HTTPD_RUN_BY_S2I=1
 
-exec run-httpd $@
+exec run-httpd "$@"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

export HTTPD_RUN_BY_S2I=1

exec run-httpd "$@"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/s2i/bin/run` around lines 5 - 7, Update the exec invocation in the run
script to pass positional arguments as a quoted expansion, preserving spaces,
wildcard characters, and original argument boundaries.
src/s2i/bin/usage (1)

1-5: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use a compatible shell for the conditional.

The script declares /bin/sh but uses Bash-only [[ ... =~ ... ]]. On POSIX shells this can fail or evaluate incorrectly, causing RHEL images to display the non-RHEL sample image. Either change the shebang to /bin/bash or rewrite the condition using POSIX [ ... ].

Proposed fix
-#!/bin/sh
+#!/bin/bash
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

#!/bin/bash

DISTRO=`cat /etc/*-release | grep ^ID= | grep -Po '".*?"' | tr -d '"'`
NAMESPACE=sclorg
if [[ $DISTRO =~ rhel* ]]; then
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/s2i/bin/usage` around lines 1 - 5, Make the shell used by the usage
script compatible with the conditional in the DISTRO branch: either change the
shebang to /bin/bash to support the existing [[ $DISTRO =~ rhel* ]] expression,
or rewrite that condition with POSIX [ ] syntax while preserving correct RHEL
detection.
test/pre-init-test-app/index.html (1)

1-1: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add an HTML doctype to the fixture.

Because this file is served as index.html, prepend <!doctype html> so browsers do not parse it in quirks mode.

🧰 Tools
🪛 HTMLHint (1.9.2)

[error] 1-1: Doctype must be declared before any non-comment content.

(doctype-first)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/pre-init-test-app/index.html` at line 1, Prepend the HTML5 doctype
declaration to the static fixture content in index.html, before the existing
sample text, so browsers render it in standards mode.

Source: Linters/SAST tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants