mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Refactoring listener app with configurable fallback (#3096)
This commit is contained in:
@@ -38,8 +38,11 @@ var commonLabelKeys = [...]string{
|
||||
|
||||
const labelValueKubernetesPartOf = "gha-runner-scale-set"
|
||||
|
||||
var scaleSetListenerLogLevel = DefaultScaleSetListenerLogLevel
|
||||
var scaleSetListenerLogFormat = DefaultScaleSetListenerLogFormat
|
||||
var (
|
||||
scaleSetListenerLogLevel = DefaultScaleSetListenerLogLevel
|
||||
scaleSetListenerLogFormat = DefaultScaleSetListenerLogFormat
|
||||
scaleSetListenerEntrypoint = "/ghalistener"
|
||||
)
|
||||
|
||||
func SetListenerLoggingParameters(level string, format string) bool {
|
||||
switch level {
|
||||
@@ -59,6 +62,12 @@ func SetListenerLoggingParameters(level string, format string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func SetListenerEntrypoint(entrypoint string) {
|
||||
if entrypoint != "" {
|
||||
scaleSetListenerEntrypoint = entrypoint
|
||||
}
|
||||
}
|
||||
|
||||
type resourceBuilder struct{}
|
||||
|
||||
func (b *resourceBuilder) newAutoScalingListener(autoscalingRunnerSet *v1alpha1.AutoscalingRunnerSet, ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet, namespace, image string, imagePullSecrets []corev1.LocalObjectReference) (*v1alpha1.AutoscalingListener, error) {
|
||||
@@ -225,7 +234,7 @@ func (b *resourceBuilder) newScaleSetListenerPod(autoscalingListener *v1alpha1.A
|
||||
Image: autoscalingListener.Spec.Image,
|
||||
Env: listenerEnv,
|
||||
Command: []string{
|
||||
"/github-runnerscaleset-listener",
|
||||
scaleSetListenerEntrypoint,
|
||||
},
|
||||
Ports: ports,
|
||||
VolumeMounts: []corev1.VolumeMount{
|
||||
|
||||
Reference in New Issue
Block a user