Skip to content

Commit

Permalink
feat(deployment): adds support for host subpath uid/gid/perm
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsingh21 committed Feb 22, 2024
1 parent 42f2c41 commit e7b0d9b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions rapyuta_io/clients/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit e7b0d9b

Please sign in to comment.