kubeslice-controller icon indicating copy to clipboard operation
kubeslice-controller copied to clipboard

feat(sliceconfig): add machine-observable status conditions

Open Karman580 opened this issue 6 months ago • 0 comments

Summary

  • Adds Conditions []metav1.Condition to SliceConfigStatus with +listType=map / +listMapKey=type markers for correct strategic-merge-patch behaviour.
  • ReconcileSliceConfig sets four conditions after key provisioning steps and calls a single util.UpdateStatus on successful completion.
  • Adds +kubebuilder:printcolumn for READY so kubectl get sliceconfig shows readiness inline.
  • kubesliceEvents behaviour 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 are True after a complete network-slice reconcile
  • SliceConfig_ConditionsSetOnNoNetSuccessfulReconcile — only WorkerConfigsProvisioned and Ready are set for NoNet slices
  • SliceConfig_ReadyConditionFalseWhenGatewayFails — Status() is never called when gateway creation returns an error
  • All 21 existing SliceConfigTestBed cases 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

Karman580 avatar May 15 '26 08:05 Karman580