Skip to content

Commit

Permalink
Add support for more volume mount options (#1342)
Browse files Browse the repository at this point in the history
* Allow more volume mount options

* Allow more volume mount options

Co-authored-by: Sorin Sbarnea <sorin.sbarnea@gmail.com>
  • Loading branch information
shatakshiiii and ssbarnea authored Dec 9, 2022
1 parent 6db15cb commit a396799
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ansible_navigator/configuration_subsystem/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ class VolumeMountOption(Enum):
keep in mind that we support both runtimes.
"""

# Overlay
OVERLAY = "O"

# Read Only
ro = "ro" # pylint: disable=invalid-name

# Read Write
rw = "rw" # pylint: disable=invalid-name

# Relabel as private
Z = "Z"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@ def __str__(self):
expected=["/tmp:/tmp:Z"],
source=C.USER_CLI,
),
Scenario(
current=[["/tmp:/tmp:O"]],
expected=["/tmp:/tmp:O"],
source=C.USER_CLI,
),
Scenario(
current=[["/tmp:/tmp:ro"]],
expected=["/tmp:/tmp:ro"],
source=C.USER_CLI,
),
Scenario(
current=[["/tmp:/tmp:rw"]],
expected=["/tmp:/tmp:rw"],
source=C.USER_CLI,
),
Scenario(
current=[["/tmp:/tmp:Y"]],
exit_message_substr="Unrecognized option: 'Y'",
Expand Down Expand Up @@ -130,6 +145,11 @@ def __str__(self):
expected=["/tmp:/tmp:Z"],
source=C.USER_CFG,
),
Scenario(
current=[{"src": "/tmp", "dest": "/tmp", "options": "O"}],
expected=["/tmp:/tmp:O"],
source=C.USER_CFG,
),
Scenario(
current=[{"src": "~", "dest": "/tmp", "options": "Z"}],
expected=[f"{Path.home()}:/tmp:Z"],
Expand Down Expand Up @@ -159,6 +179,16 @@ def __str__(self):
expected=["/tmp:/tmp:Z,z"],
source=C.USER_CFG,
),
Scenario(
current=[{"src": "/tmp", "dest": "/tmp", "options": "O,z"}],
expected=["/tmp:/tmp:O,z"],
source=C.USER_CFG,
),
Scenario(
current=[{"src": "/tmp", "dest": "/tmp", "options": "0,z"}],
exit_message_substr="Unrecognized option: '0'",
source=C.USER_CFG,
),
Scenario(
current=[{"src": "/tmp", "dest": "/tmp", "options": "Z,y"}],
exit_message_substr="Unrecognized option: 'y'",
Expand Down

0 comments on commit a396799

Please sign in to comment.