Skip to content

Commit effa09e

Browse files
Add Zuul.Executor.Zone attribute
This change enables configuring an executor zone. Change-Id: Ida9ec1a9f1d6af2788fa6514c5bb558b89488f64
1 parent 3097c5c commit effa09e

6 files changed

Lines changed: 15 additions & 0 deletions

File tree

api/v1/softwarefactory_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ type ZuulExecutorSpec struct {
305305
// +kubebuilder:default:=60
306306
// +kubebuilder:validation:Minimum:=0
307307
AnsibleSetupTimeout int `json:"ansibleSetupTimeout,omitempty"`
308+
// The (optional) nodepool [executor-zone](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.zone) setting
309+
Zone string `json:"zone,omitempty"`
308310
// +kubebuilder:default:=7200
309311
// +kubebuilder:validation:Minimum:=1
310312
TerminationGracePeriodSeconds int64 `json:"TerminationGracePeriodSeconds,omitempty"`

config/crd/bases/sf.softwarefactory-project.io_softwarefactories.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,10 @@ spec:
677677
required:
678678
- size
679679
type: object
680+
zone:
681+
description: The (optional) nodepool [executor-zone](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.zone)
682+
setting
683+
type: string
680684
type: object
681685
gerritconns:
682686
description: The list of Gerrit-based connections to add to Zuul's

controllers/zuul.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ func (r *SFController) EnsureZuulConfigSecret(remoteExecutor bool) *ini.File {
10161016
ansibleSetupTimeout := int(r.cr.Spec.Zuul.Executor.AnsibleSetupTimeout)
10171017
cfgINI.Section("executor").NewKey("ansible_setup_timeout", strconv.Itoa(ansibleSetupTimeout))
10181018
}
1019+
if r.cr.Spec.Zuul.Executor.Zone != "" {
1020+
cfgINI.Section("executor").NewKey("zone", r.cr.Spec.Zuul.Executor.Zone)
1021+
}
10191022

10201023
// Enable prometheus metrics
10211024
for _, srv := range []string{"web", "executor", "scheduler", "merger"} {

docs/reference/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
55
## [in development]
66

77
### Added
8+
9+
- Zuul.Executor.Zone setting to configure the nodepool executor-zone.
10+
811
### Changed
912
### Deprecated
1013
### Removed

docs/reference/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ _Appears in:_
569569
| `limits` _[LimitsSpec](#limitsspec)_ | Memory/CPU Limit | {map[cpu:500m memory:2Gi]}|
570570
| `diskLimitPerJob` _integer_ | the [disk_limit_per_job](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.disk_limit_per_job) | {250}|
571571
| `ansibleSetupTimeout` _integer_ | the [ansible setup playbook timeout](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.ansible_setup_timeout) | {60}|
572+
| `zone` _string_ | The (optional) nodepool [executor-zone](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-executor.zone) setting | -|
572573
| `TerminationGracePeriodSeconds` _integer_ | | {7200}|
573574

574575

schemas/ZuulExecutor.dhall

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
, controlPlanePublicZKHostnames : Optional (List Text)
1414
}
1515
, storage : Optional (./Storage.dhall).Type
16+
, zone : Optional Text
1617
}
1718
, default =
1819
{ TerminationGracePeriodSeconds = None Natural
@@ -29,5 +30,6 @@
2930
, controlPlanePublicZKHostnames : Optional (List Text)
3031
}
3132
, storage = None (./Storage.dhall).Type
33+
, zone = None Text
3234
}
3335
}

0 commit comments

Comments
 (0)