mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Renamed scontext variable to mount_options
This commit is contained in:
@@ -164,15 +164,14 @@ class BaseTask(object):
|
|||||||
# Using z allows the dir to be mounted by multiple containers
|
# Using z allows the dir to be mounted by multiple containers
|
||||||
# Uppercase Z restricts access (in weird ways) to 1 container at a time
|
# Uppercase Z restricts access (in weird ways) to 1 container at a time
|
||||||
if this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER:
|
if this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER:
|
||||||
src, dest, scontext = this_path.split(':')
|
src, dest, mount_option = this_path.split(':')
|
||||||
|
|
||||||
# scontext validation via performed via API, but since this can be overriden via settings.py
|
# mount_option validation via performed via API, but since this can be overriden via settings.py
|
||||||
# let's ensure scontext is one that we support
|
if mount_option not in CONTAINER_VOLUMES_MOUNT_TYPES:
|
||||||
if scontext not in CONTAINER_VOLUMES_MOUNT_TYPES:
|
mount_option = 'z'
|
||||||
scontext = 'z'
|
logger.warn(f'The path {this_path} has volume mount type {mount_option} which is not supported. Using "z" instead.')
|
||||||
logger.warn(f'The path {this_path} has volume mount type {scontext} which is not supported. Using "z" instead.')
|
|
||||||
|
|
||||||
params['container_volume_mounts'].append(f'{src}:{dest}:{scontext}')
|
params['container_volume_mounts'].append(f'{src}:{dest}:{mount_option}')
|
||||||
elif this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER - 1:
|
elif this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER - 1:
|
||||||
src, dest = this_path.split(':')
|
src, dest = this_path.split(':')
|
||||||
params['container_volume_mounts'].append(f'{src}:{dest}:z')
|
params['container_volume_mounts'].append(f'{src}:{dest}:z')
|
||||||
|
|||||||
@@ -500,9 +500,9 @@ class AWXReceptorJob:
|
|||||||
spec_volumes = []
|
spec_volumes = []
|
||||||
|
|
||||||
for idx, this_path in enumerate(settings.AWX_ISOLATION_SHOW_PATHS):
|
for idx, this_path in enumerate(settings.AWX_ISOLATION_SHOW_PATHS):
|
||||||
scontext = None
|
mount_option = None
|
||||||
if this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER:
|
if this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER:
|
||||||
src, dest, scontext = this_path.split(':')
|
src, dest, mount_option = this_path.split(':')
|
||||||
elif this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER - 1:
|
elif this_path.count(':') == MAX_ISOLATED_PATH_COLON_DELIMITER - 1:
|
||||||
src, dest = this_path.split(':')
|
src, dest = this_path.split(':')
|
||||||
else:
|
else:
|
||||||
@@ -512,7 +512,7 @@ class AWXReceptorJob:
|
|||||||
# We do this so we can use the same configuration for regular scenarios and k8s
|
# We do this so we can use the same configuration for regular scenarios and k8s
|
||||||
# Since flags like ':O', ':z' or ':Z' are not valid in the k8s realm
|
# Since flags like ':O', ':z' or ':Z' are not valid in the k8s realm
|
||||||
# Example: /data:/data:ro
|
# Example: /data:/data:ro
|
||||||
read_only = bool('ro' == scontext)
|
read_only = bool('ro' == mount_option)
|
||||||
|
|
||||||
# Since type is not being passed, k8s by default will not perform any checks if the
|
# Since type is not being passed, k8s by default will not perform any checks if the
|
||||||
# hostPath volume exists on the k8s node itself.
|
# hostPath volume exists on the k8s node itself.
|
||||||
|
|||||||
Reference in New Issue
Block a user