Skip to content

TRT-2618: resource watch env var support - #83149

Open
neisw wants to merge 1 commit into
openshift:mainfrom
neisw:trt-2618-resource-watch-envvars
Open

TRT-2618: resource watch env var support#83149
neisw wants to merge 1 commit into
openshift:mainfrom
neisw:trt-2618-resource-watch-envvars

Conversation

@neisw

@neisw neisw commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Updated OpenShift nightly 5.0 and 5.1 e2e-gcp-ovn-rt jobs to enable resource watching and resource event collection.
  • Added environment-variable controls for resource monitoring and event collection in the resource-watch observer.
  • The observer now adds --enable-events only when event collection is enabled and starts resource monitoring only when RESOURCE_MONITOR_ENABLED is enabled.

@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 9, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@neisw: This pull request references TRT-2618 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 story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

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 requested review from petr-muller and stbenjam August 9, 2026 13:06
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The resource-watch observer now controls event collection and resource monitoring through environment variables. The nightly 5.0 and 5.1 GCP OVN real-time test configurations enable the relevant controls.

Changes

Resource observation controls

Layer / File(s) Summary
Conditional observer execution
ci-operator/step-registry/observers/resource-watch/observers-resource-watch-observer.yaml, ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh
The observer adds disabled-by-default controls for event collection and resource monitoring. The commands add --enable-events and start run-monitor only when the corresponding controls are enabled.
GCP OVN test configuration
ci-operator/config/openshift/release/openshift-release-main__nightly-5.0.yaml, ci-operator/config/openshift/release/openshift-release-main__nightly-5.1.yaml
The nightly GCP OVN real-time test configurations set resource observation environment flags. nightly-5.1 also enables resource monitoring.

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

Sequence Diagram(s)

sequenceDiagram
  participant TestConfig
  participant ResourceWatchObserver
  participant ResourceWatchCommands
  participant run-resourcewatch
  participant run-monitor
  TestConfig->>ResourceWatchObserver: set resource observation variables
  ResourceWatchObserver->>ResourceWatchCommands: provide enabled controls
  ResourceWatchCommands->>run-resourcewatch: use --enable-events when enabled
  ResourceWatchCommands->>run-monitor: start when monitoring is enabled
Loading
🚥 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 resource-watch environment variable support added by the pull request.
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 four changed files contain no Ginkgo test-title declarations; added lines only set observer flags and invoke commands with static monitor test IDs.
Test Structure And Quality ✅ Passed The PR changes only YAML configuration and a shell observer; it adds no Ginkgo tests or It blocks, so the specified test-structure checks are not applicable.
Microshift Test Compatibility ✅ Passed The PR changes only CI YAML and resource-watch shell/observer files; it adds no Ginkgo e2e tests or test references to MicroShift-unavailable APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch changes only YAML and resource-watch shell configuration; it adds no Ginkgo declarations or tests, so SNO compatibility checks are not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed The diff only adds CI environment variables and gates observer processes; no deployment, controller, replica, affinity, topology spread, selector, toleration, or PDB scheduling constraint was added.
Ote Binary Stdout Contract ✅ Passed The PR changes only YAML and shell files; both openshift-tests invocations redirect stdout and stderr to artifact logs, and no main or suite setup code changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The patch changes only release YAML and resource-watch shell/YAML files; it adds no Ginkgo tests, IPv4 assumptions, or external connectivity requirements.
No-Weak-Crypto ✅ Passed The added lines only configure resource watching, event collection, and monitoring; crypto search found no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The added lines only set resource-watch environment variables and conditionally pass observer flags; no privileged, host namespace, SYS_ADMIN, escalation, root, or securityContext settings were added.
No-Sensitive-Data-In-Logs ✅ Passed Added code contains only boolean flags and --enable-events; no new echo or sensitive literals. Command output remains in existing artifact logs, and existing path/registry logging is unchanged.
✨ 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 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neisw

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 Aug 9, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@neisw: 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-operator-framework-operator-controller-main-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-main-e2e-aws-upgrade-ovn-single-node openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-5.1-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-5.1-e2e-aws-upgrade-ovn-single-node openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-5.0-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-5.0-e2e-aws-upgrade-ovn-single-node openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-4.23-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-4.23-e2e-aws-upgrade-ovn-single-node openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-4.22-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-4.22-e2e-aws-upgrade-ovn-single-node openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-operator-framework-operator-controller-release-4.21-e2e-gcp-ovn-upgrade openshift/operator-framework-operator-controller presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-main-e2e-aws-capi-disconnected-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-5.1-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-5.1-e2e-aws-capi-disconnected-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-5.0-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-5.0-e2e-aws-capi-disconnected-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-4.23-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-4.23-e2e-aws-capi-disconnected-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-4.22-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-openshift-cluster-capi-operator-release-4.21-e2e-aws-capi-techpreview openshift/cluster-capi-operator presubmit Registry content changed
pull-ci-rh-ecosystem-edge-recert-main-e2e-aws-ovn-single-node-recert-serial rh-ecosystem-edge/recert presubmit Registry content changed
pull-ci-rh-ecosystem-edge-recert-main-e2e-aws-ovn-single-node-recert-parallel rh-ecosystem-edge/recert presubmit Registry content changed
pull-ci-rh-ecosystem-edge-recert-main-e2e-aws-ovn-single-node-recert-openshift-e2e-test-qe rh-ecosystem-edge/recert presubmit Registry content changed
pull-ci-rh-ecosystem-edge-recert-release-4.22-e2e-aws-ovn-single-node-recert-serial rh-ecosystem-edge/recert presubmit Registry content changed

