Support imagePrefix and versions

Allow the user to specify an image prefix and a version tag.

This updates the functional test to account for a recent change
in Zuul which returns incomplete builds on the API endpoint.

Change-Id: I49e82c790a518c1c9f5a463250b5b785eacde55a
This commit is contained in:
James E. Blair 2021-04-07 13:55:38 -07:00
parent ce1f8b338c
commit 5358c6dc0e
4 changed files with 11 additions and 8 deletions

View File

@ -122,7 +122,7 @@
- name: get buillds results
include_tasks: tasks/zuul_web_check.yaml
vars:
endpoint: "/api/tenant/local/builds"
endpoint: "/api/tenant/local/builds?complete=true"
- name: ensure success build
assert:

View File

@ -27,7 +27,7 @@ spec:
spec:
containers:
- name: launcher
image: zuul/nodepool-launcher:latest
image: {{ spec.imagePrefix }}/nodepool-launcher:{{ spec.nodepoolImageVersion }}
env:
- name: KUBECONFIG
value: /etc/kubernetes/kube.config

View File

@ -120,7 +120,7 @@ spec:
spec:
containers:
- name: scheduler
image: zuul/zuul-scheduler:{{ zuul_version }}
image: {{ spec.imagePrefix }}/zuul-scheduler:{{ spec.zuulImageVersion }}
command: ["/usr/local/bin/zuul-scheduler", "-f", "-d"]
ports:
- name: gearman
@ -200,7 +200,7 @@ spec:
spec:
containers:
- name: web
image: zuul/zuul-web:{{ zuul_version }}
image: {{ spec.imagePrefix }}/zuul-web:{{ spec.zuulImageVersion }}
ports:
- name: zuul-web
containerPort: 9000
@ -252,7 +252,7 @@ spec:
runAsGroup: 10001
containers:
- name: executor
image: zuul/zuul-executor:{{ zuul_version }}
image: {{ spec.imagePrefix }}/zuul-executor:{{ spec.zuulImageVersion }}
command: ["/usr/local/bin/zuul-executor", "-f", "-d"]
ports:
- name: logs
@ -335,7 +335,7 @@ spec:
runAsGroup: 10001
containers:
- name: merger
image: zuul/zuul-merger:{{ zuul_version }}
image: {{ spec.imagePrefix }}/zuul-merger:{{ spec.zuulImageVersion }}
volumeMounts:
- name: zuul-config
mountPath: /etc/zuul

View File

@ -71,6 +71,10 @@ class Zuul:
self.spec.setdefault('merger', {}).setdefault('count', 0)
self.spec.setdefault('web', {}).setdefault('count', 1)
self.spec.setdefault('imagePrefix', 'docker.io/zuul')
self.spec.setdefault('zuulImageVersion', 'latest')
self.spec.setdefault('nodepoolImageVersion', 'latest')
self.cert_manager = certmanager.CertManager(
self.api, self.namespace, self.log)
self.installing_cert_manager = False
@ -266,11 +270,11 @@ class Zuul:
for provider_name, secret_name in\
self.nodepool_provider_secrets.items():
kw = {
'zuul_version': '4.1.0',
'instance_name': self.name,
'provider_name': provider_name,
'nodepool_config_secret_name': secret_name,
'external_config': self.spec.get('externalConfig', {}),
'spec': self.spec,
}
utils.apply_file(self.api, 'nodepool-launcher.yaml',
namespace=self.namespace, **kw)
@ -310,7 +314,6 @@ class Zuul:
def create_zuul(self):
kw = {
'zuul_conf_sha': self.zuul_conf_sha,
'zuul_version': '4.1.0',
'zuul_tenant_secret': self.tenant_secret,
'instance_name': self.name,
'connections': self.spec['connections'],