Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17978 from nvinuesa/juju-6605
juju#17978 Before this patch it was impossible to un-set the juju-ha-space controller config value because: - first, the empty string was rejected because it does not match the regexp on the names package for space names. - second, because on the state layer we check that the provided space exists, and an empty string space never does. The first reason was fixed on `controller/config.go` by simply adding the "not empty string" check before validating the space name. For the second reason, a workaround had to be added: if the passed space name is the empty string, then we don't check for its existence. This is not good because in the `UpdateControllerConfig()` method we already have the `removeAttrs` argument but on the only usage of this method (on the client facades) we pass a nil value as `removeAttrs`. ## Checklist - [X] Code style: imports ordered, good names, simple structure, etc - [X] Comments saying why design decisions were made - [X] Go unit tests, with comments saying what you're testing - [ ] ~[Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing~ - [ ] ~[doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~ ## QA steps Bootstrap, set the `juju-ha-space` config value and then un-set it: ``` juju bootstrap lxd c juju controller-config juju-ha-space=alpha juju controller-config juju-ha-space alpha juju controller-config juju-ha-space="" juju controller-config juju-ha-space ``` No errors should be returned. ## Links **Launchpad bug:** https://bugs.launchpad.net/juju/+bug/2069808 **Jira card:** JUJU-6605
- Loading branch information