Don't allow "" value for kubelet-extra-config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Kubernetes Control Plane Charm |
Triaged
|
Medium
|
Unassigned | ||
Kubernetes Worker Charm |
Triaged
|
Medium
|
Unassigned |
Bug Description
Hello,
When set "" value to kubelet-
Environment: kubernetes-worker charm revision 44 from channel 1.24/stable deployed on Bionic machine.
Steps to reproduce:
1. Deploy juju k8s bundle
2. juju config kubernetes-worker kubelet-
3. seeing this in kubernetes-worker logs
```
unit-kubernetes
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
configure_
File "lib/charms/
merge_
File "lib/charms/
for k, extra_config_value in extra_config.
AttributeError: 'NoneType' object has no attribute 'items'
```
The expected behavior would be:
1. Deploy juju k8s bundle
2. juju config kubernetes-worker kubelet-
3. Get an error from `juju config` saying that "" is not allowed value.
The issue's impact was pretty bad in production as we used `juju config kubernetes-worker kubelet-
Many thanks in advance!
Best Regards,
Alex.
Thanks for the report. We don't have a way to prevent Juju from accepting the config, but there are two things we can do in the charm to improve the experience here:
1. Accept "" and treat it the same as "{}"
2. Validate the config in the charm, and if it's invalid, enter Blocked status with a clear message