mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-11 12:06:57 +00:00
Use combination of namespace, GitHub URL, and runner group when hashing the listener name (#4299)
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user