Comment 2 for bug 1836063

Revision history for this message
George Kraft (cynerva) wrote :

Looks like a bug in the kubernetes-master charm. It happens when an upgrade-charm hook runs before a kube-api-endpoint relation is established.

The upgrade-charm handler calls update_certificates()[1], which calls send_data()[2], which assumes kube-api-endpoint is available[3]. Either this code path needs to be eliminated, or there needs to be a check somewhere along the line that kube-api-endpoint is actually available.

It is weird that Juju runs an upgrade-charm hook on initial deployment. But the charm should be able to handle it.

[1]: https://github.com/charmed-kubernetes/charm-kubernetes-master/blob/aa7065651343626bac2ca16bcf849f6e9e051ab5/reactive/kubernetes_master.py#L169
[2]: https://github.com/charmed-kubernetes/charm-kubernetes-master/blob/aa7065651343626bac2ca16bcf849f6e9e051ab5/reactive/kubernetes_master.py#L915
[3]: https://github.com/charmed-kubernetes/charm-kubernetes-master/blob/aa7065651343626bac2ca16bcf849f6e9e051ab5/reactive/kubernetes_master.py#L846