Skip to content

Commit b518f0c

Browse files
committed
Add validation for --revision flag to require --channel flag
This is needed because in libjuju we default to latest/stable if no channel is specified. It is dangerous if we don't add this check because without it the libjuju would deploy the wrong revision without an exception if --revision is used but no --channel is given.
1 parent 879d3c1 commit b518f0c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

juju/model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ async def resolve(self, url, architecture, app_name=None, channel=None, series=N
499499
the charmhub API is required to correctly determine the charm url and
500500
underlying origin.
501501
"""
502+
if revision and not channel:
503+
raise JujuError('ERROR specifying a revision requires a channel for future upgrades. Please use --channel')
502504

503505
ch = Channel('latest', 'stable')
504506
if channel is not None:

0 commit comments

Comments
 (0)