Add multi-label support to scalesets#4408
Conversation
|
Hello! Thank you for your contribution. Please review our contribution guidelines to understand the project's testing and code conventions. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for configuring multiple runner scale set labels via the AutoscalingRunnerSet spec and Helm chart values, and passes those labels through when creating the GitHub Runner Scale Set.
Changes:
- Extend the AutoscalingRunnerSet API/CRDs with
runnerScaleSetLabels: []string. - Update the controller to include user-provided labels when creating a Runner Scale Set (with de-duplication).
- Add Helm values/templates + chart tests and introduce E2E scripts to validate custom label behavior (stable + experimental charts).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/actions.github.com/custom-label-setup.test.sh | New E2E script to install a scale set with a custom label and verify it on the CR. |
| test/actions.github.com/custom-label-setup-v2.test.sh | Same E2E coverage for the experimental controller/chart. |
| controllers/actions.github.com/autoscalingrunnerset_controller.go | Build Labels payload from spec.runnerScaleSetLabels when creating scale sets. |
| config/crd/bases/actions.github.com_autoscalingrunnersets.yaml | Add CRD schema for runnerScaleSetLabels. |
| charts/gha-runner-scale-set/values.yaml | Add scaleSetLabels values entry. |
| charts/gha-runner-scale-set/templates/autoscalingrunnerset.yaml | Render spec.runnerScaleSetLabels from Helm values. |
| charts/gha-runner-scale-set/tests/template_test.go | Add a Go-based Helm render test for labels rendering. |
| charts/gha-runner-scale-set-experimental/values.yaml | Add scaleset.labels values entry + docs. |
| charts/gha-runner-scale-set-experimental/templates/autoscalingrunnserset.yaml | Render spec.runnerScaleSetLabels from experimental Helm values. |
| charts/gha-runner-scale-set-experimental/tests/autoscaling_runner_set_scale_set_labels_test.yaml | Add helm-unittest coverage for experimental label rendering. |
| charts/*/crds/actions.github.com_autoscalingrunnersets.yaml | Update packaged CRDs to include runnerScaleSetLabels. |
| apis/actions.github.com/v1alpha1/* | Add API field + deepcopy support for RunnerScaleSetLabels. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| if _, exists := unique[label]; exists { | ||
| logger.Info("Duplicate label found. Skipping adding duplicate label to runner scale set", "label", label) | ||
| continue | ||
| } | ||
| labels = append(labels, scaleset.Label{ | ||
| Name: label, | ||
| Type: "System", | ||
| }) | ||
| unique[label] = true |
| labels := []scaleset.Label{ | ||
| { | ||
| Name: autoscalingRunnerSet.Spec.RunnerScaleSetName, | ||
| Type: "System", | ||
| }, | ||
| } |
|
Hi, probably this is not the best place to ask this question. I'm happy to move it elsewhere if you'd prefer. Was there a reason for choosing |
Add support for scaleset to set multiple labels similar to the runner: https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/apply-labels