Skip to content

Commit

Permalink
zuul-merger - only update podSpecTemplate to keep configured replicas…
Browse files Browse the repository at this point in the history
… count

Also adds a scale up at beginging of the test suite and check that
we still have two replicas at the end of the test suite.

Change-Id: I19eee2a128ddfc1b189ebe1392d31f4726895628
  • Loading branch information
morucci committed Nov 21, 2023
1 parent 454d6f9 commit be91ba7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/zuul.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ func (r *SFController) EnsureZuulMerger(cfg *ini.File) bool {
if r.GetM(service, &current) {
if !utils.MapEquals(&current.Spec.Template.ObjectMeta.Annotations, &annotations) {
r.log.V(1).Info("zuul-merger configuration changed, rollout zuul-merger pods ...")
current.Spec = zm.DeepCopy().Spec
current.Spec.Template = *zm.Spec.Template.DeepCopy()
r.UpdateR(&current)
return false
}
Expand Down
3 changes: 3 additions & 0 deletions roles/health-check/scale-resources/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ scaling_services:
- name: zuul-executor
kind: sts
replicas: 2
- name: zuul-merger
kind: sts
replicas: 2
6 changes: 3 additions & 3 deletions roles/health-check/zuul-components/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
failed_when: "'running' not in item.state"
loop: "{{ _components.json['executor'] }}"

- name: Check if, at least, one Zuul Merger Instances Exists, fails otherwise
- name: Check if, two Zuul Merger Instances Exist, fails otherwise
ansible.builtin.fail:
msg: "Zuul Merger has no instances"
when: "_components.json['merger'] | length == 0"
msg: "Zuul Merger must have 2 replicas"
when: "_components.json['merger'] | length != 2"

- name: Check if Zuul Merger Components are Running
ansible.builtin.fail:
Expand Down

0 comments on commit be91ba7

Please sign in to comment.