charm-tools icon indicating copy to clipboard operation
charm-tools copied to clipboard

Deploying a source layer does not fail spectacularly

Open stub42 opened this issue 9 years ago • 2 comments

If a user upgrades a deployment using a charm source layer rather than the built charm artifact, something unexpected happens. Absolutely nothing. There are enough of the necessary files to get the layer past juju and unpacked on the units. And then nothing happens, because there is no hooks/upgrade-charm or hooks/update-status. The units just sit there happily, resulting in a very confused operator. This operator shall not be named to protect the guilty. No, it was not me. Promise.

Could the build process stop this? Its certainly user error, but easy enough to make a mistake by deploying the default 'master' branch for instance rather than a branch containing the built artifact. Maybe a source layer could be an invalid charm somehow, which is only fixed by the 'charm build' process. Perhaps it doesn't have a metadata.yaml, or includes some config items known to stop juju but which 'charm build' could remove.

Is it worth it?

stub42 avatar Dec 06 '16 10:12 stub42

I'm not sure that it is possible to stop the user from deploying a source layer, since that is a function of the Juju CLI and not charm-tools. Also, even if a charm layer is missing some critical file, when doing an upgrade that file is likely already on the unit and thus won't cause any failure, since upgrades don't remove files.

We could possibly have some invalid header in the metadata.yaml that would block deployment and is removed by charm build, but that would be up to the charm author to include (or to not remove, if they start from a template).

johnsca avatar Nov 02 '17 15:11 johnsca

Related to https://github.com/juju/charmstore-client/issues/143. If/when that gets resolved, we'll at least prevent people from pushing layers into the store. However, that still doesn't prevent upgrading a deployed charm using a local layer.

kwmonroe avatar Feb 08 '18 18:02 kwmonroe