mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-10-01 01:01:35 +02:00
fix min/max runners
This commit is contained in:
@@ -31,7 +31,7 @@ type AutoscalingListenerSpec struct {
|
||||
GitHubConfigSecret string `json:"githubConfigSecret,omitempty"`
|
||||
|
||||
// +required
|
||||
// +kubebuilder:validation:Minimum=1
|
||||
// +kubebuilder:validation:Minimum:=1
|
||||
RunnerScaleSetID int `json:"runnerScaleSetId,omitempty"`
|
||||
|
||||
// +required
|
||||
@@ -43,13 +43,13 @@ type AutoscalingListenerSpec struct {
|
||||
// +required
|
||||
EphemeralRunnerSetName string `json:"ephemeralRunnerSetName,omitempty"`
|
||||
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +kubebuilder:validation:Minimum:=0
|
||||
// +required
|
||||
MaxRunners int `json:"maxRunners,omitempty"`
|
||||
MaxRunners int `json:"maxRunners"`
|
||||
|
||||
// +kubebuilder:validation:Minimum=0
|
||||
// +kubebuilder:validation:Minimum:=0
|
||||
// +required
|
||||
MinRunners int `json:"minRunners,omitempty"`
|
||||
MinRunners int `json:"minRunners"`
|
||||
|
||||
// +required
|
||||
Image string `json:"image,omitempty"`
|
||||
|
||||
@@ -122,13 +122,14 @@ func (b *ResourceBuilder) newAutoscalingListener(autoscalingRunnerSet *v1alpha1.
|
||||
}
|
||||
|
||||
effectiveMinRunners := 0
|
||||
if autoscalingRunnerSet.Spec.MinRunners != nil {
|
||||
effectiveMinRunners = *autoscalingRunnerSet.Spec.MinRunners
|
||||
}
|
||||
|
||||
effectiveMaxRunners := math.MaxInt32
|
||||
if autoscalingRunnerSet.Spec.MaxRunners != nil {
|
||||
effectiveMaxRunners = *autoscalingRunnerSet.Spec.MaxRunners
|
||||
}
|
||||
if autoscalingRunnerSet.Spec.MinRunners != nil {
|
||||
effectiveMinRunners = *autoscalingRunnerSet.Spec.MinRunners
|
||||
}
|
||||
|
||||
spec := v1alpha1.AutoscalingListenerSpec{
|
||||
GitHubConfigURL: autoscalingRunnerSet.Spec.GitHubConfigUrl,
|
||||
|
||||
Reference in New Issue
Block a user