Skip to content

Commit

Permalink
Make Runner{Deployment,ReplicaSet} replicas actually optional (#186)
Browse files Browse the repository at this point in the history
If omitted, it properly defaults to 1.

Fixes #64
  • Loading branch information
mumoshu authored Nov 14, 2020
1 parent 9a22bb5 commit 1658f51
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion acceptance/testdata/runnerdeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: RunnerDeployment
metadata:
name: example-runnerdeploy
spec:
replicas: 1
# replicas: 1
template:
spec:
repository: mumoshu/actions-runner-controller-ci
1 change: 1 addition & 0 deletions api/v1alpha1/runnerdeployment_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
// RunnerReplicaSetSpec defines the desired state of RunnerDeployment
type RunnerDeploymentSpec struct {
// +optional
// +nullable
Replicas *int `json:"replicas,omitempty"`

Template RunnerTemplate `json:"template"`
Expand Down
4 changes: 3 additions & 1 deletion api/v1alpha1/runnerreplicaset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import (

// RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet
type RunnerReplicaSetSpec struct {
Replicas *int `json:"replicas"`
// +optional
// +nullable
Replicas *int `json:"replicas,omitempty"`

Template RunnerTemplate `json:"template"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
description: RunnerReplicaSetSpec defines the desired state of RunnerDeployment
properties:
replicas:
nullable: true
type: integer
template:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
description: RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet
properties:
replicas:
nullable: true
type: integer
template:
properties:
Expand Down Expand Up @@ -1533,7 +1534,6 @@ spec:
type: object
type: object
required:
- replicas
- template
type: object
status:
Expand Down

0 comments on commit 1658f51

Please sign in to comment.