A total of 2940 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.

@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: 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
`@ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh`:
- Line 84: Quote STORE_PATH in the run-monitor invocation and the cleanup
commands so its value is passed as a single literal argument, preserving
whitespace and preventing glob expansion; update each command use consistently.
🪄 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: 6bb73eb9-c488-4c18-9dad-ae5a79d42502

📥 Commits

Reviewing files that changed from the base of the PR and between 8c632ba and 6449ad8.

📒 Files selected for processing (4)
  • ci-operator/config/openshift/release/openshift-release-main__nightly-5.0.yaml
  • ci-operator/config/openshift/release/openshift-release-main__nightly-5.1.yaml
  • ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh
  • ci-operator/step-registry/observers/resource-watch/observers-resource-watch-observer.yaml


if [[ "${RESOURCE_MONITOR_ENABLED:-false}" == "true" ]]; then
DISABLED_MONITOR_TESTS="apiserver-new-disruption-invariant,disruption-summary-serializer,incluster-disruption-serializer,pod-network-avalibility"
openshift-tests run-monitor ${MONITOR_ARGS:-} --artifact-dir $STORE_PATH --disable-monitor=${DISABLED_MONITOR_TESTS} > "${ARTIFACT_DIR}/run-monitor.log" 2>&1 &

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -e
file="$(fd -i -t f 'observers-resource-watch-commands\.sh$' . | head -n 1)"
printf '%s\n' "FILE=$file"
wc -l "$file"
cat -n "$file"
printf '\n--- lifecycle references ---\n'
rg -n 'run-monitor|STORE_PATH|wait|kill|ARTIFACT_DIR|DISABLED_MONITOR_TESTS|MONITOR_ARGS' "$file"

Repository: openshift/release

Length of output: 5081


🏁 Script executed:

#!/bin/bash
set -euo pipefail

probe() {
  local label="$1"
  local store_path="$2"
  STORE_PATH="$store_path"
  MONITOR_ARGS=""
  DISABLED_MONITOR_TESTS="disabled"
  openshift-tests() {
    printf '%s argc=%s\n' "$label" "$#"
    printf '  <%s>\n' "$@" 
  }
  export -f openshift-tests
  bash -c '
    openshift-tests run-monitor ${MONITOR_ARGS:-} --artifact-dir $STORE_PATH --disable-monitor=${DISABLED_MONITOR_TESTS} > /dev/null
  ' 2>/dev/null || true
}

probe "whitespace-unquoted" "/tmp/path with spaces"
probe "glob-unquoted" "/tmp/*"

