From e7b0d9b07ddbef004076e1d4cdcda51c732f8cc4 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Thu, 22 Feb 2024 15:40:11 +0530 Subject: [PATCH] feat(deployment): adds support for host subpath uid/gid/perm --- rapyuta_io/clients/package.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/rapyuta_io/clients/package.py b/rapyuta_io/clients/package.py index 5c46c177..a90a8979 100644 --- a/rapyuta_io/clients/package.py +++ b/rapyuta_io/clients/package.py @@ -884,20 +884,29 @@ class ExecutableMount(object): :type sub_path: str """ - def __init__(self, exec_name, mount_path, sub_path=None): - self.validate(exec_name, mount_path, sub_path) + def __init__(self, exec_name, mount_path, sub_path=None, uid=None, gid=None, perm=None): + self.validate(exec_name, mount_path, sub_path, uid, gid, perm) self.exec_name = exec_name self.mount_path = mount_path self.sub_path = sub_path + self.uid = uid + self.gid = gid + self.perm = perm @staticmethod - def validate(exec_name, mount_path, sub_path=None): + def validate(exec_name, mount_path, sub_path=None, uid=None, gid=None, perm=None): if not isinstance(exec_name, six.string_types): raise InvalidParameterException('exec_name must be a non-empty string') if not isinstance(mount_path, six.string_types): raise InvalidParameterException('mount_path must be a non-empty string') if sub_path is not None and not isinstance(sub_path, six.string_types): raise InvalidParameterException('sub_path must be a non-empty string') + if uid is not None and not isinstance(uid, six.integer_types): + raise InvalidParameterException('uid must be a non-empty integer') + if gid is not None and not isinstance(gid, six.integer_types): + raise InvalidParameterException('gid must be a non-empty integer') + if perm is not None and not isinstance(perm, six.integer_types): + raise InvalidParameterException('perm must be a non-empty integer') class RestartPolicy(str, enum.Enum):