Skip to content

Commit 992e6ed

Browse files
committed
zuul-scheduler - add hold expiration settings
- zuul-scheduler: add support for `default_hold_expiration`. - zuul-scheduler: add support for `max_hold_expiration`. Change-Id: I540564355bbc8e714c332b5807b6b9e180e573f8
1 parent 953180c commit 992e6ed

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

api/v1/softwarefactory_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,14 @@ type ZuulSchedulerSpec struct {
296296
// +kubebuilder:validation:Optional
297297
// +kubebuilder:default={"memory": "2Gi", "cpu": "2000m"}
298298
Limits *LimitsSpec `json:"limits"`
299+
// the [DefaultHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.default_hold_expiration)
300+
// +optional
301+
// +kubebuilder:validation:Minimum:=0
302+
DefaultHoldExpiration *uint32 `json:"DefaultHoldExpiration,omitempty"`
303+
// the [MaxHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.max_hold_expiration)
304+
// +optional
305+
// +kubebuilder:validation:Minimum:=0
306+
MaxHoldExpiration *uint32 `json:"MaxHoldExpiration,omitempty"`
299307
}
300308

301309
// Zuul Merger Configuration, see [Zuul's documentation](https://zuul-ci.org/docs/zuul/latest/configuration.html#merger)

api/v1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,16 @@ spec:
918918
scheduler:
919919
description: Configuration of the scheduler microservice
920920
properties:
921+
DefaultHoldExpiration:
922+
description: the [DefaultHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.default_hold_expiration)
923+
format: int32
924+
minimum: 0
925+
type: integer
926+
MaxHoldExpiration:
927+
description: the [MaxHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.max_hold_expiration)
928+
format: int32
929+
minimum: 0
930+
type: integer
921931
limits:
922932
default:
923933
cpu: 2000m

controllers/zuul.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,14 @@ func (r *SFController) EnsureZuulConfigSecret(skipDBSettings bool, skipAuthSetti
957957
cfgINI.Section("auth "+*defaultAuthSection).NewKey("default", "true")
958958
}
959959

960+
// Set scheduler settings
961+
if r.cr.Spec.Zuul.Scheduler.DefaultHoldExpiration != nil {
962+
cfgINI.Section("scheduler").NewKey("default_hold_expiration", strconv.Itoa(int(*r.cr.Spec.Zuul.Scheduler.DefaultHoldExpiration)))
963+
}
964+
if r.cr.Spec.Zuul.Scheduler.MaxHoldExpiration != nil {
965+
cfgINI.Section("scheduler").NewKey("max_hold_expiration", strconv.Itoa(int(*r.cr.Spec.Zuul.Scheduler.MaxHoldExpiration)))
966+
}
967+
960968
// Enable prometheus metrics
961969
for _, srv := range []string{"web", "executor", "scheduler", "merger"} {
962970
cfgINI.Section(srv).NewKey("prometheus_port", strconv.Itoa(zuulPrometheusPort))

doc/reference/CHANGELOG.md

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

77
### Added
8+
9+
- zuul-scheduler: add support for `default_hold_expiration`.
10+
- zuul-scheduler: add support for `max_hold_expiration`.
11+
812
### Changed
913
### Deprecated
1014
### Removed

doc/reference/api/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ _Appears in:_
540540
| `statsdTarget` _string_ | The address to forward statsd metrics to (optional), in the form "host:port" | -|
541541
| `logLevel` _[LogLevel](#loglevel)_ | Specify the Log Level of the zuul-scheduler service.<br /><br />Valid values are:<br /><br />"INFO" (default),<br /><br />"WARN",<br /><br />"DEBUG".<br /><br />Changing this value will restart the service. | INFO|
542542
| `limits` _[LimitsSpec](#limitsspec)_ | Memory/CPU Limit | {map[cpu:2000m memory:2Gi]}|
543+
| `DefaultHoldExpiration` _integer_ | the [DefaultHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.default_hold_expiration) | -|
544+
| `MaxHoldExpiration` _integer_ | the [MaxHoldExpiration](https://zuul-ci.org/docs/zuul/latest/configuration.html#attr-scheduler.max_hold_expiration) | -|
543545

544546

545547
#### ZuulSpec

0 commit comments

Comments
 (0)