Commit 53cd33d
authored
Merge pull request #1053 from luissimas/fix-storage-constraints
#1053
#### Description
Fixes: #1052. Parses the storage constraints when deploying applications. Before this change the storage constraints where not parsing, resulting in an error when deploying bundles that contained applications with storage definitions.
#### QA Steps
The following python script can be used to verify both the bug in the current version as well as the fix implemented:
```python
import asyncio
from juju.model import Model
bundle_file = "./bundle.yaml"
bundle = """
name: sample-bundle
series: jammy
machines:
"0":
constraints: instance-type=type1
applications:
swift-storage:
charm: swift-storage
channel: yoga/stable
num_units: 1
to:
- "0"
storage:
block-devices: cinder,1,5G
"""
async def main():
with open(bundle_file, "w") as f:
f.write(bundle)
model = Model()
await model.connect()
await model.deploy(bundle_file)
asyncio.run(main())
```
All CI tests need to pass.
#### Notes & Discussion
I wasn't able to add a regression test for this fix since the `juju-qa-test` charm does not support the addition of storage devices. With that said, I'm open to suggestions on how to test this behavior to make sure it's correct and that it stays that way on future changes.3 files changed
Lines changed: 26 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
2115 | 2116 | | |
2116 | 2117 | | |
2117 | 2118 | | |
2118 | | - | |
| 2119 | + | |
2119 | 2120 | | |
2120 | 2121 | | |
2121 | 2122 | | |
| |||
2150 | 2151 | | |
2151 | 2152 | | |
2152 | 2153 | | |
2153 | | - | |
| 2154 | + | |
2154 | 2155 | | |
2155 | 2156 | | |
2156 | 2157 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
| |||
0 commit comments