mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Compare commits
11 Commits
gha-runner
...
51023ade49
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51023ade49 | ||
|
|
4615321588 | ||
|
|
9f9409a4c1 | ||
|
|
3d73636407 | ||
|
|
722c6e9edd | ||
|
|
dcb45f0617 | ||
|
|
dbac55ca9e | ||
|
|
91d45d870a | ||
|
|
4d22089978 | ||
|
|
8007b8af25 | ||
|
|
0baa4f6b09 |
4
.github/workflows/arc-publish-chart.yaml
vendored
4
.github/workflows/arc-publish-chart.yaml
vendored
@@ -63,7 +63,7 @@ jobs:
|
|||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
|
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
@@ -79,7 +79,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create kind cluster
|
- name: Create kind cluster
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab
|
||||||
|
|
||||||
# We need cert-manager already installed in the cluster because we assume the CRDs exist
|
# We need cert-manager already installed in the cluster because we assume the CRDs exist
|
||||||
- name: Install cert-manager
|
- name: Install cert-manager
|
||||||
|
|||||||
4
.github/workflows/arc-release-runners.yaml
vendored
4
.github/workflows/arc-release-runners.yaml
vendored
@@ -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
|
||||||
@@ -17,7 +19,7 @@ env:
|
|||||||
PUSH_TO_REGISTRIES: true
|
PUSH_TO_REGISTRIES: true
|
||||||
TARGET_ORG: actions-runner-controller
|
TARGET_ORG: actions-runner-controller
|
||||||
TARGET_WORKFLOW: release-runners.yaml
|
TARGET_WORKFLOW: release-runners.yaml
|
||||||
DOCKER_VERSION: 24.0.7
|
DOCKER_VERSION: 28.0.4
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}
|
group: ${{ github.workflow }}
|
||||||
|
|||||||
4
.github/workflows/arc-validate-chart.yaml
vendored
4
.github/workflows/arc-validate-chart.yaml
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
|
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
ct lint --config charts/.ci/ct-config.yaml
|
ct lint --config charts/.ci/ct-config.yaml
|
||||||
|
|
||||||
- name: Create kind cluster
|
- name: Create kind cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
|
|
||||||
# We need cert-manager already installed in the cluster because we assume the CRDs exist
|
# We need cert-manager already installed in the cluster because we assume the CRDs exist
|
||||||
|
|||||||
2
.github/workflows/gha-e2e-tests.yaml
vendored
2
.github/workflows/gha-e2e-tests.yaml
vendored
@@ -984,7 +984,7 @@ jobs:
|
|||||||
echo "5 pods are up!"
|
echo "5 pods are up!"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [[ "$count" -ge 12 ]]; then
|
if [[ "$count" -ge 30 ]]; then
|
||||||
echo "Timeout waiting for 5 pods to be created"
|
echo "Timeout waiting for 5 pods to be created"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
2
.github/workflows/gha-publish-chart.yaml
vendored
2
.github/workflows/gha-publish-chart.yaml
vendored
@@ -72,7 +72,7 @@ jobs:
|
|||||||
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
||||||
|
|||||||
4
.github/workflows/gha-validate-chart.yaml
vendored
4
.github/workflows/gha-validate-chart.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
|||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
- name: Set up chart-testing
|
- name: Set up chart-testing
|
||||||
uses: helm/chart-testing-action@0d28d3144d3a25ea2cc349d6e59901c4ff469b3b
|
uses: helm/chart-testing-action@6ec842c01de15ebb84c8627d2744a0c2f2755c9f
|
||||||
|
|
||||||
- name: Run chart-testing (list-changed)
|
- name: Run chart-testing (list-changed)
|
||||||
id: list-changed
|
id: list-changed
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Create kind cluster
|
- name: Create kind cluster
|
||||||
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3
|
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab
|
||||||
if: steps.list-changed.outputs.changed == 'true'
|
if: steps.list-changed.outputs.changed == 'true'
|
||||||
with:
|
with:
|
||||||
cluster_name: chart-testing
|
cluster_name: chart-testing
|
||||||
|
|||||||
2
.github/workflows/global-publish-canary.yaml
vendored
2
.github/workflows/global-publish-canary.yaml
vendored
@@ -110,7 +110,7 @@ jobs:
|
|||||||
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
echo "repository_owner=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435
|
||||||
|
|||||||
6
.github/workflows/global-run-codeql.yaml
vendored
6
.github/workflows/global-run-codeql.yaml
vendored
@@ -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
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
4
.github/workflows/go.yaml
vendored
4
.github/workflows/go.yaml
vendored
@@ -48,7 +48,7 @@ jobs:
|
|||||||
go-version-file: "go.mod"
|
go-version-file: "go.mod"
|
||||||
cache: false
|
cache: false
|
||||||
- name: golangci-lint
|
- name: golangci-lint
|
||||||
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
|
uses: golangci/golangci-lint-action@0a35821d5c230e903fcfe077583637dea1b27b47
|
||||||
with:
|
with:
|
||||||
only-new-issues: true
|
only-new-issues: true
|
||||||
version: v2.5.0
|
version: v2.5.0
|
||||||
@@ -78,7 +78,7 @@ jobs:
|
|||||||
run: git diff --exit-code
|
run: git diff --exit-code
|
||||||
- name: Install kubebuilder
|
- name: Install kubebuilder
|
||||||
run: |
|
run: |
|
||||||
curl -D headers.txt -fsL "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-1.26.1-linux-amd64.tar.gz" -o kubebuilder-tools
|
curl -D headers.txt -fsL "https://storage.googleapis.com/kubebuilder-tools/kubebuilder-tools-1.30.0-linux-amd64.tar.gz" -o kubebuilder-tools
|
||||||
echo "$(grep -i etag headers.txt -m 1 | cut -d'"' -f2) kubebuilder-tools" > sum
|
echo "$(grep -i etag headers.txt -m 1 | cut -d'"' -f2) kubebuilder-tools" > sum
|
||||||
md5sum -c sum
|
md5sum -c sum
|
||||||
tar -zvxf kubebuilder-tools
|
tar -zvxf kubebuilder-tools
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -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))
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/actions/actions-runner-controller/apis/actions.github.com/v1alpha1"
|
"github.com/actions/actions-runner-controller/apis/actions.github.com/v1alpha1"
|
||||||
@@ -282,7 +283,34 @@ func (r *EphemeralRunnerReconciler) Reconcile(ctx context.Context, req ctrl.Requ
|
|||||||
case kerrors.IsAlreadyExists(err):
|
case kerrors.IsAlreadyExists(err):
|
||||||
log.Info("Runner pod already exists. Waiting for the pod event to be received")
|
log.Info("Runner pod already exists. Waiting for the pod event to be received")
|
||||||
return ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Second}, nil
|
return ctrl.Result{Requeue: true, RequeueAfter: 5 * time.Second}, nil
|
||||||
case kerrors.IsInvalid(err) || kerrors.IsForbidden(err):
|
case kerrors.IsInvalid(err):
|
||||||
|
log.Error(err, "Failed to create a pod due to unrecoverable failure")
|
||||||
|
errMessage := fmt.Sprintf("Failed to create the pod: %v", err)
|
||||||
|
if err := r.markAsFailed(ctx, ephemeralRunner, errMessage, ReasonInvalidPodFailure, log); err != nil {
|
||||||
|
log.Error(err, "Failed to set ephemeral runner to phase Failed")
|
||||||
|
return ctrl.Result{}, err
|
||||||
|
}
|
||||||
|
return ctrl.Result{}, nil
|
||||||
|
case kerrors.IsForbidden(err):
|
||||||
|
if status, ok := err.(kerrors.APIStatus); ok || errors.As(err, &status) {
|
||||||
|
isResourceQuotaExceeded := strings.Contains(status.Status().Message, "exceeded quota:")
|
||||||
|
isAboutToExpire := ephemeralRunner.CreationTimestamp.Time.Add(10 * time.Minute).Before(time.Now())
|
||||||
|
switch {
|
||||||
|
case isResourceQuotaExceeded && isAboutToExpire:
|
||||||
|
log.Error(err, "Failed to create a pod due to resource quota exceeded and the ephemeral runner is about to expire; re-creating the ephemeral runner")
|
||||||
|
if err := r.Delete(ctx, ephemeralRunner); err != nil {
|
||||||
|
log.Error(err, "Failed to delete the ephemeral runner")
|
||||||
|
return ctrl.Result{}, err
|
||||||
|
}
|
||||||
|
return ctrl.Result{}, nil
|
||||||
|
case isResourceQuotaExceeded:
|
||||||
|
log.Error(err, "Resource quota is exceeded; requeue in 30s to retry pod creation")
|
||||||
|
return ctrl.Result{RequeueAfter: 30 * time.Second}, nil
|
||||||
|
default:
|
||||||
|
// other forbidden errors
|
||||||
|
// fallthrough to the default handling below
|
||||||
|
}
|
||||||
|
}
|
||||||
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.markAsFailed(ctx, ephemeralRunner, errMessage, ReasonInvalidPodFailure, log); err != nil {
|
||||||
|
|||||||
@@ -690,20 +690,28 @@ func scaleSetListenerConfigName(autoscalingListener *v1alpha1.AutoscalingListene
|
|||||||
return fmt.Sprintf("%s-config", autoscalingListener.Name)
|
return fmt.Sprintf("%s-config", autoscalingListener.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func scaleSetListenerName(autoscalingRunnerSet *v1alpha1.AutoscalingRunnerSet) string {
|
func hashSuffix(namespace, runnerGroup, configURL string) string {
|
||||||
namespaceHash := hash.FNVHashString(autoscalingRunnerSet.Namespace)
|
namespaceHash := hash.FNVHashString(namespace + "@" + runnerGroup + "@" + configURL)
|
||||||
if len(namespaceHash) > 8 {
|
if len(namespaceHash) > 8 {
|
||||||
namespaceHash = namespaceHash[:8]
|
namespaceHash = namespaceHash[:8]
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%v-%v-listener", autoscalingRunnerSet.Name, namespaceHash)
|
return namespaceHash
|
||||||
|
}
|
||||||
|
|
||||||
|
func scaleSetListenerName(autoscalingRunnerSet *v1alpha1.AutoscalingRunnerSet) string {
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"%v-%v-listener",
|
||||||
|
autoscalingRunnerSet.Name,
|
||||||
|
hashSuffix(
|
||||||
|
autoscalingRunnerSet.Namespace,
|
||||||
|
autoscalingRunnerSet.Spec.RunnerGroup,
|
||||||
|
autoscalingRunnerSet.Spec.GitHubConfigUrl,
|
||||||
|
),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func proxyListenerSecretName(autoscalingListener *v1alpha1.AutoscalingListener) string {
|
func proxyListenerSecretName(autoscalingListener *v1alpha1.AutoscalingListener) string {
|
||||||
namespaceHash := hash.FNVHashString(autoscalingListener.Spec.AutoscalingRunnerSetNamespace)
|
return autoscalingListener.Name + "-proxy"
|
||||||
if len(namespaceHash) > 8 {
|
|
||||||
namespaceHash = namespaceHash[:8]
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%v-%v-listener-proxy", autoscalingListener.Spec.AutoscalingRunnerSetName, namespaceHash)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func proxyEphemeralRunnerSetSecretName(ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet) string {
|
func proxyEphemeralRunnerSetSecretName(ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet) string {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ 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 ?= 28.0.4
|
||||||
|
|
||||||
# default list of platforms for which multiarch image is built
|
# default list of platforms for which multiarch image is built
|
||||||
ifeq (${PLATFORMS}, )
|
ifeq (${PLATFORMS}, )
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -5,7 +5,7 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ENV CHANNEL=stable
|
ENV CHANNEL=stable
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
|
|
||||||
# Other arguments
|
# Other arguments
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ENV CHANNEL=stable
|
ENV CHANNEL=stable
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ENV CHANNEL=stable
|
ENV CHANNEL=stable
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
|
|
||||||
# Use 1001 and 121 for compatibility with GitHub-hosted runners
|
# Use 1001 and 121 for compatibility with GitHub-hosted runners
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
ARG DOCKER_GROUP_GID=121
|
ARG DOCKER_GROUP_GID=121
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
ARG DOCKER_GROUP_GID=121
|
ARG DOCKER_GROUP_GID=121
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
|
|
||||||
# Use 1001 and 121 for compatibility with GitHub-hosted runners
|
# Use 1001 and 121 for compatibility with GitHub-hosted runners
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
ARG DOCKER_GROUP_GID=121
|
ARG DOCKER_GROUP_GID=121
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ ARG RUNNER_VERSION
|
|||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
ARG RUNNER_CONTAINER_HOOKS_VERSION
|
||||||
# Docker and Docker Compose arguments
|
# Docker and Docker Compose arguments
|
||||||
ARG CHANNEL=stable
|
ARG CHANNEL=stable
|
||||||
ARG DOCKER_VERSION=24.0.7
|
ARG DOCKER_VERSION=28.0.4
|
||||||
ARG DOCKER_COMPOSE_VERSION=v2.23.0
|
ARG DOCKER_COMPOSE_VERSION=v2.38.2
|
||||||
ARG DUMB_INIT_VERSION=1.2.5
|
ARG DUMB_INIT_VERSION=1.2.5
|
||||||
ARG RUNNER_USER_UID=1001
|
ARG RUNNER_USER_UID=1001
|
||||||
ARG DOCKER_GROUP_GID=121
|
ARG DOCKER_GROUP_GID=121
|
||||||
|
|||||||
@@ -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",
|
||||||
@@ -455,7 +455,7 @@ func buildVars(repo, ubuntuVer string) vars {
|
|||||||
runnerRootlessDindImage = testing.Img(runnerRootlessDindImageRepo, runnerImageTag)
|
runnerRootlessDindImage = testing.Img(runnerRootlessDindImageRepo, runnerImageTag)
|
||||||
|
|
||||||
dindSidecarImageRepo = "docker"
|
dindSidecarImageRepo = "docker"
|
||||||
dindSidecarImageTag = "24.0.7-dind"
|
dindSidecarImageTag = "28.0.4-dind"
|
||||||
dindSidecarImage = testing.Img(dindSidecarImageRepo, dindSidecarImageTag)
|
dindSidecarImage = testing.Img(dindSidecarImageRepo, dindSidecarImageTag)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user