juju happily deploys a machine bundle on a k8s model
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Medium
|
Unassigned |
Bug Description
I accidentally asked juju to deploy the following machine bundle on a k8s model:
series: jammy
saas:
prom:
url: k8s2:admin/cos.prom
applications:
cos-proxy:
charm: ./cos-proxy_
series: focal
num_units: 1
nrpe:
charm: nrpe
channel: edge
revision: 114
ub:
charm: ubuntu
channel: stable
revision: 24
series: focal
num_units: 1
relations:
- - cos-proxy:
- prom:metrics-
- - nrpe:monitors
- cos-proxy:monitors
- - nrpe:general-info
- ub:juju-info
As a result, the deploy command errored out, but cos-proxy and nrpe were deployed nonetheless:
$ juju deploy ./lxd-bundle.yaml
Located charm "nrpe" in charm-hub, channel edge
Located charm "ubuntu" in charm-hub, channel stable
Executing changes:
- upload charm /home/ubuntu/
- deploy application cos-proxy on focal
- upload charm nrpe from charm-hub for series jammy with revision 114 with architecture=amd64
- deploy application nrpe from charm-hub on jammy with edge
- upload charm ubuntu from charm-hub for series focal with revision 24 with architecture=amd64
- deploy application ub from charm-hub on focal with stable using ubuntu
ERROR cannot deploy bundle: cannot deploy application "ub": block storage "block" is not supported for container charms
---
I'd expect this deploy command to fail without any charms deployed, because:
1. The bundle didn't specify `bundle: kubernetes` but is attempted on a k8s model.
2. The charms are machine charms, but attempted on a k8s model.
3. The error "block storage "block" is not supported for container charms" could potentially be flagged before going forward with any charm deployments.
There's really no such thing as a "machine charm". If by machine charm you mean a charm which does not define any workload containers, then that's still a valid k8s charm; it's a "pure" operator charm for want of a better term.
We should fail early though if a bundle is not valid for the model.