Keep the outdated phase until the runner spec itself changes (#4660)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Nikola Jokic
2026-09-17 17:03:21 +02:00
committed by GitHub
co-authored by Copilot App Copilot Autofix powered by AI
parent be44bb58cf
commit dc12c2d417
17 changed files with 1776 additions and 135 deletions
@@ -21,8 +21,39 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// AutoscalingListenerPhase describes whether the listener should be running.
//
// It is part of the spec rather than the status because it is a desired state
// written by the AutoscalingRunnerSet controller, not an observation made by the
// AutoscalingListener controller about itself.
type AutoscalingListenerPhase string
const (
// AutoscalingListenerPhaseRunning is the default. The listener controller
// creates and maintains the listener pod and everything it depends on.
AutoscalingListenerPhaseRunning AutoscalingListenerPhase = "Running"
// AutoscalingListenerPhaseStopped switches the listener off without
// deleting it. The listener controller tears the pod and the rest of the
// child resources down, so no further jobs are acquired, but the
// AutoscalingListener object stays as the record of a scale set that is
// meant to come back. Moving the phase to Running is what starts it again.
AutoscalingListenerPhaseStopped AutoscalingListenerPhase = "Stopped"
)
// Stopped reports whether the phase switches the listener off. The zero value
// means Running, so listeners written before this field existed keep working.
func (p AutoscalingListenerPhase) Stopped() bool {
return p == AutoscalingListenerPhaseStopped
}
// AutoscalingListenerSpec defines the desired state of AutoscalingListener
type AutoscalingListenerSpec struct {
// Phase controls whether the listener runs. Empty means Running.
// +kubebuilder:validation:Enum=Running;Stopped
// +optional
Phase AutoscalingListenerPhase `json:"phase,omitempty"`
// +optional
GitHubConfigURL string `json:"githubConfigUrl,omitempty"`
@@ -94,6 +125,7 @@ type AutoscalingListenerStatus struct{}
// +kubebuilder:printcolumn:JSONPath=".spec.githubConfigUrl",name=GitHub Configure URL,type=string
// +kubebuilder:printcolumn:JSONPath=".spec.autoscalingRunnerSetNamespace",name=AutoscalingRunnerSet Namespace,type=string
// +kubebuilder:printcolumn:JSONPath=".spec.autoscalingRunnerSetName",name=AutoscalingRunnerSet Name,type=string
// +kubebuilder:printcolumn:JSONPath=".spec.phase",name=Phase,type=string
// AutoscalingListener is the Schema for the autoscalinglisteners API
type AutoscalingListener struct {