Skip to content

[release-4.22] OCPBUGS-92656: fix-forward dualstack backport with klog stderr redirect for 4.22 OTE#482

Closed
redhat-chai-bot wants to merge 1 commit into
openshift:release-4.22from
redhat-chai-bot:OCPBUGS-92656-fix-dualstack-4.22
Closed

[release-4.22] OCPBUGS-92656: fix-forward dualstack backport with klog stderr redirect for 4.22 OTE#482
redhat-chai-bot wants to merge 1 commit into
openshift:release-4.22from
redhat-chai-bot:OCPBUGS-92656-fix-dualstack-4.22

Conversation

@redhat-chai-bot

Copy link
Copy Markdown

Re-lands the dualstack test support from PR #480 (reverted by PR #481) with fixes for the klog stdout contamination that broke metal platform nightlies.

What changed

1. Dualstack changes (from PR #480)

  • e2e/helper.goGetCloudConfig(), isConfigPresentCloudConfig(), IsDualStack() helpers for dualstack detection via cloud-config ConfigMap
  • e2e/loadbalancer.goIPFamilyPolicy: RequireDualStack in createServiceNLB() for dualstack clusters
  • main.go — dualstack IPv6-primary detection and conditional upstream test skip logic

2. Klog stderr redirect fix (NEW)

  • Added redirectStdoutToStderr() in main.go that uses syscall.Dup/Dup2 to redirect file descriptor 1 (stdout) to stderr at the OS level
  • This catches ALL writes to fd 1, including Ginkgo's GinkgoWriter (which captures os.Stdout in its init() before main() runs) and klog
  • The real stdout is preserved via Dup and assigned to os.Stdout so OTE's explicit fmt.Fprintf(os.Stdout, ...) JSON output still reaches the actual stdout
  • Added klog.SetOutput(os.Stderr) as belt-and-suspenders

3. Updated openshift-tests-extension dependency

Why PR #480 broke nightlies

The GetCloudConfig() call invokes framework.LoadConfig() which initializes klog. On 4.22, klog writes INFO-level lines to stdout. When openshift-tests runs the OTE binary's list subcommand on metal platforms, it expects pure JSON on stdout but gets klog noise, causing invalid character 'I' looking for beginning of value errors.

This worked on 5.0 because OTE PR #74 makes openshift-tests-extension scan for the first { or [ line before unmarshalling. The 4.22 branch used an older version without this fix.

Testing

Payload jobs to validate:

  • Dualstack IPv6-primary (periodic-ci-...-dualstack-ipv6-primary-techpreview)
  • Dualstack IPv4-primary (periodic-ci-...-dualstack-ipv4-primary-techpreview)
  • Metal IPv4 (periodic-ci-...-metal-ipi-ovn-ipv4) — previously failing
  • Metal IPv6 (periodic-ci-...-metal-ipi-ovn-ipv6) — previously failing

/cc @mtulio

…direct for 4.22 OTE

The original dualstack backport (PR openshift#480) broke metal platform nightlies
because Ginkgo's GinkgoWriter (and klog via the ginkgo text-logger) writes
INFO lines to fd 1 (stdout), corrupting the JSON output that
openshift-tests-extension expects during the "list" subcommand.

Fix by redirecting file descriptor 1 to stderr at the start of main(),
before any framework/klog/ginkgo initialization runs. Because Ginkgo's
init() captures os.Stdout (which wraps fd 1) before main() executes,
simply reassigning os.Stdout is not enough — we must redirect at the fd
level using syscall.Dup/Dup2. The real stdout is preserved via Dup and
assigned back to os.Stdout so that OTE's explicit os.Stdout writes (JSON
list/info output) still reach the original stdout.

Additionally:
- klog.SetOutput(os.Stderr) as belt-and-suspenders
- Updated openshift-tests-extension dependency to latest

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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 Jun 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-92656, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is MODIFIED 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:

Re-lands the dualstack test support from PR #480 (reverted by PR #481) with fixes for the klog stdout contamination that broke metal platform nightlies.

What changed

1. Dualstack changes (from PR #480)

  • e2e/helper.goGetCloudConfig(), isConfigPresentCloudConfig(), IsDualStack() helpers for dualstack detection via cloud-config ConfigMap
  • e2e/loadbalancer.goIPFamilyPolicy: RequireDualStack in createServiceNLB() for dualstack clusters
  • main.go — dualstack IPv6-primary detection and conditional upstream test skip logic

2. Klog stderr redirect fix (NEW)

  • Added redirectStdoutToStderr() in main.go that uses syscall.Dup/Dup2 to redirect file descriptor 1 (stdout) to stderr at the OS level
  • This catches ALL writes to fd 1, including Ginkgo's GinkgoWriter (which captures os.Stdout in its init() before main() runs) and klog
  • The real stdout is preserved via Dup and assigned to os.Stdout so OTE's explicit fmt.Fprintf(os.Stdout, ...) JSON output still reaches the actual stdout
  • Added klog.SetOutput(os.Stderr) as belt-and-suspenders

3. Updated openshift-tests-extension dependency

Why PR #480 broke nightlies

The GetCloudConfig() call invokes framework.LoadConfig() which initializes klog. On 4.22, klog writes INFO-level lines to stdout. When openshift-tests runs the OTE binary's list subcommand on metal platforms, it expects pure JSON on stdout but gets klog noise, causing invalid character 'I' looking for beginning of value errors.

This worked on 5.0 because OTE PR #74 makes openshift-tests-extension scan for the first { or [ line before unmarshalling. The 4.22 branch used an older version without this fix.

Testing

Payload jobs to validate:

  • Dualstack IPv6-primary (periodic-ci-...-dualstack-ipv6-primary-techpreview)
  • Dualstack IPv4-primary (periodic-ci-...-dualstack-ipv4-primary-techpreview)
  • Metal IPv4 (periodic-ci-...-metal-ipi-ovn-ipv4) — previously failing
  • Metal IPv6 (periodic-ci-...-metal-ipi-ovn-ipv6) — previously failing

/cc @mtulio

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 added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jun 29, 2026
@openshift-ci openshift-ci Bot requested a review from mtulio June 29, 2026 14:00
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1f7758ae-7c2d-4b11-b18e-03055410b329

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@redhat-chai-bot

Copy link
Copy Markdown
Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-installer-dualstack-ipv4-primary-techpreview

@redhat-chai-bot

Copy link
Copy Markdown
Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-installer-dualstack-ipv6-primary-techpreview

@redhat-chai-bot

Copy link
Copy Markdown
Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv4

@redhat-chai-bot

Copy link
Copy Markdown
Author

/payload-job periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv6

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-installer-dualstack-ipv6-primary-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ebbe8f60-73c2-11f1-9127-c81654de85d8-0

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv6

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ebed1970-73c2-11f1-9e48-d9c91d27c68c-0

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-aws-ovn-installer-dualstack-ipv4-primary-techpreview

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/eb6a7bf0-73c2-11f1-802a-47efe717d618-0

@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@redhat-chai-bot: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv4

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/eb8508d0-73c2-11f1-8e71-39332e354215-0

@mtulio

mtulio commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

/retitle [release-4.22] OCPBUGS-92656: fix-forward dualstack backport with klog stderr redirect for 4.22 OTE

@openshift-ci openshift-ci Bot changed the title Bug OCPBUGS-92656: fix-forward dualstack backport with klog stderr redirect for 4.22 OTE [release-4.22] OCPBUGS-92656: fix-forward dualstack backport with klog stderr redirect for 4.22 OTE Jun 29, 2026
@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@mtulio

mtulio commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Looks like the problem is in openshift-tests. Trying it in openshift/origin#31349 .
/hold

@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 Jun 29, 2026
@openshift-ci

openshift-ci Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@mtulio: This PR was included in a payload test run from openshift/origin#31349
trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-main-nightly-4.22-e2e-metal-ipi-ovn-ipv4

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/e18cf420-73fc-11f1-9177-1dfff53c3a1a-0

@stbenjam stbenjam closed this Jun 30, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@redhat-chai-bot: This pull request references Jira Issue OCPBUGS-92656. The bug has been updated to no longer refer to the pull request using the external bug tracker.

Details

In response to this:

Re-lands the dualstack test support from PR #480 (reverted by PR #481) with fixes for the klog stdout contamination that broke metal platform nightlies.

What changed

1. Dualstack changes (from PR #480)

  • e2e/helper.goGetCloudConfig(), isConfigPresentCloudConfig(), IsDualStack() helpers for dualstack detection via cloud-config ConfigMap
  • e2e/loadbalancer.goIPFamilyPolicy: RequireDualStack in createServiceNLB() for dualstack clusters
  • main.go — dualstack IPv6-primary detection and conditional upstream test skip logic

2. Klog stderr redirect fix (NEW)

  • Added redirectStdoutToStderr() in main.go that uses syscall.Dup/Dup2 to redirect file descriptor 1 (stdout) to stderr at the OS level
  • This catches ALL writes to fd 1, including Ginkgo's GinkgoWriter (which captures os.Stdout in its init() before main() runs) and klog
  • The real stdout is preserved via Dup and assigned to os.Stdout so OTE's explicit fmt.Fprintf(os.Stdout, ...) JSON output still reaches the actual stdout
  • Added klog.SetOutput(os.Stderr) as belt-and-suspenders

3. Updated openshift-tests-extension dependency

Why PR #480 broke nightlies

The GetCloudConfig() call invokes framework.LoadConfig() which initializes klog. On 4.22, klog writes INFO-level lines to stdout. When openshift-tests runs the OTE binary's list subcommand on metal platforms, it expects pure JSON on stdout but gets klog noise, causing invalid character 'I' looking for beginning of value errors.

This worked on 5.0 because OTE PR #74 makes openshift-tests-extension scan for the first { or [ line before unmarshalling. The 4.22 branch used an older version without this fix.

Testing

Payload jobs to validate:

  • Dualstack IPv6-primary (periodic-ci-...-dualstack-ipv6-primary-techpreview)
  • Dualstack IPv4-primary (periodic-ci-...-dualstack-ipv4-primary-techpreview)
  • Metal IPv4 (periodic-ci-...-metal-ipi-ovn-ipv4) — previously failing
  • Metal IPv6 (periodic-ci-...-metal-ipi-ovn-ipv6) — previously failing

/cc @mtulio

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.

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. jira/invalid-bug Indicates that a referenced Jira bug is invalid 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.

4 participants