juju deploy --dry-run is not thorough enough
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Juju has the option to do a dry run when deploying a bundle, in which it will do some checks on the validity of the bundle to be deployed.
However, it is not thorough enough, it will not ensure that everything will deploy correctly when dry run is no longer set to true.
For example, let's consider the following bundle:
name: temp-bundle
bundle: kubernetes
applications:
ingress:
charm: "nginx-
channel: "stable"
scale: 1
trust: true
options:
some-
bindings:
"
When running ``juju deploy --trust --dry-run ./bundle.yaml``, the command will exit successfully:
```
juju deploy --trust --dry-run ./bundle.yaml
Located charm "nginx-
Changes to deploy bundle:
- upload charm nginx-ingress-
- deploy application ingress from charm-hub with 1 unit with stable using nginx-ingress-
```
But obviously, we're using a config option that does not exist and a binding that does not exist. The expectation would have been for the dry run to fail. Instead, we only see the failure on juju deploy:
```
juju deploy --trust ./bundle.yaml
Located charm "nginx-
Executing changes:
- upload charm nginx-ingress-
- deploy application ingress from charm-hub with 1 unit with stable using nginx-ingress-
ERROR cannot deploy bundle: cannot deploy application "ingress": unknown option "some-option-
```
When writing a more complex custom bundle (e.g.: OpenStack bundle), a user would expect that the dry run would reveal any potential issues with the bundle (wrong config options, wrong bindings, etc.). However, they wouldn't see that, and instead they would end up deploying half the bundle just to run into an error. The units from the deployed half would then have to be cleaned up and decommissioned.
I will add this behaviour to our wishlist.