mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-03 08:54:40 +02:00
Fix ephemeral runner set status update
This commit is contained in:
@@ -315,6 +315,7 @@ type HistogramMetric struct {
|
||||
// AutoscalingRunnerSetStatus defines the observed state of AutoscalingRunnerSet
|
||||
type AutoscalingRunnerSetStatus struct {
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
CurrentRunners int `json:"currentRunners"`
|
||||
|
||||
// +optional
|
||||
|
||||
@@ -38,12 +38,16 @@ type EphemeralRunnerSetSpec struct {
|
||||
// EphemeralRunnerSetStatus defines the observed state of EphemeralRunnerSet
|
||||
type EphemeralRunnerSetStatus struct {
|
||||
// CurrentReplicas is the number of currently running EphemeralRunner resources being managed by this EphemeralRunnerSet.
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
CurrentReplicas int `json:"currentReplicas"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
PendingEphemeralRunners int `json:"pendingEphemeralRunners"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
RunningEphemeralRunners int `json:"runningEphemeralRunners"`
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
FailedEphemeralRunners int `json:"failedEphemeralRunners"`
|
||||
// +optional
|
||||
Phase EphemeralRunnerSetPhase `json:"phase"`
|
||||
|
||||
+1
@@ -16544,6 +16544,7 @@ spec:
|
||||
description: AutoscalingRunnerSetStatus defines the observed state of AutoscalingRunnerSet
|
||||
properties:
|
||||
currentRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
type: integer
|
||||
|
||||
+4
@@ -8315,15 +8315,19 @@ spec:
|
||||
properties:
|
||||
currentReplicas:
|
||||
description: CurrentReplicas is the number of currently running EphemeralRunner resources being managed by this EphemeralRunnerSet.
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
pendingEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
phase:
|
||||
description: EphemeralRunnerSetPhase is the phase of the ephemeral runner set resource
|
||||
type: string
|
||||
runningEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
required:
|
||||
- currentReplicas
|
||||
|
||||
+1
@@ -16544,6 +16544,7 @@ spec:
|
||||
description: AutoscalingRunnerSetStatus defines the observed state of AutoscalingRunnerSet
|
||||
properties:
|
||||
currentRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
type: integer
|
||||
|
||||
+4
@@ -8315,15 +8315,19 @@ spec:
|
||||
properties:
|
||||
currentReplicas:
|
||||
description: CurrentReplicas is the number of currently running EphemeralRunner resources being managed by this EphemeralRunnerSet.
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
pendingEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
phase:
|
||||
description: EphemeralRunnerSetPhase is the phase of the ephemeral runner set resource
|
||||
type: string
|
||||
runningEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
required:
|
||||
- currentReplicas
|
||||
|
||||
@@ -82,7 +82,10 @@ volumeMounts:
|
||||
subPath: extension
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{ include "githubServerTLS.volumeMountItem" (dict "root" $ "existingVolumeMounts" (list)) | nindent 2 }}
|
||||
{{- with .Values.runner.container.volumeMounts }}
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{ include "githubServerTLS.volumeMountItem" (dict "root" $ "existingVolumeMounts" (.Values.runner.container.volumeMounts | default list)) | nindent 2 }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "runner-mode-kubernetes.pod-volumes" -}}
|
||||
|
||||
@@ -16544,6 +16544,7 @@ spec:
|
||||
description: AutoscalingRunnerSetStatus defines the observed state of AutoscalingRunnerSet
|
||||
properties:
|
||||
currentRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
type: integer
|
||||
|
||||
@@ -8315,15 +8315,19 @@ spec:
|
||||
properties:
|
||||
currentReplicas:
|
||||
description: CurrentReplicas is the number of currently running EphemeralRunner resources being managed by this EphemeralRunnerSet.
|
||||
minimum: 0
|
||||
type: integer
|
||||
failedEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
pendingEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
phase:
|
||||
description: EphemeralRunnerSetPhase is the phase of the ephemeral runner set resource
|
||||
type: string
|
||||
runningEphemeralRunners:
|
||||
minimum: 0
|
||||
type: integer
|
||||
required:
|
||||
- currentReplicas
|
||||
|
||||
@@ -271,7 +271,6 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R
|
||||
}
|
||||
|
||||
func (r *EphemeralRunnerSetReconciler) updateStatus(ctx context.Context, ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet, state *ephemeralRunnersByState, log logr.Logger) error {
|
||||
original := ephemeralRunnerSet.DeepCopy()
|
||||
total := state.scaleTotal()
|
||||
var phase v1alpha1.EphemeralRunnerSetPhase
|
||||
switch {
|
||||
@@ -293,7 +292,7 @@ func (r *EphemeralRunnerSetReconciler) updateStatus(ctx context.Context, ephemer
|
||||
// Update the status if needed.
|
||||
if ephemeralRunnerSet.Status != desiredStatus {
|
||||
ephemeralRunnerSet.Status = desiredStatus
|
||||
if err := r.Status().Patch(ctx, ephemeralRunnerSet, client.MergeFrom(original)); err != nil {
|
||||
if err := r.Status().Update(ctx, ephemeralRunnerSet); err != nil {
|
||||
log.Error(err, "Failed to update EphemeralRunnerSet status")
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user