You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-16 08:46:30 +02:00
fix: changed schema definition for "backend_options.kubernetes.tolerations" to accept an array of objects (#5478)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
steps:
|
||||
build:
|
||||
image: golang
|
||||
commands:
|
||||
- go build
|
||||
- go test
|
||||
backend_options:
|
||||
kubernetes:
|
||||
tolerations:
|
||||
- key: 'partial-object'
|
||||
operator: 'Equal'
|
||||
value: 'pipeline'
|
||||
effect: 'NoSchedule'
|
||||
- key: 'complete-object'
|
||||
operator: 'Equal'
|
||||
value: 'pipeline'
|
||||
effect: 'NoSchedule'
|
||||
tolerationSeconds: 10
|
@@ -647,10 +647,12 @@
|
||||
}
|
||||
},
|
||||
"tolerations": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": ["boolean", "string", "number"]
|
||||
}
|
||||
"description": "The tolerations section defines a list of references to the native Kubernetes tolerations. Read more: https://woodpecker-ci.org/docs/administration/configuration/backends/kubernetes#tolerations",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/step_backend_kubernetes_toleration_object"
|
||||
},
|
||||
"minLength": 1
|
||||
},
|
||||
"securityContext": {
|
||||
"$ref": "#/definitions/step_backend_kubernetes_security_context"
|
||||
@@ -789,6 +791,27 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"step_backend_kubernetes_toleration_object": {
|
||||
"description": "Toleration entry for the kubernetes backend.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string"
|
||||
},
|
||||
"operator": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
},
|
||||
"effect": {
|
||||
"type": "string"
|
||||
},
|
||||
"tolerationSeconds": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"description": "Read more: https://woodpecker-ci.org/docs/usage/services",
|
||||
"oneOf": [
|
||||
|
@@ -114,6 +114,11 @@ func TestSchema(t *testing.T) {
|
||||
testFile: ".woodpecker/test-broken-plugin2.yaml",
|
||||
fail: true,
|
||||
},
|
||||
{
|
||||
name: "Kubernetes backend tolerations",
|
||||
testFile: ".woodpecker/test-kubernetes-backend-tolerations.yaml",
|
||||
fail: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range testTable {
|
||||
|
Reference in New Issue
Block a user