Skip to content

Commit 4213fed

Browse files
committed
chore: change--SubPath keyvalue, add assert Subpath in test
1 parent ea669f4 commit 4213fed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docker/types/services.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def __init__(self, target, source, type='volume', read_only=False,
283283
if driver_config:
284284
volume_opts['DriverConfig'] = driver_config
285285
if subpath:
286-
volume_opts['SubPath'] = subpath
286+
volume_opts['Subpath'] = subpath
287287
if volume_opts:
288288
self['VolumeOptions'] = volume_opts
289289
if any([propagation, tmpfs_size, tmpfs_mode]):

tests/integration/api_container_test.py

+3
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,13 @@ def test_create_with_subpath_volume_mount(self):
638638
lambda x: x['Destination'] == self.mount_dest,
639639
inspect_data['Mounts']
640640
))
641+
642+
print(mount)
641643
assert len(filtered) == 1
642644
mount_data = filtered[0]
643645
assert mount['Source'] == mount_data['Name']
644646
assert mount_data['RW'] is False
647+
assert mount["VolumeOptions"]["Subpath"] == "subdir"
645648

646649
def check_container_data(self, inspect_data, rw, propagation='rprivate'):
647650
assert 'Mounts' in inspect_data

0 commit comments

Comments
 (0)