Skip to content

🌱 fix(test): make e2e test bundle compatible with restricted SCC#2711

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
tmshort:fix-scc-e2e
May 19, 2026
Merged

🌱 fix(test): make e2e test bundle compatible with restricted SCC#2711
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
tmshort:fix-scc-e2e

Conversation

@tmshort
Copy link
Copy Markdown
Contributor

@tmshort tmshort commented May 18, 2026

The e2e test operator ran busybox httpd on port 80 writing to /var/www/, both of which require root. Restricted SCC enforces non-root UIDs from a namespace-assigned range, causing the pod to crash with Permission denied. Similarly, several feature files hardcoded runAsUser:1000 which falls outside the allowed UID range on some k8s implementations.

Changes:

  • bundle.go: switch httpd from port 80+/var/www to port 8080+/tmp/www so the pod starts under any SCC without root privileges
  • steps.go: match the /tmp/www path in the readiness exec probe; add OLM_NAMESPACE as a substitution variable; make per-step timeout configurable via E2E_STEP_TIMEOUT env var (default 5m unchanged)
  • install.feature: replace hardcoded "olmv1-system" with ${OLM_NAMESPACE} so referred-secret lookups work when OLM is deployed in a different namespace
  • revision.feature, recover.feature: remove runAsUser:1000 from pod/ container specs; keep runAsNonRoot:true

Fixes OPRUN-4607

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

The e2e test operator ran busybox httpd on port 80 writing to /var/www/,
both of which require root. Restricted SCC enforces non-root UIDs from a
namespace-assigned range, causing the pod to crash with Permission denied.
Similarly, several feature files hardcoded runAsUser:1000 which falls
outside the allowed UID range on some k8s implementations.

Changes:
- bundle.go: switch httpd from port 80+/var/www to port 8080+/tmp/www so
  the pod starts under any SCC without root privileges
- steps.go: match the /tmp/www path in the readiness exec probe; add
  OLM_NAMESPACE as a substitution variable; make per-step timeout
  configurable via E2E_STEP_TIMEOUT env var (default 5m unchanged)
- install.feature: replace hardcoded "olmv1-system" with ${OLM_NAMESPACE}
  so referred-secret lookups work when OLM is deployed in a different
  namespace
- revision.feature, recover.feature: remove runAsUser:1000 from pod/
  container specs; keep runAsNonRoot:true

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Todd Short <tshort@redhat.com>
Copilot AI review requested due to automatic review settings May 18, 2026 20:35
@openshift-ci openshift-ci Bot requested review from OchiengEd and grokspawn May 18, 2026 20:35
@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 653c544
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6a0b77fdd5d4250008f2d887
😎 Deploy Preview https://deploy-preview-2711--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Makes the e2e test bundle and feature scenarios compatible with Kubernetes clusters that enforce restricted SCC (e.g. OpenShift), where root UIDs and privileged ports are disallowed and namespace-assigned UID ranges may exclude 1000. Also adds a configurable per-step timeout to accommodate slower runtimes.

Changes:

  • Switch the test bundle's httpd from port 80 / /var/www to port 8080 / /tmp/www and update the matching readiness exec probe path.
  • Remove hardcoded runAsUser: 1000 (and, in revision.feature, also runAsNonRoot: true) from pod/container security contexts; parameterize olmv1-system via a new OLM_NAMESPACE substitution variable.
  • Make the per-step e2e timeout overridable via the E2E_STEP_TIMEOUT environment variable.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/internal/catalog/bundle.go httpd script and container/probe ports moved to unprivileged 8080 and /tmp/www.
test/e2e/steps/steps.go New OLM_NAMESPACE substitution var, configurable timeout via env var, and updated exec probe path to /tmp/www/ready.
test/e2e/features/install.feature Replace hardcoded olmv1-system with ${OLM_NAMESPACE} for referred-secret lookup.
test/e2e/features/revision.feature Remove runAsUser: 1000 and runAsNonRoot: true from three security contexts.
test/e2e/features/recover.feature Remove runAsUser: 1000, retain runAsNonRoot: true.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/e2e/features/revision.feature
Comment thread test/e2e/steps/steps.go
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.16%. Comparing base (5a1207d) to head (653c544).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2711      +/-   ##
==========================================
+ Coverage   68.12%   68.16%   +0.03%     
==========================================
  Files         145      145              
  Lines       10698    10698              
==========================================
+ Hits         7288     7292       +4     
+ Misses       2880     2878       -2     
+ Partials      530      528       -2     
Flag Coverage Δ
e2e 37.17% <ø> (ø)
experimental-e2e 52.80% <ø> (+0.18%) ⬆️
unit 53.80% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joelanford
Copy link
Copy Markdown
Member

/lgtm
/approve

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2026
@joelanford
Copy link
Copy Markdown
Member

Nice find!

@openshift-merge-bot openshift-merge-bot Bot merged commit ef1a6b1 into operator-framework:main May 19, 2026
25 checks passed
@tmshort tmshort deleted the fix-scc-e2e branch May 19, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants