support runner labels

This commit is contained in:
Reinier Timmer
2020-04-24 11:29:52 +02:00
parent 2567f6ee4e
commit 8c5b776807
7 changed files with 45 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import (
"context"
"fmt"
"reflect"
"strings"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/api/errors"
@@ -119,6 +120,7 @@ func (r *RunnerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
updated.Status.Registration = v1alpha1.RunnerStatusRegistration{
Organization: runner.Spec.Organization,
Repository: runner.Spec.Repository,
Labels: runner.Spec.Labels,
Token: rt.GetToken(),
ExpiresAt: metav1.NewTime(rt.GetExpiresAt().Time),
}
@@ -262,6 +264,10 @@ func (r *RunnerReconciler) newPod(runner v1alpha1.Runner) (corev1.Pod, error) {
Name: "RUNNER_REPO",
Value: runner.Spec.Repository,
},
{
Name: "RUNNER_LABELS",
Value: strings.Join(runner.Spec.Labels, ","),
},
{
Name: "RUNNER_TOKEN",
Value: runner.Status.Registration.Token,