Files
actions-runner-controller/controllers/actions.github.com/utils.go
T
622eaa34f8 Introduce new preview auto-scaling mode for ARC. (#2153)
Co-authored-by: Cory Miller <[email protected]>
Co-authored-by: Nikola Jokic <[email protected]>
Co-authored-by: Ava Stancu <[email protected]>
Co-authored-by: Ferenc Hammerl <[email protected]>
Co-authored-by: Francesco Renzi <[email protected]>
Co-authored-by: Bassem Dghaidi <[email protected]>
2023-01-17 12:06:20 -05:00

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)
}