Skip to content

WIP: feat: allow deploying sno - #394

Open
eggfoobar wants to merge 1 commit into
openshift:mainfrom
eggfoobar:mutable-topology-sno
Open

WIP: feat: allow deploying sno#394
eggfoobar wants to merge 1 commit into
openshift:mainfrom
eggfoobar:mutable-topology-sno

Conversation

@eggfoobar

@eggfoobar eggfoobar commented Jun 9, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved configuration change detection for keepalived load balancing to better account for different control plane topologies, ensuring more accurate identification of when configuration updates need to be applied in unicast mode deployments.

Signed-off-by: ehila <ehila@redhat.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 9, 2026
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Walkthrough

The PR adds topology awareness to keepalived configuration validation. The doesConfigChanged function now accepts a controlPlaneTopology parameter and adjusts its unicast-mode validation logic to skip backend count requirements when the topology is SingleReplica. The caller in KeepalivedWatch is updated to pass the topology value.

Changes

Keepalived topology validation

Layer / File(s) Summary
Config change detection with topology awareness
pkg/monitor/dynkeepalived.go
doesConfigChanged accepts controlPlaneTopology and only flags invalid unicast configuration when IS_BOOTSTRAP=no, backend count is less than 2, and topology is not SingleReplica. KeepalivedWatch passes the topology parameter to this function.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is partially related to the changeset. It mentions SNO (Single Node OpenShift) deployment capability, and the code changes reference 'SingleReplica' topology, which aligns with SNO concepts. However, the title is vague and doesn't clearly convey the specific technical changes to keepalived configuration detection logic. Improve title clarity by specifying the core change, e.g., 'Support SingleReplica topology in keepalived configuration change detection' or 'Add controlPlaneTopology parameter to config validation logic'.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 All Ginkgo test names in changed files are static and deterministic with no dynamic content patterns like fmt.Sprintf, timestamps, UUIDs, or generated identifiers.
Test Structure And Quality ✅ Passed PR modifies pkg/monitor/dynkeepalived.go but adds no test files. Since the check requires reviewing Ginkgo test code and there are no tests to review, the check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The change only modifies pkg/monitor/dynkeepalived.go (production code), not test files. The check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This repo contains unit tests with fake/mock clients, not e2e tests. The custom check applies to e2e tests that run against actual clusters, which is not applicable here.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies baremetal keepalived configuration code, not deployment manifests or operator controllers. Changes add topology-awareness by checking controlPlaneTopology value; check does not apply.
Ote Binary Stdout Contract ✅ Passed PR modifies only library functions (doesConfigChanged, KeepalivedWatch) with no stdout writes. All logging uses logrus (stderr by default). No process-level stdout violations detected.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added in this PR. Changes are to production code (pkg/monitor/dynkeepalived.go) which is a configuration monitoring utility, not a test file.
No-Weak-Crypto ✅ Passed No weak cryptography usage detected. Changes only modify configuration validation logic using standard Go string comparisons and the google/go-cmp library for configuration equality checks.
Container-Privileges ✅ Passed PR modifies only Go source code with no container/Kubernetes manifest changes. No privileged settings, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or privilege escalation configurations found.
No-Sensitive-Data-In-Logs ✅ Passed PR introduces no new sensitive data logging. Changes are logic-only: adding controlPlaneTopology parameter and conditional guard. Pre-existing logging of internal infrastructure data was not modified.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

@openshift-ci
openshift-ci Bot requested review from cybertron and mkowalski June 9, 2026 16:44
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

🧹 Nitpick comments (1)
pkg/monitor/dynkeepalived.go (1)

106-106: Use SingleReplicaTopologyMode constant instead of hard-coding "SingleReplica"

In pkg/monitor/dynkeepalived.go (doesConfigChanged), the unicast backend-count validation currently checks controlPlaneTopology != "SingleReplica". Switch to the OpenShift API constant (configv1.SingleReplicaTopologyMode) to avoid drift/typos.

Suggested patch
 import (
 	"context"
 	"fmt"
 	"net"
 	"net/http"
 	"os"
 	"os/signal"
 	"strings"
 	"syscall"
 	"time"
 
 	"github.com/google/go-cmp/cmp"
+	configv1 "github.com/openshift/api/config/v1"
 	"github.com/sirupsen/logrus"
 	"gopkg.in/yaml.v2"
@@
-			if controlPlaneTopology != "SingleReplica" {
+			if controlPlaneTopology != string(configv1.SingleReplicaTopologyMode) {
 				log.Warnf("Invalid keepalived.conf - number of backends must be at least 2 got %d", len(curConfig.LBConfig.Backends))
 				validConfig = false
 			}
🤖 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 `@pkg/monitor/dynkeepalived.go` at line 106, In doesConfigChanged replace the
hard-coded string comparison controlPlaneTopology != "SingleReplica" with the
OpenShift constant configv1.SingleReplicaTopologyMode: import the configv1
package (k8s.io/.../config/v1) if not already imported, and change the condition
to controlPlaneTopology != configv1.SingleReplicaTopologyMode so the unicast
backend-count validation uses the official constant.
🤖 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.

Nitpick comments:
In `@pkg/monitor/dynkeepalived.go`:
- Line 106: In doesConfigChanged replace the hard-coded string comparison
controlPlaneTopology != "SingleReplica" with the OpenShift constant
configv1.SingleReplicaTopologyMode: import the configv1 package
(k8s.io/.../config/v1) if not already imported, and change the condition to
controlPlaneTopology != configv1.SingleReplicaTopologyMode so the unicast
backend-count validation uses the official constant.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 0a64976c-99b6-4a4a-9a5c-f56b314d8145

📥 Commits

Reviewing files that changed from the base of the PR and between cf62f8c and 8b953c1.

📒 Files selected for processing (1)
  • pkg/monitor/dynkeepalived.go

@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@eggfoobar: The following test 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/security 8b953c1 link true /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.

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

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant