Make Runner{Deployment,ReplicaSet} replicas actually optional (#186)
If omitted, it properly defaults to 1. Fixes #64
This commit is contained in:
		
							parent
							
								
									9a22bb5086
								
							
						
					
					
						commit
						1658f51fcb
					
				|  | @ -3,7 +3,7 @@ kind: RunnerDeployment | ||||||
| metadata: | metadata: | ||||||
|   name: example-runnerdeploy |   name: example-runnerdeploy | ||||||
| spec: | spec: | ||||||
|   replicas: 1 | #  replicas: 1 | ||||||
|   template: |   template: | ||||||
|     spec: |     spec: | ||||||
|       repository: mumoshu/actions-runner-controller-ci |       repository: mumoshu/actions-runner-controller-ci | ||||||
|  |  | ||||||
|  | @ -27,6 +27,7 @@ const ( | ||||||
| // RunnerReplicaSetSpec defines the desired state of RunnerDeployment
 | // RunnerReplicaSetSpec defines the desired state of RunnerDeployment
 | ||||||
| type RunnerDeploymentSpec struct { | type RunnerDeploymentSpec struct { | ||||||
| 	// +optional
 | 	// +optional
 | ||||||
|  | 	// +nullable
 | ||||||
| 	Replicas *int `json:"replicas,omitempty"` | 	Replicas *int `json:"replicas,omitempty"` | ||||||
| 
 | 
 | ||||||
| 	Template RunnerTemplate `json:"template"` | 	Template RunnerTemplate `json:"template"` | ||||||
|  |  | ||||||
|  | @ -22,7 +22,9 @@ import ( | ||||||
| 
 | 
 | ||||||
| // RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet
 | // RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet
 | ||||||
| type RunnerReplicaSetSpec struct { | type RunnerReplicaSetSpec struct { | ||||||
| 	Replicas *int `json:"replicas"` | 	// +optional
 | ||||||
|  | 	// +nullable
 | ||||||
|  | 	Replicas *int `json:"replicas,omitempty"` | ||||||
| 
 | 
 | ||||||
| 	Template RunnerTemplate `json:"template"` | 	Template RunnerTemplate `json:"template"` | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -41,6 +41,7 @@ spec: | ||||||
|           description: RunnerReplicaSetSpec defines the desired state of RunnerDeployment |           description: RunnerReplicaSetSpec defines the desired state of RunnerDeployment | ||||||
|           properties: |           properties: | ||||||
|             replicas: |             replicas: | ||||||
|  |               nullable: true | ||||||
|               type: integer |               type: integer | ||||||
|             template: |             template: | ||||||
|               properties: |               properties: | ||||||
|  |  | ||||||
|  | @ -41,6 +41,7 @@ spec: | ||||||
|           description: RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet |           description: RunnerReplicaSetSpec defines the desired state of RunnerReplicaSet | ||||||
|           properties: |           properties: | ||||||
|             replicas: |             replicas: | ||||||
|  |               nullable: true | ||||||
|               type: integer |               type: integer | ||||||
|             template: |             template: | ||||||
|               properties: |               properties: | ||||||
|  | @ -1533,7 +1534,6 @@ spec: | ||||||
|                   type: object |                   type: object | ||||||
|               type: object |               type: object | ||||||
|           required: |           required: | ||||||
|             - replicas |  | ||||||
|             - template |             - template | ||||||
|           type: object |           type: object | ||||||
|         status: |         status: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue