Skip to content

OCPBUGS-62144: Makes sure rendering for egress IP reachabilityTimeout triggers restart of ovnkube (node/control) pods#2955

Open
raphaelvrosa wants to merge 3 commits intoopenshift:masterfrom
raphaelvrosa:ocpbugs-62144
Open

OCPBUGS-62144: Makes sure rendering for egress IP reachabilityTimeout triggers restart of ovnkube (node/control) pods#2955
raphaelvrosa wants to merge 3 commits intoopenshift:masterfrom
raphaelvrosa:ocpbugs-62144

Conversation

@raphaelvrosa
Copy link
Copy Markdown

@raphaelvrosa raphaelvrosa commented Apr 6, 2026

Issue: EgressIP ReachabilityTotalTimeoutSeconds is rendered by ovnkube-config (configmap), but ovnkube node and control pods are not restarted to have the new value applied in their settings.

Solution: Make sure the Hash inside the specs in ovnkube node and control pods take into account the changes in the ReachabilityTotalTimeoutSeconds setting. When this value is changed, it then triggers the restart of those pods, reloading the parameter in their configuration.

Adds test cases to evaluate the rendering and the hash changes in ovnkube node and control pod specs.
Updates README to document that reachabilityTimeoutSeconds is enabled for runtime updates.

Signed-off-by: Raphael Rosa <raprosa@redhat.com>
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@raphaelvrosa: This pull request references Jira Issue OCPBUGS-62144, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

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

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

Details

In response to this:

Implements rendering of EgressIP ReachabilityTotalTimeoutSeconds.
Adds test cases to evaluate rendering.
Updates README, enable runtime update of setting.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b01e0130-2dc1-4436-a281-4596511add25

📥 Commits

Reviewing files that changed from the base of the PR and between b8e3ae5 and 05db91a.

📒 Files selected for processing (1)
  • pkg/network/ovn_kubernetes_test.go

Walkthrough

Documents reachabilityTotalTimeoutSeconds as runtime-changeable and updates rendering to include its stringified value in OVN Kubernetes node and control-plane config-hash inputs; adds table-driven tests validating ConfigMap content and config-hash rollout behavior across timeout variations.

Changes

Cohort / File(s) Summary
Documentation
README.md
Add reachabilityTotalTimeoutSeconds to list of runtime-modifiable OVNKubernetes settings.
Config hashing and rendering
pkg/network/ovn_kubernetes.go
Compute string value for ReachabilityTotalTimeoutSeconds (handles *uint32/nil) and append reachabilityTimeout=<value> to SHA1 inputs used for OVNKubeNodeConfigHash and OVNKubeControlPlaneConfigHash.
Tests
pkg/network/ovn_kubernetes_test.go
Add TestRenderOVNKubernetesReachability: table-driven iterations over nil/zero/nonzero timeout values, assert ovnkube.conf includes or omits egressip-reachability-total-timeout appropriately, and verify pod-template config-hash annotations change only when expected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: inconsistent vendoring in :\n\tgithub.com/Masterminds/semver@v1.5.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/Masterminds/sprig/v3@v3.2.3: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/containernetworking/cni@v0.8.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/ghodss/yaml@v1.0.1-0.20190212211648-25d852aebe32: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/go-bindata/go-bindata@v3.1.2+incompatible: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/onsi/gomega@v1.39.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/ope

... [truncated 17356 characters] ...

ired in go.mod, but not marked as explicit in vendor/modules.txt\n\tk8s.io/gengo/v2@v2.0.0-20251215205346-5ee0d033ba5b: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tk8s.io/kms@v0.35.2: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tk8s.io/kube-aggregator@v0.35.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tsigs.k8s.io/randfill@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tsigs.k8s.io/structured-merge-diff/v6@v6.3.2: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\n\tTo ignore the vendor directory, use -mod=readonly or -mod=mod.\n\tTo sync the vendor directory, run:\n\t\tgo mod vendor\n"


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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 6, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/network/ovn_kubernetes_test.go (1)

3951-3979: Add a same-value rerender case to verify hash stability.

The table only checks nil -> 0 -> 10. Add a repeated value case (for example, 10 again with a new pointer) and assert hashes do not change, so this test catches non-deterministic hash inputs.

Suggested test case addition
 		{
 			name:                                "Reachability timeout changed to 10",
 			reachabilityTimeout:                 ptrToUint32(10),
 			expectHashChanged:                   true,
 			expectKubernetesFeatureReachability: true,
 			expectErr:                           false,
 		},
+		{
+			name:                                "Reachability timeout remains 10",
+			reachabilityTimeout:                 ptrToUint32(10),
+			expectHashChanged:                   false,
+			expectKubernetesFeatureReachability: true,
+			expectErr:                           false,
+		},
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/network/ovn_kubernetes_test.go` around lines 3951 - 3979, Add a new test
case in the testCases slice used in ovn_kubernetes_test.go that repeats the same
value for reachabilityTimeout (e.g., use ptrToUint32(10) again with a freshly
allocated pointer) and set expectHashChanged to false and
expectKubernetesFeatureReachability to true; this ensures the code path that
computes the hash (referenced by the testCases slice, reachabilityTimeout, and
expectHashChanged) verifies stability across a rerender with identical logical
values even when pointer instances differ.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/network/ovn_kubernetes.go`:
- Around line 507-509: The hash currently includes pointer addresses because
data.Data["ReachabilityTotalTimeoutSeconds"] is a *uint32; update the formatting
in the nodeNoOverlayHashData construction (and the similar hash at lines
~519–522) to dereference the pointer and use a stable scalar representation
(e.g., the uint32 value with %d or %v) instead of the pointer itself, and guard
with a nil-check to avoid panics when the pointer is nil; locate the
nodeNoOverlayHashData assembly and the other hash creation that reference
data.Data["ReachabilityTotalTimeoutSeconds"] and replace the pointer formatting
with the dereferenced value.

---

Nitpick comments:
In `@pkg/network/ovn_kubernetes_test.go`:
- Around line 3951-3979: Add a new test case in the testCases slice used in
ovn_kubernetes_test.go that repeats the same value for reachabilityTimeout
(e.g., use ptrToUint32(10) again with a freshly allocated pointer) and set
expectHashChanged to false and expectKubernetesFeatureReachability to true; this
ensures the code path that computes the hash (referenced by the testCases slice,
reachabilityTimeout, and expectHashChanged) verifies stability across a rerender
with identical logical values even when pointer instances differ.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a52ef0ea-c53e-4daf-b648-e9d0a4a9457a

📥 Commits

Reviewing files that changed from the base of the PR and between f3e41c5 and dcf2f9e.

📒 Files selected for processing (3)
  • README.md
  • pkg/network/ovn_kubernetes.go
  • pkg/network/ovn_kubernetes_test.go

Signed-off-by: Raphael Rosa <raprosa@redhat.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pkg/network/ovn_kubernetes_test.go (1)

4034-4037: Avoid forcing HostedControlPlane in a generic reachability/hash rollout test

Line 4034-Line 4037 forces the HyperShift path, which can under-cover the default self-hosted rendering path this PR targets. Prefer default infra here, or add explicit table coverage for both hosted and self-hosted modes.

Minimal scope fix
-			// Set is as Hypershift hosted control plane.
-			bootstrapResult.Infra = bootstrap.InfraStatus{}
-			bootstrapResult.Infra.HostedControlPlane = &hypershift.HostedControlPlane{}
+			// Keep default self-hosted path in this test.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/network/ovn_kubernetes_test.go` around lines 4034 - 4037, The test is
forcing the HyperShift path by setting bootstrapResult.Infra.HostedControlPlane,
which skips the default self-hosted rendering path; update the test so it leaves
bootstrapResult.Infra as the default (do not set HostedControlPlane) or convert
this case into table-driven tests that explicitly include both scenarios (one
case with bootstrapResult.Infra.HostedControlPlane set and one with it unset)
and assert renderOVNKubernetes outputs for each; locate the setup around
bootstrapResult.Infra and the call to renderOVNKubernetes to make this change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/network/ovn_kubernetes_test.go`:
- Around line 4059-4067: The test currently only checks for the presence of the
key in ovnkubeConf but should assert the exact rendered timeout value; update
the branch that runs when tc.expectKubernetesFeatureReachability is true to
assert that ovnkubeConf contains the full key=value pair (e.g.
"egressip-reachability-total-timeout=<expected>" ) using the expected value from
the test case (add or use a field on tc such as
tc.egressIPReachabilityTotalTimeout or tc.egressipReachabilityTotalTimeout) so
the test fails if the timeout is rendered incorrectly.

---

Nitpick comments:
In `@pkg/network/ovn_kubernetes_test.go`:
- Around line 4034-4037: The test is forcing the HyperShift path by setting
bootstrapResult.Infra.HostedControlPlane, which skips the default self-hosted
rendering path; update the test so it leaves bootstrapResult.Infra as the
default (do not set HostedControlPlane) or convert this case into table-driven
tests that explicitly include both scenarios (one case with
bootstrapResult.Infra.HostedControlPlane set and one with it unset) and assert
renderOVNKubernetes outputs for each; locate the setup around
bootstrapResult.Infra and the call to renderOVNKubernetes to make this change.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3a133127-6819-4195-9d53-9a25368cdfe5

📥 Commits

Reviewing files that changed from the base of the PR and between dcf2f9e and b8e3ae5.

📒 Files selected for processing (2)
  • pkg/network/ovn_kubernetes.go
  • pkg/network/ovn_kubernetes_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/network/ovn_kubernetes.go

Signed-off-by: Raphael Rosa <raprosa@redhat.com>
}
data.Data["OVNKubeConfigHash"] = hex.EncodeToString(h.Sum(nil))

var reachabilityTimeoutStr string
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Make sure hash is consistent when values do not change.

@raphaelvrosa
Copy link
Copy Markdown
Author

Fix in some CI tests depend on: https://github.com/openshift/origin/pull/30961/changes

@raphaelvrosa
Copy link
Copy Markdown
Author

raphaelvrosa commented Apr 8, 2026

@raphaelvrosa: This pull request references Jira Issue OCPBUGS-62144, which is invalid:

* expected the bug to target the "4.22.0" version, but no target version was set

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

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

In response to this:

Implements rendering of EgressIP ReachabilityTotalTimeoutSeconds.
Adds test cases to evaluate rendering.
Updates README, enable runtime update of setting.

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.

/jira refresh

@raphaelvrosa
Copy link
Copy Markdown
Author

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

@raphaelvrosa: 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/4.22-upgrade-from-stable-4.21-e2e-aws-ovn-upgrade 05db91a link false /test 4.22-upgrade-from-stable-4.21-e2e-aws-ovn-upgrade
ci/prow/e2e-aws-ovn-rhcos10-techpreview 05db91a link false /test e2e-aws-ovn-rhcos10-techpreview
ci/prow/4.22-upgrade-from-stable-4.21-e2e-azure-ovn-upgrade 05db91a link false /test 4.22-upgrade-from-stable-4.21-e2e-azure-ovn-upgrade
ci/prow/security 05db91a link false /test security

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.

@raphaelvrosa raphaelvrosa changed the title OCPBUGS-62144: Adds rendering for egress IP reachability timeout OCPBUGS-62144: Makes sure rendering for egress IP reachabilityTimeout triggers restart of ovnkube (node/control) pods Apr 9, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Apr 9, 2026
@openshift-ci-robot
Copy link
Copy Markdown
Contributor

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

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

Requesting review from QA contact:
/cc @huiran0826

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

Details

In response to this:

Issue: EgressIP ReachabilityTotalTimeoutSeconds is rendered by ovnkube-config (configmap), but ovnkube node and control pods are not restarted to have the new values applied in their settings.

Solution: Make sure the Hash inside the specs in ovnkube node and control pods take into account the changes in the ReachabilityTotalTimeoutSeconds setting. When this value is changed, it then triggers the restart of those pods, reloading the parameter in their configuration.

Adds test cases to evaluate the rendering and the hash changes in ovnkube node and control pod specs.
Updates README to document that reachabilityTimeoutSeconds is enabled for runtime updates.

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
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: huiran0826.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

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

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

Requesting review from QA contact:
/cc @huiran0826

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

In response to this:

Issue: EgressIP ReachabilityTotalTimeoutSeconds is rendered by ovnkube-config (configmap), but ovnkube node and control pods are not restarted to have the new values applied in their settings.

Solution: Make sure the Hash inside the specs in ovnkube node and control pods take into account the changes in the ReachabilityTotalTimeoutSeconds setting. When this value is changed, it then triggers the restart of those pods, reloading the parameter in their configuration.

Adds test cases to evaluate the rendering and the hash changes in ovnkube node and control pod specs.
Updates README to document that reachabilityTimeoutSeconds is enabled for runtime updates.

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.

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.

@openshift-ci-robot
Copy link
Copy Markdown
Contributor

@raphaelvrosa: This pull request references Jira Issue OCPBUGS-62144, which is valid.

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

Requesting review from QA contact:
/cc @huiran0826

Details

In response to this:

Issue: EgressIP ReachabilityTotalTimeoutSeconds is rendered by ovnkube-config (configmap), but ovnkube node and control pods are not restarted to have the new value applied in their settings.

Solution: Make sure the Hash inside the specs in ovnkube node and control pods take into account the changes in the ReachabilityTotalTimeoutSeconds setting. When this value is changed, it then triggers the restart of those pods, reloading the parameter in their configuration.

Adds test cases to evaluate the rendering and the hash changes in ovnkube node and control pod specs.
Updates README to document that reachabilityTimeoutSeconds is enabled for runtime updates.

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
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: huiran0826.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

@raphaelvrosa: This pull request references Jira Issue OCPBUGS-62144, which is valid.

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

Requesting review from QA contact:
/cc @huiran0826

In response to this:

Issue: EgressIP ReachabilityTotalTimeoutSeconds is rendered by ovnkube-config (configmap), but ovnkube node and control pods are not restarted to have the new value applied in their settings.

Solution: Make sure the Hash inside the specs in ovnkube node and control pods take into account the changes in the ReachabilityTotalTimeoutSeconds setting. When this value is changed, it then triggers the restart of those pods, reloading the parameter in their configuration.

Adds test cases to evaluate the rendering and the hash changes in ovnkube node and control pod specs.
Updates README to document that reachabilityTimeoutSeconds is enabled for runtime updates.

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.

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.

@raphaelvrosa
Copy link
Copy Markdown
Author

/retest-required

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants