From 182a563a9ed4448fdc9fb6a322127b9f0e98b2d1 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sat, 10 Apr 2021 19:08:30 -0700 Subject: [PATCH] Add allowUnsafeConfig database setting We overrode the PXC resource values in order for functional tests in minikube to work. Restore the defaults and set an override in the functional tests. Change-Id: Id0560d9089f03ddcb116dccec0b424b811186d65 --- doc/source/index.rst | 9 +++++++++ playbooks/zuul-operator-functional/run.yaml | 2 ++ playbooks/zuul-operator-functional/test.yaml | 2 ++ zuul_operator/zuul.py | 4 ++-- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index 28cec80..76e2f6a 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -320,6 +320,15 @@ verbatim): The key name in the secret should be ``dburi``. + .. attr:: allowUnsafeConfig + :default: False + + If you are running in a resource constrained environment + (such as minikube), the requested resource values for the + Percona XtraDB may be too large. Set this to True to + override the default values and construct the cluster + regardless. Only use this for testing. + .. attr:: zookeeper This is not required unless you want to manage the ZooKeeper diff --git a/playbooks/zuul-operator-functional/run.yaml b/playbooks/zuul-operator-functional/run.yaml index 5a58480..2b3bd9f 100644 --- a/playbooks/zuul-operator-functional/run.yaml +++ b/playbooks/zuul-operator-functional/run.yaml @@ -16,6 +16,8 @@ include_tasks: tasks/apply_cr.yaml vars: spec: + database: + allowUnsafeConfig: true executor: count: 1 sshkey: diff --git a/playbooks/zuul-operator-functional/test.yaml b/playbooks/zuul-operator-functional/test.yaml index 526f649..d87ae45 100644 --- a/playbooks/zuul-operator-functional/test.yaml +++ b/playbooks/zuul-operator-functional/test.yaml @@ -75,6 +75,8 @@ - include_tasks: tasks/apply_cr.yaml vars: spec: + database: + allowUnsafeConfig: true executor: count: 1 sshkey: diff --git a/zuul_operator/zuul.py b/zuul_operator/zuul.py index b3f88bc..495e568 100644 --- a/zuul_operator/zuul.py +++ b/zuul_operator/zuul.py @@ -124,8 +124,8 @@ class Zuul: if not self.manage_db: self.log.info("DB is externally managed") return - # TODO: get this from spec - small = True + + small = self.spec.get('database', {}).get('allowUnsafeConfig', False) self.log.info("DB is internally managed") self.pxc = pxc.PXC(self.api, self.namespace, self.log)