charmed-kubernetes / pytest-operator

Apache License 2.0
7 stars 13 forks source link

OpsTest.model.deploy(subordinate_charm) should work out of the box #49

Closed PietroPasotti closed 2 years ago

PietroPasotti commented 2 years ago

Not sure this is more of an issue or a feature request, but here's my thought.

juju deploy subordinate_charm and the charm will be automagically deployed with scale=0/0. While if I do: ops_test.deploy(subordinate_charm) it will fail citing subordinate application must be deployed without units.

User is then required to do: ops_test.deploy(subordinate_charm, num_units=0) and it will work.

Two problems with this: 1) I would expect the behaviour of ops_test.deploy to match that of juju deploy 2) Given the error message, we do know exactly how to fix the issue. Why don't we then? A dynamic default checking if charm.is_subordinate would do.

addyess commented 2 years ago

@PietroPasotti, sorry but ops_test doesn't have a deploy method, but there is a deploy_bundle

did you mean ops_test.model.deploy(...)? If so you could raise this bug against https://github.com/juju/python-libjuju

PietroPasotti commented 2 years ago

Yes! Got it right in the title but not in the description :) Thanks, will do.