INNER CODE UNIT · Go
from
evryfs/github-actions-runner-operator · controllers/podrunner_types.go:30
func from(podList *corev1.PodList, runners []*github.Runner) podRunnerPairList {
runnersByName := make(map[string]github.Runner)
for _, runner := range runners {
runnersByName[runner.GetName()] = *runner
}
podRunnerPairs := podRunnerPairList{
podList: *podList,
runners: runners,
}
for _, pod := range podList.Items {
pair := podRunnerPair{
pod: pod,
runner: runnersByName[pod.Name],
}
podRunnerPairs.pairs = append(podRunnerPairs.pairs, pair)
}