Compare commits
4 Commits
gha-runner
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
91d45d870a | |
|
|
4d22089978 | |
|
|
8007b8af25 | |
|
|
0baa4f6b09 |
|
|
@ -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,10 +17,10 @@ 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.
|
||||||
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
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
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) {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
@ -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",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue