From 19f80b7d89f3ce004fe2c28313da114110d7674c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 7 Jul 2021 10:30:24 -0700 Subject: [PATCH] Fix error with multiple nodepool providers An indentation error caused the operator to only create the last provider listed in the nodepool config. Additionally, add the nodepool provider to the nodepool launcher deployment spec. This is needed to separate the pods for different nodepool launchers (otherwise, the deployments may consider pods for one launcher to belong to another). Change-Id: I76bbae948d1a633028b3565d512fb48d68111dd7 --- zuul_operator/templates/nodepool-launcher.yaml | 2 ++ zuul_operator/zuul.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/zuul_operator/templates/nodepool-launcher.yaml b/zuul_operator/templates/nodepool-launcher.yaml index 7b5ae8d..81d1d27 100644 --- a/zuul_operator/templates/nodepool-launcher.yaml +++ b/zuul_operator/templates/nodepool-launcher.yaml @@ -17,6 +17,7 @@ spec: app.kubernetes.io/instance: {{ instance_name }} app.kubernetes.io/part-of: zuul app.kubernetes.io/component: nodepool-launcher + operator.zuul-ci.org/nodepool-provider: {{ provider_name }} template: metadata: labels: @@ -24,6 +25,7 @@ spec: app.kubernetes.io/instance: {{ instance_name }} app.kubernetes.io/part-of: zuul app.kubernetes.io/component: nodepool-launcher + operator.zuul-ci.org/nodepool-provider: {{ provider_name }} spec: containers: - name: launcher diff --git a/zuul_operator/zuul.py b/zuul_operator/zuul.py index 53e26f5..6d6935d 100644 --- a/zuul_operator/zuul.py +++ b/zuul_operator/zuul.py @@ -304,8 +304,8 @@ class Zuul: 'external_config': self.spec.get('externalConfig', {}), 'spec': self.spec, } - utils.apply_file(self.api, 'nodepool-launcher.yaml', - namespace=self.namespace, **kw) + utils.apply_file(self.api, 'nodepool-launcher.yaml', + namespace=self.namespace, **kw) # Get current providers providers = objects.Deployment.objects(self.api).filter(