From 3d73636407b042fcef496df91763ef15dbac7042 Mon Sep 17 00:00:00 2001 From: Nikola Jokic Date: Mon, 10 Nov 2025 13:58:16 +0100 Subject: [PATCH] Use combination of namespace, GitHub URL, and runner group when hashing the listener name (#4299) --- .../actions.github.com/resourcebuilder.go | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/controllers/actions.github.com/resourcebuilder.go b/controllers/actions.github.com/resourcebuilder.go index 39e17350..6b9ef880 100644 --- a/controllers/actions.github.com/resourcebuilder.go +++ b/controllers/actions.github.com/resourcebuilder.go @@ -690,20 +690,28 @@ func scaleSetListenerConfigName(autoscalingListener *v1alpha1.AutoscalingListene return fmt.Sprintf("%s-config", autoscalingListener.Name) } -func scaleSetListenerName(autoscalingRunnerSet *v1alpha1.AutoscalingRunnerSet) string { - namespaceHash := hash.FNVHashString(autoscalingRunnerSet.Namespace) +func hashSuffix(namespace, runnerGroup, configURL string) string { + namespaceHash := hash.FNVHashString(namespace + "@" + runnerGroup + "@" + configURL) if len(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 { - namespaceHash := hash.FNVHashString(autoscalingListener.Spec.AutoscalingRunnerSetNamespace) - if len(namespaceHash) > 8 { - namespaceHash = namespaceHash[:8] - } - return fmt.Sprintf("%v-%v-listener-proxy", autoscalingListener.Spec.AutoscalingRunnerSetName, namespaceHash) + return autoscalingListener.Name + "-proxy" } func proxyEphemeralRunnerSetSecretName(ephemeralRunnerSet *v1alpha1.EphemeralRunnerSet) string {