clearml_agent/glue/k8s.py
def _get_docker_args(self, docker_args, flags, target=None, convert=None):
        # type: (List[str], Collection[str], Optional[str], Callable[[str], Any]) -> Union[dict, List[str]]
        """
        Get docker args matching specific flags.

        :argument docker_args: List of docker argument strings (flags and values)
        :argument flags: List of flags/names to intercept (e.g. "--env" etc.)
        :argument target: Controls return format. If provided, returns a dict with a target field containing a list
         of result strings, otherwise returns a list of result strings
        :argument convert: Optional conversion function for each result string
        """
        args = docker_args[:] if docker_args else []
        results = []
        while args:
            cmd = args.pop(0).strip()
            if cmd in flags:
                env = args.pop(0).strip()
                if convert:
                    env = convert(env)
                results.append(env)
            else:
                self.log.warning('skipping docker argument {} (only -e --env supported)'.format(cmd))
        if target:
            return {target: results} if results else {}
        return results

        Get docker args matching specific flags.

        :argument docker_args: List of docker argument strings (flags and values)
        :argument flags: List of flags/names to intercept (e.g. "--env" etc.)
        :argument target: Controls return format. If provided, returns a dict with a target field containing a list
         of result strings, otherwise returns a list of result strings
        :argument convert: Optional conversion function for each result string
        
Get docker args matching specific flags.
Get docker args matching specific flags .
def _get_docker_args(self, docker_args, flags, target=None, convert=None):
        args = docker_args[:] if docker_args else []
        results = []
        while args:
            cmd = args.pop(0).strip()
            if cmd in flags:
                env = args.pop(0).strip()
                if convert:
                    env = convert(env)
                results.append(env)
            else:
                self.log.warning('skipping docker argument {} (only -e --env supported)'.format(cmd))
        if target:
            return {target: results} if results else {}
        return results
def _get_docker_args ( self , docker_args , flags , target = None , convert = None ) : args = docker_args [ : ] if docker_args else [ ] results = [ ] while args : cmd = args . pop ( 0 ) . strip ( ) if cmd in flags : env = args . pop ( 0 ) . strip ( ) if convert : env = convert ( env ) results . append ( env ) else : self . log . warning ( 'skipping docker argument {} (only -e --env supported)' . format ( cmd ) ) if target : return { target : results } if results else { } return results
Get docker args matching specific flags.
Get docker args matching specific flags .
# type: (List[str], Collection[str], Optional[str], Callable[[str], Any]) -> Union[dict, List[str]] """
        Get docker args matching specific flags.

        :argument docker_args: List of docker argument strings (flags and values)
        :argument flags: List of flags/names to intercept (e.g. "--env" etc.)
        :argument target: Controls return format. If provided, returns a dict with a target field containing a list
         of result strings, otherwise returns a list of result strings
        :argument convert: Optional conversion function for each result string
        """
self
docker_args
List of docker argument strings (flags and values)
List of docker argument strings ( flags and values )
flags
List of flags/names to intercept
List of flags / names to intercept
target
Controls return format. If provided, returns a dict with a target field containing a list
of result strings, otherwise returns a list of result strings
Controls return format . If provided returns a dict with a target field containing a list of result strings otherwise returns a list of result strings
convert
Optional conversion function for each result string
Optional conversion function for each result string