From 584745b67d8ce706ee27429f5c975175a6643d1c Mon Sep 17 00:00:00 2001 From: Felipe Galindo Sanchez Date: Tue, 12 Jul 2022 15:48:46 -0700 Subject: [PATCH] Minor improvements for runner groups - Add group in runners columns - Add constant for runner group and labels --- api/v1alpha1/runner_types.go | 1 + .../crds/actions.summerwind.dev_runners.yaml | 3 +++ config/crd/bases/actions.summerwind.dev_runners.yaml | 3 +++ controllers/runner_controller.go | 6 ++++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/runner_types.go b/api/v1alpha1/runner_types.go index 6e6123c5..38b4d8e6 100644 --- a/api/v1alpha1/runner_types.go +++ b/api/v1alpha1/runner_types.go @@ -309,6 +309,7 @@ func (w *WorkVolumeClaimTemplate) V1VolumeMount(mountPath string) corev1.VolumeM // +kubebuilder:printcolumn:JSONPath=".spec.enterprise",name=Enterprise,type=string // +kubebuilder:printcolumn:JSONPath=".spec.organization",name=Organization,type=string // +kubebuilder:printcolumn:JSONPath=".spec.repository",name=Repository,type=string +// +kubebuilder:printcolumn:JSONPath=".spec.group",name=Group,type=string // +kubebuilder:printcolumn:JSONPath=".spec.labels",name=Labels,type=string // +kubebuilder:printcolumn:JSONPath=".status.phase",name=Status,type=string // +kubebuilder:printcolumn:JSONPath=".status.message",name=Message,type=string diff --git a/charts/actions-runner-controller/crds/actions.summerwind.dev_runners.yaml b/charts/actions-runner-controller/crds/actions.summerwind.dev_runners.yaml index ed40cc27..7a3aaad6 100644 --- a/charts/actions-runner-controller/crds/actions.summerwind.dev_runners.yaml +++ b/charts/actions-runner-controller/crds/actions.summerwind.dev_runners.yaml @@ -24,6 +24,9 @@ spec: - jsonPath: .spec.repository name: Repository type: string + - jsonPath: .spec.group + name: Group + type: string - jsonPath: .spec.labels name: Labels type: string diff --git a/config/crd/bases/actions.summerwind.dev_runners.yaml b/config/crd/bases/actions.summerwind.dev_runners.yaml index ed40cc27..7a3aaad6 100644 --- a/config/crd/bases/actions.summerwind.dev_runners.yaml +++ b/config/crd/bases/actions.summerwind.dev_runners.yaml @@ -24,6 +24,9 @@ spec: - jsonPath: .spec.repository name: Repository type: string + - jsonPath: .spec.group + name: Group + type: string - jsonPath: .spec.labels name: Labels type: string diff --git a/controllers/runner_controller.go b/controllers/runner_controller.go index 2cd6a058..4a2f798d 100644 --- a/controllers/runner_controller.go +++ b/controllers/runner_controller.go @@ -52,6 +52,8 @@ const ( EnvVarOrg = "RUNNER_ORG" EnvVarRepo = "RUNNER_REPO" + EnvVarGroup = "RUNNER_GROUP" + EnvVarLabels = "RUNNER_LABELS" EnvVarEnterprise = "RUNNER_ENTERPRISE" EnvVarEphemeral = "RUNNER_EPHEMERAL" EnvVarTrue = "true" @@ -772,11 +774,11 @@ func newRunnerPodWithContainerMode(containerMode string, template corev1.Pod, ru Value: runnerSpec.Enterprise, }, { - Name: "RUNNER_LABELS", + Name: EnvVarLabels, Value: strings.Join(runnerSpec.Labels, ","), }, { - Name: "RUNNER_GROUP", + Name: EnvVarGroup, Value: runnerSpec.Group, }, {