Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions juju/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,13 @@ async def _deploy(

app_facade = client.ApplicationFacade.from_connection(self.connection())

# Prepare all storage constraints
storage = storage or dict()
storage = {
k: v if isinstance(v, client.Constraints) else parse_storage_constraint(v)
for k, v in storage.items()
}

if server_side_deploy:
# Call DeployFromRepository
app = client.DeployFromRepositoryArg(
Expand Down
15 changes: 15 additions & 0 deletions tests/integration/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,21 @@ async def test_model_cache_update():
await controller.destroy_models(model_name)


@base.bootstrapped
async def test_deploy_with_storage():
async with base.CleanModel() as model:
await model.deploy(
'postgresql',
storage={"pgdata": {"size": 1024, "count": 1}},
)
await model.wait_for_idle(status="active")
storages = await model.list_storage()
await model.list_storage(filesystem=True)
await model.list_storage(volume=True)

assert any([tag.storage("pgdata") in s['storage-tag'] for s in storages])


@base.bootstrapped
async def test_add_storage():
pytest.skip("skip in favour of test_add_and_list_storage")
Expand Down