Add status conditions and observedGeneration#4535
Conversation
|
Just noticed that some files are not marked as “generated” in gitattribute. Let me create another PR to fix this |
|
2478def to
5b57f1f
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the controller-managed CRD statuses to follow Kubernetes conventions by adding status.observedGeneration and a standard Ready condition for the actions.github.com API resources, enabling clients to reliably detect spec/status convergence and use kubectl wait --for=condition=Ready.
Changes:
- Add and stamp
status.observedGenerationon status updates across the relevant controllers. - Introduce a shared
setReadyConditionhelper and wireReadycondition updates into reconciliation/status transitions. - Regenerate CRDs (config + Helm chart CRD bundles) and update deep-copy generation for new status fields.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| controllers/actions.github.com/ephemeralrunnerset_controller.go | Stamp ObservedGeneration, set Ready condition, and patch status only when it changes. |
| controllers/actions.github.com/ephemeralrunnerset_controller_test.go | Extend tests to validate ObservedGeneration and Ready condition behavior. |
| controllers/actions.github.com/ephemeralrunner_controller.go | Add ObservedGeneration stamping and Ready condition updates for runner lifecycle transitions. |
| controllers/actions.github.com/conditions.go | Add shared helper to set/truncate Ready status condition. |
| controllers/actions.github.com/autoscalingrunnerset_controller.go | Centralize status updates, add ObservedGeneration and Ready condition management. |
| controllers/actions.github.com/autoscalingrunnerset_controller_test.go | Add assertions for ObservedGeneration/Ready on AutoscalingRunnerSet status. |
| controllers/actions.github.com/autoscalinglistener_controller.go | Add listener ObservedGeneration and Ready condition updates based on pod state. |
| config/crd/bases/actions.github.com_ephemeralrunnersets.yaml | CRD schema updates for conditions and observedGeneration in EphemeralRunnerSet status. |
| config/crd/bases/actions.github.com_ephemeralrunners.yaml | CRD schema updates for conditions and observedGeneration in EphemeralRunner status. |
| config/crd/bases/actions.github.com_autoscalingrunnersets.yaml | CRD schema updates for conditions and observedGeneration in AutoscalingRunnerSet status. |
| config/crd/bases/actions.github.com_autoscalinglisteners.yaml | CRD schema updates for conditions and observedGeneration in AutoscalingListener status. |
| charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunnersets.yaml | Helm-bundled CRD regeneration for EphemeralRunnerSet status fields. |
| charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunners.yaml | Helm-bundled CRD regeneration for EphemeralRunner status fields. |
| charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalingrunnersets.yaml | Helm-bundled CRD regeneration for AutoscalingRunnerSet status fields. |
| charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalinglisteners.yaml | Helm-bundled CRD regeneration for AutoscalingListener status fields. |
| charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_ephemeralrunnersets.yaml | Experimental Helm-bundled CRD regeneration for EphemeralRunnerSet status fields. |
| charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_ephemeralrunners.yaml | Experimental Helm-bundled CRD regeneration for EphemeralRunner status fields. |
| charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_autoscalingrunnersets.yaml | Experimental Helm-bundled CRD regeneration for AutoscalingRunnerSet status fields. |
| charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_autoscalinglisteners.yaml | Experimental Helm-bundled CRD regeneration for AutoscalingListener status fields. |
| apis/actions.github.com/v1alpha1/zz_generated.deepcopy.go | Regenerate deep-copy logic to correctly copy new Conditions slices in status. |
| apis/actions.github.com/v1alpha1/ephemeralrunnerset_types.go | Add ObservedGeneration and Conditions to EphemeralRunnerSetStatus. |
| apis/actions.github.com/v1alpha1/ephemeralrunner_types.go | Add ObservedGeneration and Conditions to EphemeralRunnerStatus. |
| apis/actions.github.com/v1alpha1/common.go | Add shared ConditionTypeReady constant. |
| apis/actions.github.com/v1alpha1/autoscalingrunnerset_types.go | Add ObservedGeneration and Conditions to AutoscalingRunnerSetStatus. |
| apis/actions.github.com/v1alpha1/autoscalinglistener_types.go | Add ObservedGeneration and Conditions to AutoscalingListenerStatus. |
Files not reviewed (1)
- apis/actions.github.com/v1alpha1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5b57f1f to
9e6f4a1
Compare
What
status.observedGenerationand a standard "Ready" condition toAutoscalingRunnerSet,EphemeralRunnerSet,EphemeralRunner, andAutoscalingListener.observedGenerationmake manifests)Why
The resources expose only a free-form "phase" string, so clients cannot tell whether the status reflects the latest spec or wait for readiness in a standard way. With this change,
k wait --for=condition=Readyandgeneration == status.observedGenerationchecks work, per the k8s API conventions for status.