Skip to content

feat: Add skip-provisioning maintenance annotation for Device controller - #482

Open
nikatza wants to merge 1 commit into
mainfrom
bypass-provisioning-v2
Open

feat: Add skip-provisioning maintenance annotation for Device controller#482
nikatza wants to merge 1 commit into
mainfrom
bypass-provisioning-v2

Conversation

@nikatza

@nikatza nikatza commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions github-actions Bot added the size/L label Aug 5, 2026
@nikatza
nikatza force-pushed the bypass-provisioning-v2 branch 3 times, most recently from 06db757 to 550c5a6 Compare August 6, 2026 09:21
The Device controller now supports a skip-provisioning value for the
maintenance annotation. This allows devices that have been provisioned
out-of-band to bypass the Provisioning phase while keeping the
provisioning config in the spec for future reprovisioning.

The controller handles the annotation in two phases. When a device is in
Pending phase with spec.provisioning configured, the annotation causes a
direct transition to Running without entering Provisioning. When a
device is already in Provisioning phase, the annotation closes any
active provisioning entry by setting its EndTime and transitions the
device to Running. In both cases the annotation is consumed after
processing and the controller emits a SkipProvisioning event. The
reconcileMaintenance function was updated to preserve the annotation
until it is consumed by the phase handlers.

Updated the test infrastructure to support event verification. Drain and
collect events from FakeRecorder into a a slice that tests can use.

Signed-off-by: Pujol <enric.pujol@sap.com>
@nikatza
nikatza force-pushed the bypass-provisioning-v2 branch from 550c5a6 to ec3c959 Compare August 6, 2026 09:40
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1 1.72% (ø)
github.com/ironcore-dev/network-operator/internal/controller/core 61.83% (+0.15%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/ironcore-dev/network-operator/api/core/v1alpha1/groupversion_info.go 0.00% (ø) 2 0 2
github.com/ironcore-dev/network-operator/internal/controller/core/device_controller.go 66.55% (+2.77%) 278 (+13) 185 (+16) 93 (-3) 👍

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/core/device_controller_test.go
  • github.com/ironcore-dev/network-operator/internal/controller/core/suite_test.go

@nikatza
nikatza marked this pull request as ready for review August 6, 2026 11:42
@adamtrizuljak-sap
adamtrizuljak-sap self-requested a review August 7, 2026 14:28
testEvents = nil

DeferCleanup(func() {
Expect(client.IgnoreNotFound(k8sClient.Delete(ctx, secret))).To(Succeed())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why IgnoreNotFound? The secret should still exist

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants