kubeslice-controller
kubeslice-controller copied to clipboard
feat(sliceconfig): add machine-observable status conditions
Summary
- Adds
Conditions []metav1.ConditiontoSliceConfigStatuswith+listType=map/+listMapKey=typemarkers for correct strategic-merge-patch behaviour. ReconcileSliceConfigsets four conditions after key provisioning steps and calls a singleutil.UpdateStatuson successful completion.- Adds
+kubebuilder:printcolumnforREADYsokubectl get sliceconfigshows readiness inline. kubesliceEventsbehaviour is unchanged; this change is fully backward compatible.
Motivation
SliceConfigStatus previously exposed only kubesliceEvents[], an append-style audit log with no machine-queryable readiness semantics. A fully provisioned slice and one stalled at step 3 were externally indistinguishable. This blocked kubectl wait --for=condition=Ready, FluxCD/ArgoCD health checks, and Helm --wait on slice provisioning.
Conditions added
| Condition | Set after |
|---|---|
WorkerConfigsProvisioned |
Step 4 — all WorkerSliceConfig objects created |
GatewaysProvisioned |
Step 5 — all WorkerSliceGateway pairs created |
VPNConfigured |
Step 7 — VpnKeyRotation CR created |
Ready |
All three above are True |
For no-network slices, only WorkerConfigsProvisioned and Ready are set (gateways and VPN are not applicable).
Test plan
SliceConfig_ConditionsSetOnSuccessfulReconcile— all four conditions areTrueafter a complete network-slice reconcileSliceConfig_ConditionsSetOnNoNetSuccessfulReconcile— onlyWorkerConfigsProvisionedandReadyare set for NoNet slicesSliceConfig_ReadyConditionFalseWhenGatewayFails—Status()is never called when gateway creation returns an error- All 21 existing
SliceConfigTestBedcases updated / continue to pass
Migration notes
conditions is omitempty; existing objects without the field remain valid. No CRD migration needed. After merging, run make manifests && make install to apply the updated CRD.
Fixes #368