Skip to content

feat(e2e test): add e2e test to verify udp recovery - #3346

Open
jcantrill wants to merge 2 commits into
openshift:masterfrom
jcantrill:log9560
Open

feat(e2e test): add e2e test to verify udp recovery#3346
jcantrill wants to merge 2 commits into
openshift:masterfrom
jcantrill:log9560

Conversation

@jcantrill

@jcantrill jcantrill commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

This PR:

  • adds e2e test to verify recovery of syslog UDP
  • adds manifests for testing syslog receiver

Links

Summary by CodeRabbit

  • New Features

    • Added a synthetic log-generator deployment with configurable rate/payload size, Prometheus metrics, and kustomize overlays.
    • Extended ClusterLogForwarder syslog support with rsyslog over UDP using RFC5424 formatting and Kubernetes-aware enrichment.
    • Added an E2E entrypoint and a CI-focused test-e2e-from-ci-bundle execution target.
  • Bug Fixes

    • Improved deployment label/selector consistency.
    • Updated ClusterLogForwarder manifest behavior (namespace/pipeline input configuration).
  • Tests

    • Added E2E syslog UDP recovery coverage across ClusterIP and NodePort receiver setups; introduced shared syslog helpers and improved test/logging behavior.

@jcantrill

Copy link
Copy Markdown
Contributor Author

cc @vparfonov @Clee2691

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds namespace-aware syslog receiver helpers, shared syslog utilities, log-generator manifests and builders, UDP forwarding configuration, recovery E2E coverage, and controlled E2E logging.

Changes

Syslog recovery and test infrastructure

Layer / File(s) Summary
Shared syslog helpers and receiver resources
test/helpers/syslog/*, test/framework/e2e/syslog.go
Centralizes RFC parsing and rsyslog configuration, scopes receiver resources and polling to explicit namespaces, and records application logs in /tmp/app.log.
Log-generator and forwarding configuration
hack/manifests/log-generator/*, hack/manifests/clusterlogforwarder/*, test/runtime/..., internal/factory/deployment.go
Adds log-generator resources and overlays, configures UDP RFC5424 forwarding, fixes deployment template labels, and supports ClusterLogForwarder visitors.
UDP recovery E2E coverage
test/e2e/logforwarding/syslog/*
Tests application-log recovery after repeated receiver pod deletion for ClusterIP and NodePort services.
Functional syslog integration
test/framework/functional/..., test/functional/inputs/syslog/*
Updates functional syslog configuration, image references, imports, and sender error text to use shared helpers.
E2E execution and logging controls
Makefile, hack/test-e2e-from-ci-bundle.sh, test/framework/e2e/framework.go, test/framework/e2e/wait.go
Adds a CI-bundle E2E target and moves lifecycle and wait messages to controlled verbosity levels.

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

Suggested reviewers: vparfonov, clee2691

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning It includes intent and links, but the template's mandatory /cc and /assign sections are missing. Add the required /cc and /assign lines, and keep the Description and Links sections filled out per the template.
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding an e2e test for UDP recovery.
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 unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from Clee2691 and vparfonov July 14, 2026 21:04
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcantrill

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 Jul 14, 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: 7

🧹 Nitpick comments (2)
hack/manifests/log-generator/base/log_generator_deployment.yaml (2)

16-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pin the log-generator image to an immutable version.

:latest with imagePullPolicy: Always makes recovery-test results depend on unreviewed registry changes. Use a reviewed release tag or, preferably, an image digest.

🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml` around lines
16 - 17, Update the image reference in the log-generator deployment manifest
from the mutable latest tag to a reviewed release tag or immutable digest, while
preserving the existing imagePullPolicy behavior.

8-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add the same hardening pattern and pin the image tag
Mirror test/runtime/log_generator.go’s pod/container securityContext here, and replace quay.io/openshift-logging/cluster-logging-load-client:latest with a fixed tag so this deployment stays reproducible.

🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml` around lines
8 - 17, The log-generator container lacks the security hardening used by
test/runtime/log_generator.go and uses a mutable image tag. Update the container
under name log-generator to mirror that pod/container securityContext, and
replace the :latest image reference with a fixed version tag.

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 `@hack/manifests/log-generator/base/servicemonitor.yaml`:
- Around line 10-12: Update the ServiceMonitor configuration around jobLabel to
remove it or set it to an existing app.kubernetes.io/* Service label key defined
by the log-generator kustomization. Do not use the literal monitor-log-generator
value, and preserve the existing endpoint configuration.
- Around line 6-9: Update the ServiceMonitor spec.selector structure so the
existing log-generator labels are nested under selector.matchLabels, preserving
all label keys and values unchanged.

In `@test/e2e/logforwarding/syslog/recovery_test.go`:
- Around line 129-134: The NodePort recovery scenario must target the NodePort
endpoint rather than the service DNS address. In the “when using a NodePort
service” test, after CreateSyslogService returns, obtain the allocated nodePort
and a reachable node IP, update the sink/forwarder URL to use that IP and port,
then run podDeleteTest().
- Around line 109-118: Update the repeated deletion loop in the syslog recovery
test to track the current receiver pod UID, delete the receiver pod, and wait
for a newly recreated ready pod with a different UID before the next iteration.
Replace the fixed 5-second sleep with the existing pod readiness/wait mechanism,
while preserving the deployment replica availability assertion.

In `@test/framework/e2e/framework.go`:
- Around line 106-120: Update E2ETestFramework.Delete to return an
unsupported-kind error when the core-group switch does not assign kind, before
invoking kind.Delete. Preserve the existing Service handling and non-core error
behavior, and ensure no method is called on a nil kind.

In `@test/framework/functional/outputs/syslog/sender.go`:
- Line 30: Update the error returned by the input lookup in the relevant sender
function to identify the missing syslog input rather than an HTTP input, while
preserving the inputName value and existing error behavior.

In `@test/helpers/syslog/syslog.go`:
- Around line 24-34: Update the combined-RFC case in MustParseRFC to match the
uppercased input produced by strings.ToUpper, while preserving the existing
RFC3164 and RFC5424 mappings.

---

Nitpick comments:
In `@hack/manifests/log-generator/base/log_generator_deployment.yaml`:
- Around line 16-17: Update the image reference in the log-generator deployment
manifest from the mutable latest tag to a reviewed release tag or immutable
digest, while preserving the existing imagePullPolicy behavior.
- Around line 8-17: The log-generator container lacks the security hardening
used by test/runtime/log_generator.go and uses a mutable image tag. Update the
container under name log-generator to mirror that pod/container securityContext,
and replace the :latest image reference with a fixed version tag.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1d449ea3-f28d-417e-bf57-33c902d714b0

📥 Commits

Reviewing files that changed from the base of the PR and between 678d2ac and f6aabd3.

📒 Files selected for processing (21)
  • hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml
  • hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml
  • hack/manifests/log-generator/base/kustomization.yaml
  • hack/manifests/log-generator/base/log_generator_deployment.yaml
  • hack/manifests/log-generator/base/service.yaml
  • hack/manifests/log-generator/base/servicemonitor.yaml
  • hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml
  • hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml
  • internal/factory/deployment.go
  • test/e2e/logforwarding/syslog/recovery_test.go
  • test/e2e/logforwarding/syslog/syslog_suite_test.go
  • test/framework/e2e/framework.go
  • test/framework/e2e/syslog.go
  • test/framework/e2e/wait.go
  • test/framework/functional/output_syslog.go
  • test/framework/functional/outputs/syslog/sender.go
  • test/functional/inputs/syslog/syslog_input_test.go
  • test/helpers/syslog/syslog.go
  • test/helpers/syslog/syslog_conf.go
  • test/runtime/log_generator.go
  • test/runtime/observability/cluster_log_forwarder.go

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

🧹 Nitpick comments (2)
hack/manifests/log-generator/base/log_generator_deployment.yaml (2)

16-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pin the log-generator image to an immutable version.

:latest with imagePullPolicy: Always makes recovery-test results depend on unreviewed registry changes. Use a reviewed release tag or, preferably, an image digest.

🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml` around lines
16 - 17, Update the image reference in the log-generator deployment manifest
from the mutable latest tag to a reviewed release tag or immutable digest, while
preserving the existing imagePullPolicy behavior.

8-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add the same hardening pattern and pin the image tag
Mirror test/runtime/log_generator.go’s pod/container securityContext here, and replace quay.io/openshift-logging/cluster-logging-load-client:latest with a fixed tag so this deployment stays reproducible.

🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml` around lines
8 - 17, The log-generator container lacks the security hardening used by
test/runtime/log_generator.go and uses a mutable image tag. Update the container
under name log-generator to mirror that pod/container securityContext, and
replace the :latest image reference with a fixed version tag.

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 `@hack/manifests/log-generator/base/servicemonitor.yaml`:
- Around line 10-12: Update the ServiceMonitor configuration around jobLabel to
remove it or set it to an existing app.kubernetes.io/* Service label key defined
by the log-generator kustomization. Do not use the literal monitor-log-generator
value, and preserve the existing endpoint configuration.
- Around line 6-9: Update the ServiceMonitor spec.selector structure so the
existing log-generator labels are nested under selector.matchLabels, preserving
all label keys and values unchanged.

In `@test/e2e/logforwarding/syslog/recovery_test.go`:
- Around line 129-134: The NodePort recovery scenario must target the NodePort
endpoint rather than the service DNS address. In the “when using a NodePort
service” test, after CreateSyslogService returns, obtain the allocated nodePort
and a reachable node IP, update the sink/forwarder URL to use that IP and port,
then run podDeleteTest().
- Around line 109-118: Update the repeated deletion loop in the syslog recovery
test to track the current receiver pod UID, delete the receiver pod, and wait
for a newly recreated ready pod with a different UID before the next iteration.
Replace the fixed 5-second sleep with the existing pod readiness/wait mechanism,
while preserving the deployment replica availability assertion.

In `@test/framework/e2e/framework.go`:
- Around line 106-120: Update E2ETestFramework.Delete to return an
unsupported-kind error when the core-group switch does not assign kind, before
invoking kind.Delete. Preserve the existing Service handling and non-core error
behavior, and ensure no method is called on a nil kind.

In `@test/framework/functional/outputs/syslog/sender.go`:
- Line 30: Update the error returned by the input lookup in the relevant sender
function to identify the missing syslog input rather than an HTTP input, while
preserving the inputName value and existing error behavior.

In `@test/helpers/syslog/syslog.go`:
- Around line 24-34: Update the combined-RFC case in MustParseRFC to match the
uppercased input produced by strings.ToUpper, while preserving the existing
RFC3164 and RFC5424 mappings.

---

Nitpick comments:
In `@hack/manifests/log-generator/base/log_generator_deployment.yaml`:
- Around line 16-17: Update the image reference in the log-generator deployment
manifest from the mutable latest tag to a reviewed release tag or immutable
digest, while preserving the existing imagePullPolicy behavior.
- Around line 8-17: The log-generator container lacks the security hardening
used by test/runtime/log_generator.go and uses a mutable image tag. Update the
container under name log-generator to mirror that pod/container securityContext,
and replace the :latest image reference with a fixed version tag.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1d449ea3-f28d-417e-bf57-33c902d714b0

📥 Commits

Reviewing files that changed from the base of the PR and between 678d2ac and f6aabd3.

📒 Files selected for processing (21)
  • hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml
  • hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml
  • hack/manifests/log-generator/base/kustomization.yaml
  • hack/manifests/log-generator/base/log_generator_deployment.yaml
  • hack/manifests/log-generator/base/service.yaml
  • hack/manifests/log-generator/base/servicemonitor.yaml
  • hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml
  • hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml
  • internal/factory/deployment.go
  • test/e2e/logforwarding/syslog/recovery_test.go
  • test/e2e/logforwarding/syslog/syslog_suite_test.go
  • test/framework/e2e/framework.go
  • test/framework/e2e/syslog.go
  • test/framework/e2e/wait.go
  • test/framework/functional/output_syslog.go
  • test/framework/functional/outputs/syslog/sender.go
  • test/functional/inputs/syslog/syslog_input_test.go
  • test/helpers/syslog/syslog.go
  • test/helpers/syslog/syslog_conf.go
  • test/runtime/log_generator.go
  • test/runtime/observability/cluster_log_forwarder.go
🛑 Comments failed to post (7)
hack/manifests/log-generator/base/servicemonitor.yaml (2)

6-9: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-files 'hack/manifests/log-generator/base/*' 'hack/manifests/log-generator/**' | sed -n '1,200p'

echo
echo '--- servicemonitor.yaml ---'
cat -n hack/manifests/log-generator/base/servicemonitor.yaml

echo
echo '--- service.yaml ---'
if [ -f hack/manifests/log-generator/base/service.yaml ]; then
  cat -n hack/manifests/log-generator/base/service.yaml
fi

echo
echo '--- kustomization.yaml ---'
if [ -f hack/manifests/log-generator/base/kustomization.yaml ]; then
  cat -n hack/manifests/log-generator/base/kustomization.yaml
fi

Repository: openshift/cluster-logging-operator

Length of output: 1797


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- ServiceMonitor usages ---'
rg -n --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' 'kind:\s*ServiceMonitor|selector:' hack/manifests -n

echo
echo '--- CRD/schema references for ServiceMonitor ---'
rg -n 'ServiceMonitor|matchLabels|jobLabel|podTargetLabels' -g '*.yaml' -g '*.yml' -g '*.json' -g '*.md' .

echo
echo '--- any other servicemonitor.yaml files ---'
fd -a 'servicemonitor.*' .

Repository: openshift/cluster-logging-operator

Length of output: 8560


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- jobLabel references in repo ---'
rg -n 'jobLabel:' hack config bundle internal docs -g '*.yaml' -g '*.yml' -g '*.md'

echo
echo '--- prometheus operator servicemonitor examples in repo ---'
sed -n '1,120p' config/prometheus/servicemonitor.yaml
echo
sed -n '1,120p' bundle/manifests/cluster-logging-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml

echo
echo '--- Service label usage in log-generator base ---'
cat -n hack/manifests/log-generator/base/service.yaml

Repository: openshift/cluster-logging-operator

Length of output: 2027


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- ServiceMonitor schema snippets ---'
rg -n -A4 -B4 'jobLabel|selector:' bundle/manifests/cluster-logging-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml config/prometheus/servicemonitor.yaml

echo
echo '--- any ServiceMonitor docs in repo ---'
rg -n -A3 -B3 'jobLabel|matchLabels|LabelSelector' docs config bundle hack -g '*.yaml' -g '*.yml' -g '*.md'

Repository: openshift/cluster-logging-operator

Length of output: 50390


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- bundled ServiceMonitor schema around jobLabel ---'
rg -n -A8 -B8 'jobLabel:' bundle/manifests/cluster-logging-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml

echo
echo '--- bundled ServiceMonitor schema around selector ---'
rg -n -A8 -B8 'selector:' bundle/manifests/cluster-logging-operator-metrics-monitor_monitoring.coreos.com_v1_servicemonitor.yaml

Repository: openshift/cluster-logging-operator

Length of output: 226


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- log-generator kustomization ---'
cat -n hack/manifests/log-generator/base/kustomization.yaml

echo
echo '--- any kustomize configurations in log-generator tree ---'
rg -n 'configurations:|FieldSpec|ServiceMonitor|selector' hack/manifests/log-generator -g '*.yaml' -g '*.yml'

echo
echo '--- any repository kustomize configs mentioning ServiceMonitor selectors ---'
rg -n 'ServiceMonitor|spec\.selector|matchLabels' config hack bundle -g '*kustomization*.yaml' -g '*.yaml' -g '*.yml'

Repository: openshift/cluster-logging-operator

Length of output: 8157


🌐 Web query:

Prometheus Operator ServiceMonitor jobLabel missing service label fallback semantics

💡 Result:

In the Prometheus Operator, the jobLabel field in a ServiceMonitor specifies which label from the associated Kubernetes Service object should be used as the value for the job label on the ingested metrics [1][2][3]. If the jobLabel field is left empty, or if the specified label does not exist on the associated Kubernetes Service, the Prometheus Operator defaults the job label to the name of that Kubernetes Service [1][4][2]. This fallback behavior ensures that every set of metrics scraped via a ServiceMonitor consistently receives a job label, even in the absence of explicit label mapping [1][3].

Citations:


🌐 Web query:

kustomize labels includeSelectors ServiceMonitor selector matchLabels raw labels

💡 Result:

In Kustomize, applying labels to resources while managing their inclusion in selectors (such as spec.selector.matchLabels in a ServiceMonitor or Deployment) is handled primarily through the labels field in your kustomization.yaml [1][2]. The labels field provides finer control than the deprecated commonLabels field [1][2]. By using the labels block, you can explicitly control whether labels are propagated to selectors using the includeSelectors boolean flag [3][4]. Key Behavior and Configuration: 1. Labels Configuration: You can specify a list of label pairs and define their behavior using includeSelectors [3][1]. When set to true, the labels are added to both the metadata.labels and relevant selectors [3][1]. Example: labels: - pairs: app: my-app includeSelectors: false 2. Impact on Selectors (e.g., ServiceMonitor): When includeSelectors is set to false, Kustomize will apply the labels to the resource's metadata.labels but will refrain from injecting them into the spec.selector.matchLabels section [3]. This is critical for resources like ServiceMonitors or Deployments where you might have immutable or specific selectors that you do not want to be modified by a global label transformer [5][6]. 3. Regarding commonLabels: Note that commonLabels is considered deprecated in favor of the more flexible labels field [2]. commonLabels does not provide an includeSelectors option and will consistently apply labels to all selectors it identifies, which often causes issues with existing matchLabels [5][7]. If you need to avoid modifying selectors, migrating to the labels configuration is the recommended approach [3][1]. If includeSelectors: false does not provide sufficient granularity (for instance, if you still want labels on pod templates but not on service selectors), you may need to use a custom patch or a replacements configuration to precisely target the fields you wish to modify, bypassing the blanket behavior of the built-in label transformers [6][8][7].

Citations:


Nest the selector under matchLabels.
spec.selector expects a LabelSelector, so this needs:

selector:
  matchLabels:
    app.kubernetes.io/name: log-generator
    app.kubernetes.io/component: log-generator
    app.kubernetes.io/part-of: cluster-logging
🤖 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 `@hack/manifests/log-generator/base/servicemonitor.yaml` around lines 6 - 9,
Update the ServiceMonitor spec.selector structure so the existing log-generator
labels are nested under selector.matchLabels, preserving all label keys and
values unchanged.

10-12: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== service monitor ==\n'
cat -n hack/manifests/log-generator/base/servicemonitor.yaml

printf '\n== service ==\n'
cat -n hack/manifests/log-generator/base/service.yaml

printf '\n== kustomization ==\n'
cat -n hack/manifests/log-generator/base/kustomization.yaml

printf '\n== search for monitor-log-generator ==\n'
rg -n "monitor-log-generator|jobLabel|labels:" hack/manifests/log-generator/base -S

Repository: openshift/cluster-logging-operator

Length of output: 1589


🌐 Web query:

Prometheus Operator jobLabel missing label fallback Service name documentation

💡 Result:

In the Prometheus Operator, the jobLabel field in a ServiceMonitor specifies which label from the associated Kubernetes Service object should be used as the source for the job label on the ingested metrics [1][2][3]. If the jobLabel field is left empty, or if the specified label does not exist on the associated Kubernetes Service, the job label on the metrics defaults to the name of the Kubernetes Service itself [1][2][3][4]. Official documentation clarifies that this mechanism is designed to provide a predictable job name even when custom labels are not explicitly defined or present on the service [1][2][3]. While older or unofficial documentation occasionally referenced Endpoints in relation to this fallback behavior, the authoritative specification confirms that the logic relies on the properties of the associated Kubernetes Service object [1][2][3][4].

Citations:


🌐 Web query:

prometheus-operator ServiceMonitor jobLabel missing label key falls back to service name

💡 Result:

Yes, that is correct. In the Prometheus Operator, the jobLabel field in a ServiceMonitor resource allows you to specify a label on the Kubernetes Service object to be used as the value for the job label in the ingested metrics [1][2][3]. If the jobLabel field is left empty, or if the specified label key does not exist on the associated Kubernetes Service object, the Prometheus Operator defaults the job label to the name of that Kubernetes Service [1][4][3]. This fallback behavior ensures that every scraped target receives a job label even when no custom mapping is provided [1][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "monitor-log-generator" -S .

Repository: openshift/cluster-logging-operator

Length of output: 265


Make jobLabel use an existing Service label key. hack/manifests/log-generator/base/servicemonitor.yaml sets jobLabel: monitor-log-generator, but the Service only gets the app.kubernetes.io/* labels from kustomization.yaml. Remove jobLabel or point it at one of those labels; otherwise Prometheus uses the Service name.

🤖 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 `@hack/manifests/log-generator/base/servicemonitor.yaml` around lines 10 - 12,
Update the ServiceMonitor configuration around jobLabel to remove it or set it
to an existing app.kubernetes.io/* Service label key defined by the
log-generator kustomization. Do not use the literal monitor-log-generator value,
and preserve the existing endpoint configuration.
test/e2e/logforwarding/syslog/recovery_test.go (2)

109-118: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,220p' test/e2e/logforwarding/syslog/recovery_test.go

Repository: openshift/cluster-logging-operator

Length of output: 6097


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,220p' test/e2e/logforwarding/syslog/recovery_test.go

Repository: openshift/cluster-logging-operator

Length of output: 6097


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "syslogDeployment|DeleteCollection|WaitForDeployment|labelSelector|replicas" test/e2e/logforwarding/syslog/recovery_test.go

Repository: openshift/cluster-logging-operator

Length of output: 879


Wait for a new ready pod before the next delete. A fixed 5-second sleep doesn’t guarantee the receiver was recreated, so some iterations may delete nothing. Track the current pod UID and wait for a different ready UID before continuing.

🤖 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/e2e/logforwarding/syslog/recovery_test.go` around lines 109 - 118,
Update the repeated deletion loop in the syslog recovery test to track the
current receiver pod UID, delete the receiver pod, and wait for a newly
recreated ready pod with a different UID before the next iteration. Replace the
fixed 5-second sleep with the existing pod readiness/wait mechanism, while
preserving the deployment replica availability assertion.

129-134: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target test file around the cited lines.
sed -n '1,240p' test/e2e/logforwarding/syslog/recovery_test.go

printf '\n--- SEARCH CreateSyslogService / podDeleteTest / destination config ---\n'
rg -n "CreateSyslogService|podDeleteTest|udp://|nodePort|ServiceTypeNodePort|SyslogReceiverName|syslogDeployment" test/e2e/logforwarding/syslog -S

printf '\n--- Outline any nearby helpers if present ---\n'
fd -a '.*\.go$' test/e2e/logforwarding/syslog | sed -n '1,120p'

Repository: openshift/cluster-logging-operator

Length of output: 7757


Replace the sink URL with the NodePort endpoint. Creating a NodePort Service here still leaves the forwarder targeting udp://<service>.<namespace>.svc:514, so traffic continues through the Service/ClusterIP path. Point it at a reachable node IP and the allocated nodePort before podDeleteTest().

🤖 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/e2e/logforwarding/syslog/recovery_test.go` around lines 129 - 134, The
NodePort recovery scenario must target the NodePort endpoint rather than the
service DNS address. In the “when using a NodePort service” test, after
CreateSyslogService returns, obtain the allocated nodePort and a reachable node
IP, update the sink/forwarder URL to use that IP and port, then run
podDeleteTest().
test/framework/e2e/framework.go (1)

106-120: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return an error for unsupported core kinds instead of panicking.

For a core object other than Service, kind remains nil and Line 120 invokes a method on it.

Proposed fix
 	switch gvk.Group {
 	case "":
 		switch gvk.Kind {
 		case "Service":
 			kind = tc.KubeClient.CoreV1().Services(meta.GetNamespace())
-			break
+		default:
+			return fmt.Errorf("not impl for kind: %s", gvk.Kind)
 		}
 	default:
 		return fmt.Errorf("not impl for kind: %s", gvk.Kind)
 	}
📝 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.

func (tc *E2ETestFramework) Delete(o runtime.Object) error {
	meta := runtime.Meta(o)
	gvk := runtime.GroupVersionKind(o)
	var kind kindInterface
	switch gvk.Group {
	case "":
		switch gvk.Kind {
		case "Service":
			kind = tc.KubeClient.CoreV1().Services(meta.GetNamespace())
		default:
			return fmt.Errorf("not impl for kind: %s", gvk.Kind)
		}
	default:
		return fmt.Errorf("not impl for kind: %s", gvk.Kind)
	}
	return kind.Delete(context.TODO(), meta.GetName(), metav1.DeleteOptions{})
}
🤖 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/framework/e2e/framework.go` around lines 106 - 120, Update
E2ETestFramework.Delete to return an unsupported-kind error when the core-group
switch does not assign kind, before invoking kind.Delete. Preserve the existing
Service handling and non-core error behavior, and ensure no method is called on
a nil kind.
test/framework/functional/outputs/syslog/sender.go (1)

30-30: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Report the missing syslog input accurately.

The current HTTP-specific message is misleading when this lookup fails.

Proposed fix
-	return fmt.Errorf("WriteToHttpInput: no HTTP input named %s", inputName)
+	return fmt.Errorf("WriteToSyslogInputWithNetcat: no syslog input named %q", inputName)
📝 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.

	return fmt.Errorf("WriteToSyslogInputWithNetcat: no syslog input named %q", inputName)
🤖 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/framework/functional/outputs/syslog/sender.go` at line 30, Update the
error returned by the input lookup in the relevant sender function to identify
the missing syslog input rather than an HTTP input, while preserving the
inputName value and existing error behavior.
test/helpers/syslog/syslog.go (1)

24-34: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Match the uppercased combined-RFC value.

strings.ToUpper converts this input to RFC3164 OR RFC5424, so the current case never matches and MustParseRFC terminates the test process.

Proposed fix
-	case "RFC3164 or RFC5424":
+	case "RFC3164 OR RFC5424":
📝 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.

func MustParseRFC(rfc string) SyslogRfc {
	switch strings.ToUpper(rfc) {
	case "RFC3164":
		return RFC3164
	case "RFC5424":
		return RFC5424
	case "RFC3164 OR RFC5424":
		return RFC3164RFC5424
	}
	log.Fatal("Unable to parse RFC", "rfc", rfc)
	return 0
}
🤖 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/helpers/syslog/syslog.go` around lines 24 - 34, Update the combined-RFC
case in MustParseRFC to match the uppercased input produced by strings.ToUpper,
while preserving the existing RFC3164 and RFC5424 mappings.

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

🧹 Nitpick comments (1)
hack/manifests/log-generator/base/log_generator_deployment.yaml (1)

16-17: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pin the load-client image to an immutable version.

Using latest with Always means each E2E run can execute different image contents, making failures and recovery behavior non-reproducible. Prefer a reviewed version tag or digest and update it intentionally.

🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml` around lines
16 - 17, Update the load-client image reference in the deployment manifest from
the mutable latest tag to a reviewed immutable version tag or digest, while
preserving the existing imagePullPolicy unless required by the chosen reference.
Ensure future image changes are made intentionally.
🤖 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 `@hack/manifests/log-generator/base/log_generator_deployment.yaml`:
- Around line 9-17: Add an explicit restricted securityContext to the
log-generator container, including allowPrivilegeEscalation false,
readOnlyRootFilesystem true, runAsNonRoot true, a RuntimeDefault seccompProfile,
and dropping all unnecessary capabilities. Verify the
cluster-logging-load-client image supports non-root execution before setting
runAsNonRoot.
- Around line 5-8: Add a spec.selector.matchLabels entry to the Deployment and
add the identical label key/value under spec.template.metadata.labels, reusing
the label expected by the corresponding Service so the selector matches the pod
labels.

In `@test/framework/e2e/framework.go`:
- Around line 285-292: Update RunCleanupScript to surface failures from
cmd.CombinedOutput at default verbosity: log the command error unconditionally,
or propagate it to Cleanup for handling. Keep diagnostic output logging at its
existing verbosity unless needed to support the chosen error path.

---

Nitpick comments:
In `@hack/manifests/log-generator/base/log_generator_deployment.yaml`:
- Around line 16-17: Update the load-client image reference in the deployment
manifest from the mutable latest tag to a reviewed immutable version tag or
digest, while preserving the existing imagePullPolicy unless required by the
chosen reference. Ensure future image changes are made intentionally.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a4c15531-e13a-452b-958d-1b6a947164ae

📥 Commits

Reviewing files that changed from the base of the PR and between f6aabd3 and 26ff868.

📒 Files selected for processing (21)
  • hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml
  • hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml
  • hack/manifests/log-generator/base/kustomization.yaml
  • hack/manifests/log-generator/base/log_generator_deployment.yaml
  • hack/manifests/log-generator/base/service.yaml
  • hack/manifests/log-generator/base/servicemonitor.yaml
  • hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml
  • hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml
  • internal/factory/deployment.go
  • test/e2e/logforwarding/syslog/recovery_test.go
  • test/e2e/logforwarding/syslog/syslog_suite_test.go
  • test/framework/e2e/framework.go
  • test/framework/e2e/syslog.go
  • test/framework/e2e/wait.go
  • test/framework/functional/output_syslog.go
  • test/framework/functional/outputs/syslog/sender.go
  • test/functional/inputs/syslog/syslog_input_test.go
  • test/helpers/syslog/syslog.go
  • test/helpers/syslog/syslog_conf.go
  • test/runtime/log_generator.go
  • test/runtime/observability/cluster_log_forwarder.go
🚧 Files skipped from review as they are similar to previous changes (17)
  • internal/factory/deployment.go
  • hack/manifests/clusterlogforwarder/base/clusterlogforwarder.yaml
  • hack/manifests/log-generator/overlays/by_payload_size/1024b_0001lps/kustomization.yaml
  • hack/manifests/clusterlogforwarder/overlays/syslog/udp/kustomization.yaml
  • test/framework/functional/outputs/syslog/sender.go
  • test/framework/e2e/wait.go
  • hack/manifests/log-generator/overlays/logtype/application/kustomization.yaml
  • test/e2e/logforwarding/syslog/syslog_suite_test.go
  • hack/manifests/log-generator/base/service.yaml
  • hack/manifests/log-generator/base/kustomization.yaml
  • test/e2e/logforwarding/syslog/recovery_test.go
  • test/framework/functional/output_syslog.go
  • test/helpers/syslog/syslog_conf.go
  • test/helpers/syslog/syslog.go
  • test/runtime/observability/cluster_log_forwarder.go
  • test/runtime/log_generator.go
  • test/framework/e2e/syslog.go

Comment thread hack/manifests/log-generator/base/log_generator_deployment.yaml
Comment thread hack/manifests/log-generator/base/log_generator_deployment.yaml
Comment thread test/framework/e2e/framework.go
@jcantrill

Copy link
Copy Markdown
Contributor Author

/test e2e-using-bundle

@jcantrill

Copy link
Copy Markdown
Contributor Author

/label tide/merge-method-squash

@openshift-ci openshift-ci Bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jul 17, 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: 2

🤖 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 `@hack/test-e2e-from-ci-bundle.sh`:
- Line 6: Quote the E2E package path in the launcher command by changing the
current_dir-based path to the quoted form "$current_dir/../test/e2e/...";
preserve the existing command and package pattern.
- Around line 5-6: Fix the shell continuation in the Ginkgo argument list by
ensuring the backslash after the poll-progress-after flag is the final character
on its line, so the two Ginkgo flags remain separate arguments and the test/e2e
path is continued correctly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2b017e7b-b185-4818-bab9-e069f5452aeb

📥 Commits

Reviewing files that changed from the base of the PR and between 90be379 and b0bbe1a.

📒 Files selected for processing (2)
  • Makefile
  • hack/test-e2e-from-ci-bundle.sh

Comment thread hack/test-e2e-from-ci-bundle.sh Outdated
Comment thread hack/test-e2e-from-ci-bundle.sh Outdated
Ref: LOG-9560

feat(manifests): add manifests for manual testing
@jcantrill

Copy link
Copy Markdown
Contributor Author

/retest

@jcantrill

Copy link
Copy Markdown
Contributor Author

/test functional-target

@jcantrill

Copy link
Copy Markdown
Contributor Author

/test e2e-using-bundle

@qodo-for-rh-openshift

qodo-for-rh-openshift Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR-Agent: could not find a component named functional-target in a supported language in this PR.

@qodo-for-rh-openshift

qodo-for-rh-openshift Bot commented Jul 23, 2026

Copy link
Copy Markdown

PR-Agent: could not find a component named e2e-using-bundle in a supported language in this PR.

@vparfonov

Copy link
Copy Markdown
Contributor

/test functional-target

@qodo-for-rh-openshift

qodo-for-rh-openshift Bot commented Jul 28, 2026

Copy link
Copy Markdown

PR-Agent: could not find a component named functional-target in a supported language in this PR.

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@jcantrill: 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/prow/e2e-using-bundle 86ee4e5 link false /test e2e-using-bundle
ci/prow/functional-target 86ee4e5 link true /test functional-target

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. release/6.7 tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants