Skip to content

OCPBUGS-26022: Validate inject-proxy even without proxy env vars - #1437

Open
mdbooth wants to merge 1 commit into
openshift:mainfrom
mdbooth:OCPBUGS-26022
Open

OCPBUGS-26022: Validate inject-proxy even without proxy env vars#1437
mdbooth wants to merge 1 commit into
openshift:mainfrom
mdbooth:OCPBUGS-26022

Conversation

@mdbooth

@mdbooth mdbooth commented Aug 4, 2026

Copy link
Copy Markdown

We were previously validating that the inject-proxy annotation referred only to valid container names, but only when proxy variables were defined. This meant we were not usually catching invalid manifests during presubmits, as these jobs rarely run with a cluster proxy.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation when configuring proxy settings for containers.
    • Reports all missing container names together in a single error message.
    • Ensures invalid container names are detected even when no proxy values are provided.
    • Preserves proxy environment variable injection for valid regular and init containers.

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@mdbooth: This pull request references Jira Issue OCPBUGS-26022, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.16.z" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

We were previously validating that the inject-proxy annotation referred only to valid container names, but only when proxy variables were defined. This meant we were not usually catching invalid manifests during presubmits, as these jobs rarely run with a cluster proxy.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 1d389fec-4afc-4108-b2df-575c4042c981

📥 Commits

Reviewing files that changed from the base of the PR and between c8391c1 and ec326d5.

📒 Files selected for processing (2)
  • lib/resourcebuilder/podspec.go
  • lib/resourcebuilder/podspec_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • lib/resourcebuilder/podspec_test.go
  • lib/resourcebuilder/podspec.go

Walkthrough

The proxy injection logic now validates every requested container name, including when proxy values are empty. It aggregates missing names into one error. Tests cover proxy-configured and no-proxy cases.

Changes

Proxy container validation

Layer / File(s) Summary
Validate proxy container targets
lib/resourcebuilder/podspec.go, lib/resourcebuilder/podspec_test.go
Proxy variables remain conditional for regular and init containers. Missing container names are collected and reported together. Tests cover invalid names with and without proxy values.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the bug and the main change: validating inject-proxy when proxy environment variables are absent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Stable And Deterministic Test Names ✅ Passed The added subtest names are static strings such as "no proxy info, invalid container name" and contain no generated values, timestamps, node names, namespaces, or IP addresses.
Test Structure And Quality ✅ Passed The PR adds local Go table-driven PodSpec unit tests, not Ginkgo tests; they create no cluster resources and use no waits or Eventually/Consistently calls.
Microshift Test Compatibility ✅ Passed Only standard Go unit tests changed in lib/resourcebuilder; no new Ginkgo e2e tests or MicroShift-incompatible API references were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR changes only lib/resourcebuilder Go code and standard testing.T unit tests; it adds no Ginkgo e2e tests or multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR changes only proxy configuration validation in the resourcebuilder package; no scheduling constraints (anti-affinity, topology spreads, nodeSelectors, or replica topology logic) are introduced.
Ote Binary Stdout Contract ✅ Passed The PR changes only library logic and unit tests; no main, init, suite setup, logging, or stdout-writing code was added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR modifies only unit tests (using Go testing.T) in podspec_test.go and utility code in podspec.go. No Ginkgo e2e tests (It(), Describe(), Context(), When()) were added. The check requires ass...
No-Weak-Crypto ✅ Passed The PR changes only proxy-container validation and tests. The patch adds no weak-crypto API, custom crypto, ECB mode, or secret/token comparison; existing MD5 code is unchanged.
Container-Privileges ✅ Passed The PR changes only proxy validation and tests; no added privileged, host namespace, SYS_ADMIN, privilege-escalation, or root settings appear in the diff.
No-Sensitive-Data-In-Logs ✅ Passed The patch adds no logging. Its new error reports only missing container names and does not format proxy values, tokens, hostnames, or other sensitive fields.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mdbooth
Once this PR has been reviewed and has the lgtm label, please assign wking for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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-robot

Copy link
Copy Markdown
Contributor

@mdbooth: This pull request references Jira Issue OCPBUGS-26022, which is invalid:

  • expected the bug to target only the "5.0.0" version, but multiple target versions were set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

We were previously validating that the inject-proxy annotation referred only to valid container names, but only when proxy variables were defined. This meant we were not usually catching invalid manifests during presubmits, as these jobs rarely run with a cluster proxy.

Summary by CodeRabbit

  • Bug Fixes
  • Improved validation when configuring proxy settings for containers.
  • Reports all missing container names together in a single error message.
  • Ensures invalid container names are detected even when no proxy values are provided.
  • Preserves proxy environment variable injection for valid regular and init containers.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@mdbooth

mdbooth commented Aug 4, 2026

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@mdbooth: This pull request references Jira Issue OCPBUGS-26022, which is invalid:

  • expected the bug to target only the "5.0.0" version, but multiple target versions were set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@mdbooth

mdbooth commented Aug 4, 2026

Copy link
Copy Markdown
Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Aug 4, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@mdbooth: This pull request references Jira Issue OCPBUGS-26022, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jianl@redhat.com), skipping review request.

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 4, 2026

@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: 1

🤖 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 `@lib/resourcebuilder/podspec_test.go`:
- Around line 92-119: Update the invalid-container test cases in the proxy
injection test table to include at least two missing container names, then
assert that expectedErr contains all missing names in their requested order
within the joined error message. Preserve the existing valid container and
proxy/no-proxy coverage.
🪄 Autofix

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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 06d86f87-c6cb-4588-a131-dcf599fd12d2

📥 Commits

Reviewing files that changed from the base of the PR and between 42ff52c and c8391c1.

📒 Files selected for processing (2)
  • lib/resourcebuilder/podspec.go
  • lib/resourcebuilder/podspec_test.go

Comment thread lib/resourcebuilder/podspec_test.go
We were previously validating that the inject-proxy annotation referred
only to valid container names, but only when proxy variables were
defined. This meant we were not usually catching invalid manifests
during presubmits, as these jobs rarely run with a cluster proxy.
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@mdbooth: This pull request references Jira Issue OCPBUGS-26022, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jianl@redhat.com), skipping review request.

Details

In response to this:

We were previously validating that the inject-proxy annotation referred only to valid container names, but only when proxy variables were defined. This meant we were not usually catching invalid manifests during presubmits, as these jobs rarely run with a cluster proxy.

Summary by CodeRabbit

  • Bug Fixes
  • Improved validation when configuring proxy settings for containers.
  • Reports all missing container names together in a single error message.
  • Ensures invalid container names are detected even when no proxy values are provided.
  • Preserves proxy environment variable injection for valid regular and init containers.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@mdbooth

mdbooth commented Aug 5, 2026

Copy link
Copy Markdown
Author

/test e2e-agnostic-ovn-techpreview-serial-2of3

@openshift-ci

openshift-ci Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@mdbooth: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants