Skip to content

Pause child resources while Device phase is not Running#362

Merged
felix-kaestner merged 1 commit into
mainfrom
fix/paused
May 18, 2026
Merged

Pause child resources while Device phase is not Running#362
felix-kaestner merged 1 commit into
mainfrom
fix/paused

Conversation

@felix-kaestner
Copy link
Copy Markdown
Contributor

Previously, computeCondition only paused child resources when the Device phase was a non-empty value other than Running. A freshly created Device starts with an empty phase before the DeviceReconciler sets it to Pending/Running. During this window, children were not paused and could attempt reconciliation against a device that is not yet ready.

Remove the empty-phase exclusion in computeCondition so that any phase other than Running (including empty) pauses child resources.

Align DevicePausedChanged with this semantic: previously it also excluded the empty phase from its change detection, meaning the transition from "" to "Running" was invisible to the watch predicate and children were never re-triggered to unpause. Rewrite the predicate using positive-form comparisons (==) for clarity.

Add a DeviceReconciler to the cisco/nx controller test suite so that test Devices automatically transition to Running when no provisioning is configured, matching production behavior.

@felix-kaestner felix-kaestner requested a review from a team as a code owner May 18, 2026 08:49
@felix-kaestner felix-kaestner enabled auto-merge (rebase) May 18, 2026 08:51
Previously, computeCondition only paused child resources when the
Device phase was a non-empty value other than Running. A freshly
created Device starts with an empty phase before the DeviceReconciler
sets it to Pending/Running. During this window, children were not
paused and could attempt reconciliation against a device that is not
yet ready.

Remove the empty-phase exclusion in computeCondition so that any
phase other than Running (including empty) pauses child resources.

Align DevicePausedChanged with this semantic: previously it also
excluded the empty phase from its change detection, meaning the
transition from "" to "Running" was invisible to the watch
predicate and children were never re-triggered to unpause. Rewrite
the predicate using positive-form comparisons (==) for clarity.

Add a DeviceReconciler to the cisco/nx controller test suite so
that test Devices automatically transition to Running when no
provisioning is configured, matching production behavior.

Signed-off-by: Felix Kästner <felix.kaestner@sap.com>
Copy link
Copy Markdown

@SchwarzM SchwarzM left a comment

Choose a reason for hiding this comment

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

lgtm

@felix-kaestner felix-kaestner merged commit d7451b1 into main May 18, 2026
19 checks passed
@felix-kaestner felix-kaestner deleted the fix/paused branch May 18, 2026 08:57
@github-actions
Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/internal/controller/cisco/nx 64.87% (+0.72%) 👍
github.com/ironcore-dev/network-operator/internal/paused 100.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/internal/paused/paused.go 100.00% (ø) 53 53 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/ironcore-dev/network-operator/internal/controller/cisco/nx/suite_test.go

@hardikdr hardikdr added the area/switch-automation Automation processes for network switch management and operations. label May 19, 2026
@hardikdr hardikdr added this to Roadmap May 19, 2026
@github-project-automation github-project-automation Bot moved this to Done in Roadmap May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/switch-automation Automation processes for network switch management and operations. size/M

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants