Skip to content

CNF-26477: oran-o2ims: extract wait-for-tls-pods into step-registry ref - #83194

Open
rauhersu wants to merge 10 commits into
openshift:mainfrom
rauhersu:master.tls.scanner.dedup
Open

CNF-26477: oran-o2ims: extract wait-for-tls-pods into step-registry ref#83194
rauhersu wants to merge 10 commits into
openshift:mainfrom
rauhersu:master.tls.scanner.dedup

Conversation

@rauhersu

@rauhersu rauhersu commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extract the ~80-line wait-for-server-pods inline script into a shared step-registry ref at ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/
  • Replace 4 duplicate inline copies (on-demand and periodic jobs for main and release-4.22) with - ref: oran-o2ims-wait-for-tls-pods
  • No behavioral changes — the ref contains the same error-handling logic from oran-o2ims: add tls scanner #82154

Depends on: #82154

Test plan

  • ci-operator-registry validation passes
  • generated-config check passes
  • Rehearsal of install-bundle-tls-scan succeeds

Jira: CNF-26477

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Adds optional on-demand and weekly AWS TLS scan jobs for ORAN O2IMS main and release-4.22 CI.
  • Extracts the duplicated TLS pod readiness script into the shared oran-o2ims-wait-for-tls-pods step.
  • The shared step waits for the Inventory CR, checks TLS services and backing pod readiness, verifies TLS secrets, and reports failures.
  • Updates the TLS scanner step to support an existing namespace through SCANNER_NAMESPACE without creating or deleting that namespace.
  • Adds ownership metadata for the new ORAN O2IMS step.

rauhersu and others added 10 commits August 7, 2026 19:12
Signed-off-by: Raul Hernandez <rauherna@redhat.com>
- Add a wait-for-server-pods inline step to the install-bundle-tls-scan
  test that dynamically discovers TLS-serving services via the
  service.beta.openshift.io/serving-cert-secret-name annotation, waits
  for their backing pods to become Ready, and verifies that service-ca
  TLS secrets exist before the tls-scanner runs. This avoids hardcoding
  server names.

- Move operator.substitutions under the bundle item where it belongs,
  making the pullspec override explicitly scoped to the operator-bundle.
…space

  The scanner always runs in a dedicated tls-scanner namespace. When
  scanning pods with NetworkPolicies restricting ingress to same-namespace
  traffic (e.g. oran-o2ims servers), the TLS handshake probes are blocked,
  producing false NO_TLS results.

  Add a SCANNER_NAMESPACE env var that deploys the scanner pod into an
  existing namespace instead, reusing the OWNS_NAMESPACE=false pattern
  already used by the HyperShift management-cluster path.

  Set SCANNER_NAMESPACE=oran-o2ims in the install-bundle-tls-scan test so
  the scanner satisfies the oran-o2ims NetworkPolicy rules.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
Add the install-bundle-tls-scan test with TLS Adherence
(StrictAllComponents) and tls-scanner to the release-4.22 config,
matching the main branch configuration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
Add install-bundle-tls-scan-periodic to both main (Fridays 03:00 UTC)
and release-4.22 (Mondays 03:00 UTC) configurations. The periodic jobs
are identical to the on-demand variants but run on a cron schedule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
Set PQC_CHECK=true across all TLS scan pipelines (on-demand and
periodic) for main and release-4.22. This enables post-quantum
cryptography readiness checks (TLS 1.3 + mlkem/mlkem25519 support).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
- Fail the step if the Inventory CR is not created within 5 minutes
  instead of silently falling through to the scanner
- Fail the step if any TLS service pod does not become ready
- Fail the step if any TLS serving cert secret is missing
- Switch pipe-based while loops to here-strings to avoid subshell
  scoping issues with failure tracking

Applies to all 4 wait-for-server-pods script copies (on-demand and
periodic jobs for main and release-4.22).

Script deduplication tracked in CNF-26477.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
Extract the ~80-line wait-for-server-pods inline script that was
duplicated 4 times (on-demand and periodic jobs for main and
release-4.22) into a shared step-registry ref at
ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/.

The ref waits for the Inventory CR, discovers TLS-annotated services,
verifies pod readiness and TLS secret presence, and fails the step
on any error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Raúl Hernández <rauherna@redhat.com>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@rauhersu: This pull request references CNF-26477 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Extract the ~80-line wait-for-server-pods inline script into a shared step-registry ref at ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/
  • Replace 4 duplicate inline copies (on-demand and periodic jobs for main and release-4.22) with - ref: oran-o2ims-wait-for-tls-pods
  • No behavioral changes — the ref contains the same error-handling logic from oran-o2ims: add tls scanner #82154

Depends on: #82154

Test plan

  • ci-operator-registry validation passes
  • generated-config check passes
  • Rehearsal of install-bundle-tls-scan succeeds

Jira: CNF-26477

🤖 Generated with Claude Code

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 openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 10, 2026
@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Hi @rauhersu. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Added ORAN O2IMS TLS readiness validation, shared scanner namespace support, and on-demand and periodic AWS TLS scan jobs for main and release 4.22 configurations.

