Compare commits

...

6 Commits

Author SHA1 Message Date
Nikola Jokic
7f15ae7f05 extending ephemeral runner statuses 2025-11-10 14:20:27 +01:00
Jiaren Wu
dbac55ca9e Fix for code scanning alert no. 5: Workflow does not contain permissions (#4292)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-31 10:20:30 +01:00
github-actions[bot]
91d45d870a Updates: runner to v2.329.0 container-hooks to v0.8.0 (#4279)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-10-30 10:32:22 +01:00
Nikola Jokic
4d22089978 Delete listener resources without requeueing on each call (#4289) 2025-10-29 13:01:00 +01:00
Nikola Jokic
8007b8af25 Fix first interaction action (#4290) 2025-10-29 12:49:39 +01:00
dependabot[bot]
0baa4f6b09 Bump github/codeql-action from 3 to 4 in the actions group (#4281)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-22 11:26:36 +02:00
15 changed files with 140 additions and 85 deletions

View File

@@ -1,4 +1,6 @@
name: Release ARC Runner Images name: Release ARC Runner Images
permissions:
contents: read
# Revert to https://github.com/actions-runner-controller/releases#releases # Revert to https://github.com/actions-runner-controller/releases#releases
# for details on why we use this approach # for details on why we use this approach

View File

@@ -33,12 +33,12 @@ jobs:
go-version-file: go.mod go-version-file: go.mod
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v4
with: with:
languages: go, actions languages: go, actions
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v3 uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v4

View File

@@ -17,18 +17,18 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- uses: actions/first-interaction@main - uses: actions/first-interaction@v3
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo_token: ${{ secrets.GITHUB_TOKEN }}
issue-message: | issue_message: |
Hello! Thank you for filing an issue. Hello! Thank you for filing an issue.
The maintainers will triage your issue shortly. The maintainers will triage your issue shortly.
In the meantime, please take a look at the [troubleshooting guide](https://github.com/actions/actions-runner-controller/blob/master/TROUBLESHOOTING.md) for bug reports. In the meantime, please take a look at the [troubleshooting guide](https://github.com/actions/actions-runner-controller/blob/master/TROUBLESHOOTING.md) for bug reports.
If this is a feature request, please review our [contribution guidelines](https://github.com/actions/actions-runner-controller/blob/master/CONTRIBUTING.md). If this is a feature request, please review our [contribution guidelines](https://github.com/actions/actions-runner-controller/blob/master/CONTRIBUTING.md).
pr-message: | pr_message: |
Hello! Thank you for your contribution. Hello! Thank you for your contribution.
Please review our [contribution guidelines](https://github.com/actions/actions-runner-controller/blob/master/CONTRIBUTING.md) to understand the project's testing and code conventions. Please review our [contribution guidelines](https://github.com/actions/actions-runner-controller/blob/master/CONTRIBUTING.md) to understand the project's testing and code conventions.

View File

@@ -6,7 +6,7 @@ endif
DOCKER_USER ?= $(shell echo ${DOCKER_IMAGE_NAME} | cut -d / -f1) DOCKER_USER ?= $(shell echo ${DOCKER_IMAGE_NAME} | cut -d / -f1)
VERSION ?= dev VERSION ?= dev
COMMIT_SHA = $(shell git rev-parse HEAD) COMMIT_SHA = $(shell git rev-parse HEAD)
RUNNER_VERSION ?= 2.328.0 RUNNER_VERSION ?= 2.329.0
TARGETPLATFORM ?= $(shell arch) TARGETPLATFORM ?= $(shell arch)
RUNNER_NAME ?= ${DOCKER_USER}/actions-runner RUNNER_NAME ?= ${DOCKER_USER}/actions-runner
RUNNER_TAG ?= ${VERSION} RUNNER_TAG ?= ${VERSION}
@@ -307,7 +307,7 @@ github-release: release
# Otherwise we get errors like the below: # Otherwise we get errors like the below:
# Error: failed to install CRD crds/actions.summerwind.dev_runnersets.yaml: CustomResourceDefinition.apiextensions.k8s.io "runnersets.actions.summerwind.dev" is invalid: [spec.validation.openAPIV3Schema.properties[spec].properties[template].properties[spec].properties[containers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property, spec.validation.openAPIV3Schema.properties[spec].properties[template].properties[spec].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property] # Error: failed to install CRD crds/actions.summerwind.dev_runnersets.yaml: CustomResourceDefinition.apiextensions.k8s.io "runnersets.actions.summerwind.dev" is invalid: [spec.validation.openAPIV3Schema.properties[spec].properties[template].properties[spec].properties[containers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property, spec.validation.openAPIV3Schema.properties[spec].properties[template].properties[spec].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property]
# #
# Note that controller-gen newer than 0.7.0 is needed due to https://github.com/kubernetes-sigs/controller-tools/issues/448 # Note that controller-gen newer than 0.8.0 is needed due to https://github.com/kubernetes-sigs/controller-tools/issues/448
# Otherwise ObjectMeta embedded in Spec results in empty on the storage. # Otherwise ObjectMeta embedded in Spec results in empty on the storage.
controller-gen: controller-gen:
ifeq (, $(shell which controller-gen)) ifeq (, $(shell which controller-gen))

View File

@@ -48,7 +48,7 @@ type EphemeralRunner struct {
} }
func (er *EphemeralRunner) IsDone() bool { func (er *EphemeralRunner) IsDone() bool {
return er.Status.Phase == corev1.PodSucceeded || er.Status.Phase == corev1.PodFailed return er.Status.Phase == EphemeralRunnerSucceeded || er.Status.Phase == EphemeralRunnerFailed
} }
func (er *EphemeralRunner) HasJob() bool { func (er *EphemeralRunner) HasJob() bool {
@@ -125,6 +125,40 @@ type EphemeralRunnerSpec struct {
corev1.PodTemplateSpec `json:",inline"` corev1.PodTemplateSpec `json:",inline"`
} }
// EphemeralRunnerPhase is a label for the condition of an EphemeralRunner at the current time.
// +kubebuilder:validation:Enum=Pending;Running;Restarting;Succeeded;Failed;Aborted
type EphemeralRunnerPhase string
const (
// EphemeralRunnerPending is the stage where the ephemeral runner is about to start.
EphemeralRunnerPending EphemeralRunnerPhase = "Pending"
// EphemeralRunnerRunning is the stage where the ephemeral runner is running and ready to accept the job.
EphemeralRunnerRunning EphemeralRunnerPhase = "Running"
// EphemeralRunnerRestarting is the stage where the ephemeral runner pod stopped, so the ephemeral runner should restart it
EphemeralRunnerRestarting EphemeralRunnerPhase = "Restarting"
// EphemeralRunnerSucceeded is the stage where the ephemeral runner finished running and exited with exit code 0.
EphemeralRunnerSucceeded EphemeralRunnerPhase = "Succeeded"
// EphemeralRunnerFailed means that the ephemeral runner finished running and exited with a non-zero exit code.
EphemeralRunnerFailed EphemeralRunnerPhase = "Failed"
// EphemeralRunnerAborted means that the ephemeral runner failed to start due to unrecoverable failure, and will be left as is for manual inspection.
EphemeralRunnerAborted EphemeralRunnerPhase = "Aborted"
)
func EphemeralRunnerPhaseFromPodPhase(podPhase corev1.PodPhase) EphemeralRunnerPhase {
switch podPhase {
case corev1.PodPending:
return EphemeralRunnerPending
case corev1.PodRunning:
return EphemeralRunnerRunning
case corev1.PodSucceeded:
return EphemeralRunnerSucceeded
case corev1.PodFailed:
return EphemeralRunnerFailed
default:
return EphemeralRunnerPending
}
}
// EphemeralRunnerStatus defines the observed state of EphemeralRunner // EphemeralRunnerStatus defines the observed state of EphemeralRunner
type EphemeralRunnerStatus struct { type EphemeralRunnerStatus struct {
// Turns true only if the runner is online. // Turns true only if the runner is online.
@@ -140,7 +174,7 @@ type EphemeralRunnerStatus struct {
// The PodSucceded phase should be set only when confirmed that EphemeralRunner // The PodSucceded phase should be set only when confirmed that EphemeralRunner
// actually executed the job and has been removed from the service. // actually executed the job and has been removed from the service.
// +optional // +optional
Phase corev1.PodPhase `json:"phase,omitempty"` Phase EphemeralRunnerPhase `json:"phase,omitempty"`
// +optional // +optional
Reason string `json:"reason,omitempty"` Reason string `json:"reason,omitempty"`
// +optional // +optional

View File

@@ -8257,6 +8257,13 @@ spec:
The PodSucceded phase should be set only when confirmed that EphemeralRunner The PodSucceded phase should be set only when confirmed that EphemeralRunner
actually executed the job and has been removed from the service. actually executed the job and has been removed from the service.
enum:
- Pending
- Running
- Restarting
- Succeeded
- Failed
- Aborted
type: string type: string
ready: ready:
description: Turns true only if the runner is online. description: Turns true only if the runner is online.

View File

@@ -8257,6 +8257,13 @@ spec:
The PodSucceded phase should be set only when confirmed that EphemeralRunner The PodSucceded phase should be set only when confirmed that EphemeralRunner
actually executed the job and has been removed from the service. actually executed the job and has been removed from the service.
enum:
- Pending
- Running
- Restarting
- Succeeded
- Failed
- Aborted
type: string type: string
ready: ready:
description: Turns true only if the runner is online. description: Turns true only if the runner is online.

View File

@@ -19,6 +19,7 @@ package actionsgithubcom
import ( import (
"context" "context"
"fmt" "fmt"
"time"
"github.com/go-logr/logr" "github.com/go-logr/logr"
kerrors "k8s.io/apimachinery/pkg/api/errors" kerrors "k8s.io/apimachinery/pkg/api/errors"
@@ -84,14 +85,14 @@ func (r *AutoscalingListenerReconciler) Reconcile(ctx context.Context, req ctrl.
} }
log.Info("Deleting resources") log.Info("Deleting resources")
done, err := r.cleanupResources(ctx, autoscalingListener, log) requeue, err := r.cleanupResources(ctx, autoscalingListener, log)
if err != nil { if err != nil {
log.Error(err, "Failed to cleanup resources after deletion") log.Error(err, "Failed to cleanup resources after deletion")
return ctrl.Result{}, err return ctrl.Result{}, err
} }
if !done { if requeue {
log.Info("Waiting for resources to be deleted before removing finalizer") log.Info("Waiting for resources to be deleted before removing finalizer")
return ctrl.Result{Requeue: true}, nil return ctrl.Result{Requeue: true, RequeueAfter: time.Second}, nil
} }
log.Info("Removing finalizer") log.Info("Removing finalizer")
@@ -272,7 +273,7 @@ func (r *AutoscalingListenerReconciler) Reconcile(ctx context.Context, req ctrl.
return ctrl.Result{}, nil return ctrl.Result{}, nil
} }
func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, autoscalingListener *v1alpha1.AutoscalingListener, logger logr.Logger) (done bool, err error) { func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, autoscalingListener *v1alpha1.AutoscalingListener, logger logr.Logger) (requeue bool, err error) {
logger.Info("Cleaning up the listener pod") logger.Info("Cleaning up the listener pod")
listenerPod := new(corev1.Pod) listenerPod := new(corev1.Pod)
err = r.Get(ctx, types.NamespacedName{Name: autoscalingListener.Name, Namespace: autoscalingListener.Namespace}, listenerPod) err = r.Get(ctx, types.NamespacedName{Name: autoscalingListener.Name, Namespace: autoscalingListener.Namespace}, listenerPod)
@@ -284,7 +285,7 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener pod: %w", err) return false, fmt.Errorf("failed to delete listener pod: %w", err)
} }
} }
return false, nil requeue = true
case kerrors.IsNotFound(err): case kerrors.IsNotFound(err):
_ = r.publishRunningListener(autoscalingListener, false) // If error is returned, we never published metrics so it is safe to ignore _ = r.publishRunningListener(autoscalingListener, false) // If error is returned, we never published metrics so it is safe to ignore
default: default:
@@ -302,7 +303,7 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener config secret: %w", err) return false, fmt.Errorf("failed to delete listener config secret: %w", err)
} }
} }
return false, nil requeue = true
case !kerrors.IsNotFound(err): case !kerrors.IsNotFound(err):
return false, fmt.Errorf("failed to get listener config secret: %w", err) return false, fmt.Errorf("failed to get listener config secret: %w", err)
} }
@@ -319,7 +320,7 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener proxy secret: %w", err) return false, fmt.Errorf("failed to delete listener proxy secret: %w", err)
} }
} }
return false, nil requeue = true
case !kerrors.IsNotFound(err): case !kerrors.IsNotFound(err):
return false, fmt.Errorf("failed to get listener proxy secret: %w", err) return false, fmt.Errorf("failed to get listener proxy secret: %w", err)
} }
@@ -336,7 +337,7 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener role binding: %w", err) return false, fmt.Errorf("failed to delete listener role binding: %w", err)
} }
} }
return false, nil requeue = true
case !kerrors.IsNotFound(err): case !kerrors.IsNotFound(err):
return false, fmt.Errorf("failed to get listener role binding: %w", err) return false, fmt.Errorf("failed to get listener role binding: %w", err)
} }
@@ -352,7 +353,7 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener role: %w", err) return false, fmt.Errorf("failed to delete listener role: %w", err)
} }
} }
return false, nil requeue = true
case !kerrors.IsNotFound(err): case !kerrors.IsNotFound(err):
return false, fmt.Errorf("failed to get listener role: %w", err) return false, fmt.Errorf("failed to get listener role: %w", err)
} }
@@ -369,13 +370,13 @@ func (r *AutoscalingListenerReconciler) cleanupResources(ctx context.Context, au
return false, fmt.Errorf("failed to delete listener service account: %w", err) return false, fmt.Errorf("failed to delete listener service account: %w", err)
} }
} }
return false, nil requeue = true
case !kerrors.IsNotFound(err): case !kerrors.IsNotFound(err):
return false, fmt.Errorf("failed to get listener service account: %w", err) return false, fmt.Errorf("failed to get listener service account: %w", err)
} }
logger.Info("Listener service account is deleted") logger.Info("Listener service account is deleted")
return true, nil return requeue, nil
} }
func (r *AutoscalingListenerReconciler) createServiceAccountForListener(ctx context.Context, autoscalingListener *v1alpha1.AutoscalingListener, logger logr.Logger) (ctrl.Result, error) { func (r *AutoscalingListenerReconciler) createServiceAccountForListener(ctx context.Context, autoscalingListener *v1alpha1.AutoscalingListener, logger logr.Logger) (ctrl.Result, error) {

View File

@@ -285,7 +285,7 @@ func (r *EphemeralRunnerReconciler) Reconcile(ctx context.Context, req ctrl.Requ
case kerrors.IsInvalid(err) || kerrors.IsForbidden(err): case kerrors.IsInvalid(err) || kerrors.IsForbidden(err):
log.Error(err, "Failed to create a pod due to unrecoverable failure") log.Error(err, "Failed to create a pod due to unrecoverable failure")
errMessage := fmt.Sprintf("Failed to create the pod: %v", err) errMessage := fmt.Sprintf("Failed to create the pod: %v", err)
if err := r.markAsFailed(ctx, ephemeralRunner, errMessage, ReasonInvalidPodFailure, log); err != nil { if err := r.markAsAborted(ctx, ephemeralRunner, errMessage, ReasonInvalidPodFailure, log); err != nil {
log.Error(err, "Failed to set ephemeral runner to phase Failed") log.Error(err, "Failed to set ephemeral runner to phase Failed")
return ctrl.Result{}, err return ctrl.Result{}, err
} }
@@ -511,10 +511,12 @@ func (r *EphemeralRunnerReconciler) cleanupRunnerLinkedSecrets(ctx context.Conte
return errors.Join(errs...) return errors.Join(errs...)
} }
func (r *EphemeralRunnerReconciler) markAsFailed(ctx context.Context, ephemeralRunner *v1alpha1.EphemeralRunner, errMessage string, reason string, log logr.Logger) error { // markAsAborted updates the ephemeral runner status to aborted and stops the reconciliation.
// This runner is left in aborted state and won't be deleted until someone manually does that.
func (r *EphemeralRunnerReconciler) markAsAborted(ctx context.Context, ephemeralRunner *v1alpha1.EphemeralRunner, errMessage string, reason string, log logr.Logger) error {
log.Info("Updating ephemeral runner status to Failed") log.Info("Updating ephemeral runner status to Failed")
if err := patchSubResource(ctx, r.Status(), ephemeralRunner, func(obj *v1alpha1.EphemeralRunner) { if err := patchSubResource(ctx, r.Status(), ephemeralRunner, func(obj *v1alpha1.EphemeralRunner) {
obj.Status.Phase = corev1.PodFailed obj.Status.Phase = v1alpha1.EphemeralRunnerAborted
obj.Status.Reason = reason obj.Status.Reason = reason
obj.Status.Message = errMessage obj.Status.Message = errMessage
}); err != nil { }); err != nil {
@@ -545,6 +547,7 @@ func (r *EphemeralRunnerReconciler) deletePodAsFailed(ctx context.Context, ephem
if obj.Status.Failures == nil { if obj.Status.Failures == nil {
obj.Status.Failures = make(map[string]metav1.Time) obj.Status.Failures = make(map[string]metav1.Time)
} }
obj.Status.Phase = v1alpha1.EphemeralRunnerRestarting
obj.Status.Failures[string(pod.UID)] = metav1.Now() obj.Status.Failures[string(pod.UID)] = metav1.Now()
obj.Status.Ready = false obj.Status.Ready = false
obj.Status.Reason = pod.Status.Reason obj.Status.Reason = pod.Status.Reason
@@ -734,7 +737,8 @@ func (r *EphemeralRunnerReconciler) updateRunStatusFromPod(ctx context.Context,
} }
} }
phaseChanged := ephemeralRunner.Status.Phase != pod.Status.Phase newPhase := v1alpha1.EphemeralRunnerPhaseFromPodPhase(pod.Status.Phase)
phaseChanged := ephemeralRunner.Status.Phase != newPhase
readyChanged := ready != ephemeralRunner.Status.Ready readyChanged := ready != ephemeralRunner.Status.Ready
if !phaseChanged && !readyChanged { if !phaseChanged && !readyChanged {
@@ -749,7 +753,7 @@ func (r *EphemeralRunnerReconciler) updateRunStatusFromPod(ctx context.Context,
"ready", ready, "ready", ready,
) )
err := patchSubResource(ctx, r.Status(), ephemeralRunner, func(obj *v1alpha1.EphemeralRunner) { err := patchSubResource(ctx, r.Status(), ephemeralRunner, func(obj *v1alpha1.EphemeralRunner) {
obj.Status.Phase = pod.Status.Phase obj.Status.Phase = newPhase
obj.Status.Ready = ready obj.Status.Ready = ready
obj.Status.Reason = pod.Status.Reason obj.Status.Reason = pod.Status.Reason
obj.Status.Message = pod.Status.Message obj.Status.Message = pod.Status.Message

View File

@@ -270,7 +270,7 @@ var _ = Describe("EphemeralRunner", func() {
updated := new(v1alpha1.EphemeralRunner) updated := new(v1alpha1.EphemeralRunner)
Eventually( Eventually(
func() (corev1.PodPhase, error) { func() (v1alpha1.EphemeralRunnerPhase, error) {
err := k8sClient.Get( err := k8sClient.Get(
ctx, ctx,
client.ObjectKey{Name: invalideEphemeralRunner.Name, Namespace: invalideEphemeralRunner.Namespace}, client.ObjectKey{Name: invalideEphemeralRunner.Name, Namespace: invalideEphemeralRunner.Namespace},
@@ -283,7 +283,7 @@ var _ = Describe("EphemeralRunner", func() {
}, },
ephemeralRunnerTimeout, ephemeralRunnerTimeout,
ephemeralRunnerInterval, ephemeralRunnerInterval,
).Should(BeEquivalentTo(corev1.PodFailed)) ).Should(BeEquivalentTo(v1alpha1.EphemeralRunnerAborted))
Expect(updated.Status.Reason).Should(Equal("InvalidPod")) Expect(updated.Status.Reason).Should(Equal("InvalidPod"))
Expect(updated.Status.Message).Should(Equal("Failed to create the pod: pods \"invalid-ephemeral-runner\" is forbidden: no PriorityClass with name notexist was found")) Expect(updated.Status.Message).Should(Equal("Failed to create the pod: pods \"invalid-ephemeral-runner\" is forbidden: no PriorityClass with name notexist was found"))
@@ -470,7 +470,7 @@ var _ = Describe("EphemeralRunner", func() {
var updated *v1alpha1.EphemeralRunner var updated *v1alpha1.EphemeralRunner
Eventually( Eventually(
func() (corev1.PodPhase, error) { func() (v1alpha1.EphemeralRunnerPhase, error) {
updated = new(v1alpha1.EphemeralRunner) updated = new(v1alpha1.EphemeralRunner)
err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated) err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated)
if err != nil { if err != nil {
@@ -480,7 +480,7 @@ var _ = Describe("EphemeralRunner", func() {
}, },
ephemeralRunnerTimeout, ephemeralRunnerTimeout,
ephemeralRunnerInterval, ephemeralRunnerInterval,
).Should(BeEquivalentTo(phase)) ).Should(BeEquivalentTo(v1alpha1.EphemeralRunnerPhase(phase)))
} }
}) })
@@ -592,10 +592,10 @@ var _ = Describe("EphemeralRunner", func() {
Expect(err).To(BeNil(), "failed to patch pod status") Expect(err).To(BeNil(), "failed to patch pod status")
Consistently( Consistently(
func() (corev1.PodPhase, error) { func() (v1alpha1.EphemeralRunnerPhase, error) {
updated := new(v1alpha1.EphemeralRunner) updated := new(v1alpha1.EphemeralRunner)
if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil { if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil {
return corev1.PodUnknown, err return "", err
} }
return updated.Status.Phase, nil return updated.Status.Phase, nil
}, },
@@ -772,7 +772,7 @@ var _ = Describe("EphemeralRunner", func() {
Expect(err).To(BeNil()) Expect(err).To(BeNil())
Eventually( Eventually(
func() (corev1.PodPhase, error) { func() (v1alpha1.EphemeralRunnerPhase, error) {
updated := new(v1alpha1.EphemeralRunner) updated := new(v1alpha1.EphemeralRunner)
if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil { if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil {
return "", err return "", err
@@ -781,7 +781,7 @@ var _ = Describe("EphemeralRunner", func() {
}, },
ephemeralRunnerTimeout, ephemeralRunnerTimeout,
ephemeralRunnerInterval, ephemeralRunnerInterval,
).Should(BeEquivalentTo(corev1.PodRunning)) ).Should(BeEquivalentTo(v1alpha1.EphemeralRunnerRunning))
// set phase to succeeded // set phase to succeeded
pod.Status.Phase = corev1.PodSucceeded pod.Status.Phase = corev1.PodSucceeded
@@ -789,7 +789,7 @@ var _ = Describe("EphemeralRunner", func() {
Expect(err).To(BeNil()) Expect(err).To(BeNil())
Consistently( Consistently(
func() (corev1.PodPhase, error) { func() (v1alpha1.EphemeralRunnerPhase, error) {
updated := new(v1alpha1.EphemeralRunner) updated := new(v1alpha1.EphemeralRunner)
if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil { if err := k8sClient.Get(ctx, client.ObjectKey{Name: ephemeralRunner.Name, Namespace: ephemeralRunner.Namespace}, updated); err != nil {
return "", err return "", err
@@ -797,7 +797,7 @@ var _ = Describe("EphemeralRunner", func() {
return updated.Status.Phase, nil return updated.Status.Phase, nil
}, },
ephemeralRunnerTimeout, ephemeralRunnerTimeout,
).Should(BeEquivalentTo(corev1.PodRunning)) ).Should(BeEquivalentTo(v1alpha1.EphemeralRunnerRunning))
}) })
}) })

View File

@@ -162,7 +162,7 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R
"pending", len(ephemeralRunnerState.pending), "pending", len(ephemeralRunnerState.pending),
"running", len(ephemeralRunnerState.running), "running", len(ephemeralRunnerState.running),
"finished", len(ephemeralRunnerState.finished), "finished", len(ephemeralRunnerState.finished),
"failed", len(ephemeralRunnerState.failed), "failed", len(ephemeralRunnerState.aborted),
"deleting", len(ephemeralRunnerState.deleting), "deleting", len(ephemeralRunnerState.deleting),
) )
@@ -185,7 +185,7 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R
}, },
len(ephemeralRunnerState.pending), len(ephemeralRunnerState.pending),
len(ephemeralRunnerState.running), len(ephemeralRunnerState.running),
len(ephemeralRunnerState.failed), len(ephemeralRunnerState.aborted),
) )
} }
@@ -232,7 +232,7 @@ func (r *EphemeralRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl.R
CurrentReplicas: total, CurrentReplicas: total,
PendingEphemeralRunners: len(ephemeralRunnerState.pending), PendingEphemeralRunners: len(ephemeralRunnerState.pending),
RunningEphemeralRunners: len(ephemeralRunnerState.running), RunningEphemeralRunners: len(ephemeralRunnerState.running),
FailedEphemeralRunners: len(ephemeralRunnerState.failed), FailedEphemeralRunners: len(ephemeralRunnerState.aborted),
} }
// Update the status if needed. // Update the status if needed.
@@ -307,13 +307,13 @@ func (r *EphemeralRunnerSetReconciler) cleanUpEphemeralRunners(ctx context.Conte
"pending", len(ephemeralRunnerState.pending), "pending", len(ephemeralRunnerState.pending),
"running", len(ephemeralRunnerState.running), "running", len(ephemeralRunnerState.running),
"finished", len(ephemeralRunnerState.finished), "finished", len(ephemeralRunnerState.finished),
"failed", len(ephemeralRunnerState.failed), "failed", len(ephemeralRunnerState.aborted),
"deleting", len(ephemeralRunnerState.deleting), "deleting", len(ephemeralRunnerState.deleting),
) )
log.Info("Cleanup finished or failed ephemeral runners") log.Info("Cleanup finished or failed ephemeral runners")
var errs []error var errs []error
for _, ephemeralRunner := range append(ephemeralRunnerState.finished, ephemeralRunnerState.failed...) { for _, ephemeralRunner := range append(ephemeralRunnerState.finished, ephemeralRunnerState.aborted...) {
log.Info("Deleting ephemeral runner", "name", ephemeralRunner.Name) log.Info("Deleting ephemeral runner", "name", ephemeralRunner.Name)
if err := r.Delete(ctx, ephemeralRunner); err != nil && !kerrors.IsNotFound(err) { if err := r.Delete(ctx, ephemeralRunner); err != nil && !kerrors.IsNotFound(err) {
errs = append(errs, err) errs = append(errs, err)
@@ -564,7 +564,7 @@ type ephemeralRunnerState struct {
pending []*v1alpha1.EphemeralRunner pending []*v1alpha1.EphemeralRunner
running []*v1alpha1.EphemeralRunner running []*v1alpha1.EphemeralRunner
finished []*v1alpha1.EphemeralRunner finished []*v1alpha1.EphemeralRunner
failed []*v1alpha1.EphemeralRunner aborted []*v1alpha1.EphemeralRunner
deleting []*v1alpha1.EphemeralRunner deleting []*v1alpha1.EphemeralRunner
latestPatchID int latestPatchID int
@@ -585,12 +585,12 @@ func newEphemeralRunnerState(ephemeralRunnerList *v1alpha1.EphemeralRunnerList)
} }
switch r.Status.Phase { switch r.Status.Phase {
case corev1.PodRunning: case v1alpha1.EphemeralRunnerRunning:
ephemeralRunnerState.running = append(ephemeralRunnerState.running, r) ephemeralRunnerState.running = append(ephemeralRunnerState.running, r)
case corev1.PodSucceeded: case v1alpha1.EphemeralRunnerSucceeded, v1alpha1.EphemeralRunnerFailed:
ephemeralRunnerState.finished = append(ephemeralRunnerState.finished, r) ephemeralRunnerState.finished = append(ephemeralRunnerState.finished, r)
case corev1.PodFailed: case v1alpha1.EphemeralRunnerAborted:
ephemeralRunnerState.failed = append(ephemeralRunnerState.failed, r) ephemeralRunnerState.aborted = append(ephemeralRunnerState.aborted, r)
default: default:
// Pending or no phase should be considered as pending. // Pending or no phase should be considered as pending.
// //
@@ -603,5 +603,5 @@ func newEphemeralRunnerState(ephemeralRunnerList *v1alpha1.EphemeralRunnerList)
} }
func (s *ephemeralRunnerState) scaleTotal() int { func (s *ephemeralRunnerState) scaleTotal() int {
return len(s.pending) + len(s.running) + len(s.failed) return len(s.pending) + len(s.running) + len(s.aborted)
} }

View File

@@ -163,7 +163,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
for i, runner := range runnerList.Items { for i, runner := range runnerList.Items {
if runner.Status.RunnerId == 0 { if runner.Status.RunnerId == 0 {
updatedRunner := runner.DeepCopy() updatedRunner := runner.DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
updatedRunner.Status.RunnerId = i + 100 updatedRunner.Status.RunnerId = i + 100
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner)) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -225,7 +225,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
for i, runner := range runnerList.Items { for i, runner := range runnerList.Items {
if runner.Status.RunnerId == 0 { if runner.Status.RunnerId == 0 {
updatedRunner := runner.DeepCopy() updatedRunner := runner.DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
updatedRunner.Status.RunnerId = i + 100 updatedRunner.Status.RunnerId = i + 100
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner)) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -390,12 +390,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created") ).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created")
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -468,12 +468,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created") ).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created")
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodPending updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerPending
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -520,12 +520,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created") ).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created")
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -555,7 +555,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
} }
for _, runner := range runnerList.Items { for _, runner := range runnerList.Items {
if runner.Status.Phase == corev1.PodSucceeded { if runner.Status.Phase == v1alpha1.EphemeralRunnerSucceeded {
return fmt.Errorf("Runner %s is in Succeeded phase", runner.Name) return fmt.Errorf("Runner %s is in Succeeded phase", runner.Name)
} }
} }
@@ -594,12 +594,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created") ).Should(BeEquivalentTo(2), "2 EphemeralRunner should be created")
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodPending updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerPending
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -615,9 +615,9 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
succeeded := 0 succeeded := 0
for _, runner := range runnerList.Items { for _, runner := range runnerList.Items {
switch runner.Status.Phase { switch runner.Status.Phase {
case corev1.PodSucceeded: case v1alpha1.EphemeralRunnerSucceeded:
succeeded++ succeeded++
case corev1.PodPending: case v1alpha1.EphemeralRunnerPending:
pending++ pending++
} }
} }
@@ -657,7 +657,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
return fmt.Errorf("Expected 1 runner, got %d", len(runnerList.Items)) return fmt.Errorf("Expected 1 runner, got %d", len(runnerList.Items))
} }
if runnerList.Items[0].Status.Phase != corev1.PodPending { if runnerList.Items[0].Status.Phase != v1alpha1.EphemeralRunnerPending {
return fmt.Errorf("Expected runner to be in Pending, got %s", runnerList.Items[0].Status.Phase) return fmt.Errorf("Expected runner to be in Pending, got %s", runnerList.Items[0].Status.Phase)
} }
@@ -669,7 +669,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
// Now, the ephemeral runner finally is done and we can scale down to 0 // Now, the ephemeral runner finally is done and we can scale down to 0
updatedRunner = runnerList.Items[0].DeepCopy() updatedRunner = runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -715,12 +715,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
// Put one runner in Pending and one in Running // Put one runner in Pending and one in Running
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodPending updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerPending
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -738,9 +738,9 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
for _, runner := range runnerList.Items { for _, runner := range runnerList.Items {
switch runner.Status.Phase { switch runner.Status.Phase {
case corev1.PodPending: case v1alpha1.EphemeralRunnerPending:
pending++ pending++
case corev1.PodRunning: case v1alpha1.EphemeralRunnerRunning:
running++ running++
} }
@@ -839,12 +839,12 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
// Put one runner in Succeeded and one in Running // Put one runner in Succeeded and one in Running
updatedRunner := runnerList.Items[0].DeepCopy() updatedRunner := runnerList.Items[0].DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
updatedRunner = runnerList.Items[1].DeepCopy() updatedRunner = runnerList.Items[1].DeepCopy()
updatedRunner.Status.Phase = corev1.PodRunning updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1])) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runnerList.Items[1]))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -863,9 +863,9 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
for _, runner := range runnerList.Items { for _, runner := range runnerList.Items {
switch runner.Status.Phase { switch runner.Status.Phase {
case corev1.PodSucceeded: case v1alpha1.EphemeralRunnerSucceeded:
succeeded++ succeeded++
case corev1.PodRunning: case v1alpha1.EphemeralRunnerRunning:
running++ running++
} }
} }
@@ -907,7 +907,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
} }
for _, runner := range runnerList.Items { for _, runner := range runnerList.Items {
if runner.Status.Phase == corev1.PodSucceeded { if runner.Status.Phase == v1alpha1.EphemeralRunnerSucceeded {
return fmt.Errorf("Expected no runners in Succeeded phase, got one") return fmt.Errorf("Expected no runners in Succeeded phase, got one")
} }
} }
@@ -972,7 +972,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
pending := pendingOriginal.DeepCopy() pending := pendingOriginal.DeepCopy()
pending.Status.RunnerId = 101 pending.Status.RunnerId = 101
pending.Status.Phase = corev1.PodPending pending.Status.Phase = v1alpha1.EphemeralRunnerPending
err = k8sClient.Status().Patch(ctx, pending, client.MergeFrom(pendingOriginal)) err = k8sClient.Status().Patch(ctx, pending, client.MergeFrom(pendingOriginal))
if err != nil { if err != nil {
@@ -986,7 +986,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
empty = empty[1:] empty = empty[1:]
running := runningOriginal.DeepCopy() running := runningOriginal.DeepCopy()
running.Status.RunnerId = 102 running.Status.RunnerId = 102
running.Status.Phase = corev1.PodRunning running.Status.Phase = v1alpha1.EphemeralRunnerRunning
err = k8sClient.Status().Patch(ctx, running, client.MergeFrom(runningOriginal)) err = k8sClient.Status().Patch(ctx, running, client.MergeFrom(runningOriginal))
if err != nil { if err != nil {
@@ -1000,7 +1000,7 @@ var _ = Describe("Test EphemeralRunnerSet controller", func() {
failed := pendingOriginal.DeepCopy() failed := pendingOriginal.DeepCopy()
failed.Status.RunnerId = 103 failed.Status.RunnerId = 103
failed.Status.Phase = corev1.PodFailed failed.Status.Phase = v1alpha1.EphemeralRunnerAborted
err = k8sClient.Status().Patch(ctx, failed, client.MergeFrom(failedOriginal)) err = k8sClient.Status().Patch(ctx, failed, client.MergeFrom(failedOriginal))
if err != nil { if err != nil {
@@ -1236,7 +1236,7 @@ var _ = Describe("Test EphemeralRunnerSet controller with proxy settings", func(
for i, runner := range runnerList.Items { for i, runner := range runnerList.Items {
if runner.Status.RunnerId == 0 { if runner.Status.RunnerId == 0 {
updatedRunner := runner.DeepCopy() updatedRunner := runner.DeepCopy()
updatedRunner.Status.Phase = corev1.PodSucceeded updatedRunner.Status.Phase = v1alpha1.EphemeralRunnerSucceeded
updatedRunner.Status.RunnerId = i + 100 updatedRunner.Status.RunnerId = i + 100
err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner)) err = k8sClient.Status().Patch(ctx, updatedRunner, client.MergeFrom(&runner))
Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner") Expect(err).NotTo(HaveOccurred(), "failed to update EphemeralRunner")
@@ -1355,7 +1355,7 @@ var _ = Describe("Test EphemeralRunnerSet controller with proxy settings", func(
).Should(BeEquivalentTo(1), "failed to create ephemeral runner") ).Should(BeEquivalentTo(1), "failed to create ephemeral runner")
runner := runnerList.Items[0].DeepCopy() runner := runnerList.Items[0].DeepCopy()
runner.Status.Phase = corev1.PodRunning runner.Status.Phase = v1alpha1.EphemeralRunnerRunning
runner.Status.RunnerId = 100 runner.Status.RunnerId = 100
err = k8sClient.Status().Patch(ctx, runner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, runner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update ephemeral runner status") Expect(err).NotTo(HaveOccurred(), "failed to update ephemeral runner status")
@@ -1505,7 +1505,7 @@ var _ = Describe("Test EphemeralRunnerSet controller with custom root CA", func(
Expect(runner.Spec.GitHubServerTLS).NotTo(BeNil(), "runner tls config should not be nil") Expect(runner.Spec.GitHubServerTLS).NotTo(BeNil(), "runner tls config should not be nil")
Expect(runner.Spec.GitHubServerTLS).To(BeEquivalentTo(ephemeralRunnerSet.Spec.EphemeralRunnerSpec.GitHubServerTLS), "runner tls config should be correct") Expect(runner.Spec.GitHubServerTLS).To(BeEquivalentTo(ephemeralRunnerSet.Spec.EphemeralRunnerSpec.GitHubServerTLS), "runner tls config should be correct")
runner.Status.Phase = corev1.PodRunning runner.Status.Phase = v1alpha1.EphemeralRunnerRunning
runner.Status.RunnerId = 100 runner.Status.RunnerId = 100
err = k8sClient.Status().Patch(ctx, runner, client.MergeFrom(&runnerList.Items[0])) err = k8sClient.Status().Patch(ctx, runner, client.MergeFrom(&runnerList.Items[0]))
Expect(err).NotTo(HaveOccurred(), "failed to update ephemeral runner status") Expect(err).NotTo(HaveOccurred(), "failed to update ephemeral runner status")

View File

@@ -6,8 +6,8 @@ DIND_ROOTLESS_RUNNER_NAME ?= ${DOCKER_USER}/actions-runner-dind-rootless
OS_IMAGE ?= ubuntu-22.04 OS_IMAGE ?= ubuntu-22.04
TARGETPLATFORM ?= $(shell arch) TARGETPLATFORM ?= $(shell arch)
RUNNER_VERSION ?= 2.328.0 RUNNER_VERSION ?= 2.329.0
RUNNER_CONTAINER_HOOKS_VERSION ?= 0.7.0 RUNNER_CONTAINER_HOOKS_VERSION ?= 0.8.0
DOCKER_VERSION ?= 24.0.7 DOCKER_VERSION ?= 24.0.7
# default list of platforms for which multiarch image is built # default list of platforms for which multiarch image is built

View File

@@ -1,2 +1,2 @@
RUNNER_VERSION=2.328.0 RUNNER_VERSION=2.329.0
RUNNER_CONTAINER_HOOKS_VERSION=0.7.0 RUNNER_CONTAINER_HOOKS_VERSION=0.8.0

View File

@@ -36,8 +36,8 @@ var (
testResultCMNamePrefix = "test-result-" testResultCMNamePrefix = "test-result-"
RunnerVersion = "2.328.0" RunnerVersion = "2.329.0"
RunnerContainerHooksVersion = "0.7.0" RunnerContainerHooksVersion = "0.8.0"
) )
// If you're willing to run this test via VS Code "run test" or "debug test", // If you're willing to run this test via VS Code "run test" or "debug test",