printf '\nquoted controls\n'
probe_quoted() {
  local label="$1"
  local store_path="$2"
  STORE_PATH="$store_path"
  MONITOR_ARGS=""
  DISABLED_MONITOR_TESTS="disabled"
  openshift-tests() {
    printf '%s argc=%s\n' "$label" "$#"
    printf '  <%s>\n' "$@"
  }
  openshift-tests run-monitor ${MONITOR_ARGS:-} --artifact-dir "$STORE_PATH" --disable-monitor="${DISABLED_MONITOR_TESTS}" > /dev/null
}
probe_quoted "whitespace-quoted" "/tmp/path with spaces"
probe_quoted "glob-quoted" "/tmp/*"

printf '\nSTORE_PATH occurrences\n'
rg -n '\$STORE_PATH|STORE_PATH' ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh

Repository: openshift/release

Length of output: 825


🏁 Script executed:

#!/bin/bash
set -euo pipefail

openshift-tests() {
  printf '%s argc=%s\n' "$1" "$#" >&2
  shift
  printf '  <%s>\n' "$@" >&2
}

run_unquoted() {
  local label="$1"
  STORE_PATH="$2"
  MONITOR_ARGS=""
  DISABLED_MONITOR_TESTS="disabled"
  printf '%s STORE_PATH=%q\n' "$label" "$STORE_PATH"
  openshift-tests run-monitor ${MONITOR_ARGS:-} --artifact-dir $STORE_PATH --disable-monitor=${DISABLED_MONITOR_TESTS} > /dev/null
}

run_quoted() {
  local label="$1"
  STORE_PATH="$2"
  MONITOR_ARGS=""
  DISABLED_MONITOR_TESTS="disabled"
  printf '%s STORE_PATH=%q\n' "$label" "$STORE_PATH"
  openshift-tests run-monitor ${MONITOR_ARGS:-} --artifact-dir "$STORE_PATH" --disable-monitor="${DISABLED_MONITOR_TESTS}" > /dev/null
}

run_unquoted "whitespace-unquoted" "/tmp/path with spaces"
run_unquoted "glob-unquoted" "/tmp/*"
run_quoted "whitespace-quoted" "/tmp/path with spaces"
run_quoted "glob-quoted" "/tmp/*"

printf '\nSTORE_PATH occurrences:\n'
rg -n '\$STORE_PATH|STORE_PATH' ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh

Repository: openshift/release

Length of output: 1904


Quote STORE_PATH in all command uses.

If STORE_PATH contains whitespace or glob characters, shell expansion changes the arguments. Quote it in run-monitor and in the cleanup commands at lines 31–32.

🧰 Tools
🪛 Shellcheck (0.11.0)

[info] 84-84: Double quote to prevent globbing and word splitting.

(SC2086)


[info] 84-84: Double quote to prevent globbing and word splitting.

(SC2086)

🤖 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
`@ci-operator/step-registry/observers/resource-watch/observers-resource-watch-commands.sh`
at line 84, Quote STORE_PATH in the run-monitor invocation and the cleanup
commands so its value is passed as a single literal argument, preserving
whitespace and preventing glob expansion; update each command use consistently.

Source: Linters/SAST tools

@neisw

neisw commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-rt /pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-gcp-ovn-rt /pj-rehearse periodic-ci-openshift-release-main-nightly-5.1-e2e-gcp-ovn-rt periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@neisw: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@neisw: job(s): /pj-rehearse, /pj-rehearse either don't exist or were not found to be affected, and cannot be rehearsed

@neisw

neisw commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-rt

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@neisw: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

@neisw: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips 6449ad8 link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-5.0-e2e-aws-ovn-upgrade-fips
ci/rehearse/periodic-ci-openshift-release-main-nightly-5.1-e2e-gcp-ovn-rt 6449ad8 link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-5.1-e2e-gcp-ovn-rt
ci/rehearse/periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-rt 6449ad8 link unknown /pj-rehearse periodic-ci-openshift-release-main-nightly-4.22-e2e-gcp-ovn-rt

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

approved Indicates a PR has been approved by an approver from all required OWNERS files. 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