Changes

ORAN O2IMS TLS scanning

Layer / File(s) Summary
Shared scanner namespace handling
ci-operator/step-registry/tls/scanner/run/*
The scanner accepts SCANNER_NAMESPACE and treats configured namespaces as externally owned. Cleanup removes scanner pods without managing the namespace lifecycle.
ORAN O2IMS TLS readiness step
ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/*
The new step waits for the Inventory resource, discovers TLS-enabled services, checks matching pod readiness, verifies service-ca secrets, and reports failures.
AWS TLS scan job wiring
ci-operator/config/openshift-kni/oran-o2ims/*
Main and release 4.22 configurations add the scanner image, optional AWS jobs, weekly periodic jobs, strict TLS 1.3 checks, PQC checks, and TLS scanner workflows.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AWSCluster
  participant OperatorBundle
  participant ORANO2IMSReadiness
  participant TLSScanner
  AWSCluster->>OperatorBundle: Install operator bundle
  OperatorBundle->>ORANO2IMSReadiness: Create Inventory and TLS resources
  ORANO2IMSReadiness->>AWSCluster: Verify ready pods and TLS secrets
  AWSCluster->>TLSScanner: Run TLS 1.3 and PQC scans
Loading

Possibly related PRs

🚥 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 main change: extracting the ORAN O2IMS TLS pod readiness logic into a shared step-registry reference.
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 PR changes only YAML, OWNERS, and a shell readiness script; no Go test files or Ginkgo title calls are added or modified.
Test Structure And Quality ✅ Passed The parent-to-HEAD diff changes only YAML, OWNERS, and Bash files; it adds or modifies no Ginkgo test code, so these Ginkgo quality requirements are not applicable.
Microshift Test Compatibility ✅ Passed The PR changes only CI YAML, OWNERS, and shell/step-registry files; searches found no new Ginkgo It, Describe, Context, or When declarations to assess for MicroShift compatibility.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch adds CI YAML, a shell readiness step, OWNERS, and a step reference; it adds no Ginkgo test declarations or test source files, so SNO compatibility is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes CI step references and readiness/scanner scripts only; the diff adds no affinity, spread, replica, selector, toleration, PDB, or topology-dependent scheduling constraint.
Ote Binary Stdout Contract ✅ Passed The commit changes only YAML, OWNERS, and Bash CI steps; it adds no Go/OTE binary entry points or process-level stdout code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The full PR range adds YAML jobs and Bash step refs only; no changed file contains Ginkgo tests, IPv4-only logic, public URLs, or external service calls.
No-Weak-Crypto ✅ Passed The patch adds no MD5, SHA1, DES, 3DES, RC4, Blowfish, or ECB usage, and contains no custom crypto or secret/token comparisons.
Container-Privileges ✅ Passed PR-added lines contain no prohibited privilege settings; all four TLS jobs set SCANNER_NAMESPACE=oran-o2ims, selecting the scanner branch with hostNetwork/hostPID false and allowPrivilegeEscalation...
No-Sensitive-Data-In-Logs ✅ Passed The extracted ref logs resource metadata, selectors, pod status, and filtered events; secret reads go to /dev/null, and the scanner logging is unchanged in this commit.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rauhersu
Once this PR has been reviewed and has the lgtm label, please assign rhmdnd, sakhoury 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

@rauhersu

rauhersu commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/hold

We depend on this PR: #82154

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 10, 2026
@openshift-ci
openshift-ci Bot requested review from dgoodwin and irinamihai August 10, 2026 16:23
@openshift-ci openshift-ci Bot added the do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. label Aug 10, 2026
@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The OWNERS file contains untrusted users, which makes it INVALID. The following users are mentioned in OWNERS file(s) but are untrusted for the following reasons. One way to make the user trusted is to add them as members of the openshift org. You can then trigger verification by writing /verify-owners in a comment.

  • rauhersu
    • User is not a member of the org. User is not a collaborator. Satisfy at least one of these conditions to make the user trusted.
    • ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/OWNERS

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 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
`@ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/oran-o2ims-wait-for-tls-pods-commands.sh`:
- Around line 70-76: Update the secret check in the wait-for-TLS-pods loop to
poll each configured service-ca secret until it exists or the existing deadline
expires, rather than calling oc get secret only once. Keep the current success
output, and set FAILED only after the polling deadline is reached; use the
existing deadline and polling conventions in the script.

In `@ci-operator/step-registry/tls/scanner/run/tls-scanner-run-commands.sh`:
- Around line 9-16: Update the externally owned namespace flow in
tls-scanner-run-commands.sh to create and use a scanner-specific service account
instead of the namespace’s default service account. Change the later
cluster-admin binding to target that account, track the run-scoped binding, and
ensure cleanup removes the binding and scanner service account while preserving
existing namespace ownership behavior.
- Around line 9-16: Update the scanner run flow to use a unique per-run pod
identity when jobs share SCANNER_NAMESPACE, rather than the fixed tls-scanner
name. Propagate that identity through every pod creation, lookup, wait, result
retrieval, RBAC/cluster-admin operation, purge, and cleanup path; alternatively
enforce single-flight execution per namespace.

In `@ci-operator/step-registry/tls/scanner/run/tls-scanner-run-ref.yaml`:
- Around line 10-15: Update the SCANNER_NAMESPACE documentation and the
top-level scanner documentation to describe its security contract: deployments
use the existing namespace with non-host, PodSecurity-restricted pods, without
hostNetwork, hostPID, root, privileged mode, or privileged SCC. Document that
management-cluster scans use SCAN_NAMESPACE as the deployment namespace when
TLS_SCANNER_CLUSTER_LABEL=management.
🪄 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: Pro Plus

Run ID: 1a71483b-7401-4653-ab94-c5b80fdea45c

📥 Commits

Reviewing files that changed from the base of the PR and between 2d2a11c and b1e8bfd.

⛔ Files ignored due to path filters (4)
  • ci-operator/jobs/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-main-periodics.yaml is excluded by !ci-operator/jobs/**
  • ci-operator/jobs/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-main-presubmits.yaml is excluded by !ci-operator/jobs/**
  • ci-operator/jobs/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-release-4.22-periodics.yaml is excluded by !ci-operator/jobs/**
  • ci-operator/jobs/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-release-4.22-presubmits.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (7)
  • ci-operator/config/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-main.yaml
  • ci-operator/config/openshift-kni/oran-o2ims/openshift-kni-oran-o2ims-release-4.22.yaml
  • ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/OWNERS
  • ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/oran-o2ims-wait-for-tls-pods-commands.sh
  • ci-operator/step-registry/oran-o2ims/wait-for-tls-pods/oran-o2ims-wait-for-tls-pods-ref.yaml
  • ci-operator/step-registry/tls/scanner/run/tls-scanner-run-commands.sh
  • ci-operator/step-registry/tls/scanner/run/tls-scanner-run-ref.yaml

Comment thread ci-operator/step-registry/tls/scanner/run/tls-scanner-run-ref.yaml
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@rauhersu: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
pull-ci-openshift-custom-metrics-autoscaler-operator-main-cma-e2e-aws-ovn openshift/custom-metrics-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-custom-metrics-autoscaler-operator-release-5.1-cma-e2e-aws-ovn openshift/custom-metrics-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-custom-metrics-autoscaler-operator-release-5.0-cma-e2e-aws-ovn openshift/custom-metrics-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-custom-metrics-autoscaler-operator-release-4.23-cma-e2e-aws-ovn openshift/custom-metrics-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-cincinnati-operator-master-install-bundle-tls-scan openshift/cincinnati-operator presubmit Registry content changed
pull-ci-openshift-gcp-filestore-csi-driver-operator-main-tls-scanner-gcp-filestore openshift/gcp-filestore-csi-driver-operator presubmit Registry content changed
pull-ci-openshift-gcp-filestore-csi-driver-operator-release-5.1-tls-scanner-gcp-filestore openshift/gcp-filestore-csi-driver-operator presubmit Registry content changed
pull-ci-openshift-gcp-filestore-csi-driver-operator-release-5.0-tls-scanner-gcp-filestore openshift/gcp-filestore-csi-driver-operator presubmit Registry content changed
pull-ci-openshift-gcp-filestore-csi-driver-operator-release-4.23-tls-scanner-gcp-filestore openshift/gcp-filestore-csi-driver-operator presubmit Registry content changed
pull-ci-openshift-vertical-pod-autoscaler-operator-main-e2e-aws-olm openshift/vertical-pod-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-vertical-pod-autoscaler-operator-release-5.1-e2e-aws-olm openshift/vertical-pod-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-vertical-pod-autoscaler-operator-release-5.0-e2e-aws-olm openshift/vertical-pod-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-vertical-pod-autoscaler-operator-release-4.23-e2e-aws-olm openshift/vertical-pod-autoscaler-operator presubmit Registry content changed
pull-ci-openshift-machine-config-operator-main-tls-pqc-readiness openshift/machine-config-operator presubmit Registry content changed
pull-ci-openshift-machine-config-operator-release-5.1-tls-pqc-readiness openshift/machine-config-operator presubmit Registry content changed
pull-ci-openshift-machine-config-operator-release-5.0-tls-pqc-readiness openshift/machine-config-operator presubmit Registry content changed
pull-ci-openshift-machine-config-operator-release-4.23-tls-pqc-readiness openshift/machine-config-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-dev-4.22-tls-pqc-readiness openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-dev-4.22-tls13-adherence openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-tls-pqc-readiness openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.23-tls13-adherence openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-tls-pqc-readiness openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-oadp-operator-oadp-1.6-4.22-tls13-adherence openshift/oadp-operator presubmit Registry content changed
pull-ci-openshift-windows-machine-config-operator-master-tls-scanner openshift/windows-machine-config-operator presubmit Registry content changed
pull-ci-openshift-windows-machine-config-operator-release-5.1-tls-scanner openshift/windows-machine-config-operator presubmit Registry content changed

A total of 135 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs.

A full list of affected jobs can be found here
Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants