mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 11:41:27 +00:00
Co-authored-by: Cory Miller <cory-miller@github.com> Co-authored-by: Nikola Jokic <nikola-jokic@github.com> Co-authored-by: Ava Stancu <AvaStancu@github.com> Co-authored-by: Ferenc Hammerl <fhammerl@github.com> Co-authored-by: Francesco Renzi <rentziass@github.com> Co-authored-by: Bassem Dghaidi <Link-@github.com>
28 lines
500 B
Go
28 lines
500 B
Go
package actionsgithubcom
|
|
|
|
import (
|
|
"k8s.io/apimachinery/pkg/util/rand"
|
|
)
|
|
|
|
func FilterLabels(labels map[string]string, filter string) map[string]string {
|
|
filtered := map[string]string{}
|
|
|
|
for k, v := range labels {
|
|
if k != filter {
|
|
filtered[k] = v
|
|
}
|
|
}
|
|
|
|
return filtered
|
|
}
|
|
|
|
var letterRunes = []rune("abcdefghijklmnopqrstuvwxyz1234567890")
|
|
|
|
func RandStringRunes(n int) string {
|
|
b := make([]rune, n)
|
|
for i := range b {
|
|
b[i] = letterRunes[rand.Intn(len(letterRunes))]
|
|
}
|
|
return string(b)
|
|
}
|