def UpdateMetadata(holder, metadata, args, instance, container_mount_disk_enabled=False, container_mount_disk=None):
    'Update konlet metadata entry using user-supplied data.'
    manifest = yaml.load(metadata.value)
    if args.IsSpecified('container_image'):
        manifest['spec']['containers'][0]['image'] = args.container_image
    if args.IsSpecified('container_command'):
        manifest['spec']['containers'][0]['command'] = [args.container_command]
    if args.IsSpecified('clear_container_command'):
        manifest['spec']['containers'][0].pop('command', None)
    if args.IsSpecified('container_arg'):
        manifest['spec']['containers'][0]['args'] = args.container_arg
    if args.IsSpecified('clear_container_args'):
        manifest['spec']['containers'][0].pop('args', None)
    if (args.container_privileged is True):
        manifest['spec']['containers'][0]['securityContext']['privileged'] = True
    if (args.container_privileged is False):
        manifest['spec']['containers'][0]['securityContext']['privileged'] = False
    if container_mount_disk_enabled:
        container_mount_disk = (container_mount_disk or [])
        disks = instance.disks
    else:
        container_mount_disk = []
        disks = []
    _UpdateMounts(holder, manifest, (args.remove_container_mounts or []), (args.container_mount_host_path or []), (args.container_mount_tmpfs or []), container_mount_disk, disks)
    _UpdateEnv(manifest, itertools.chain.from_iterable((args.remove_container_env or [])), args.container_env_file, (args.container_env or []))
    if (args.container_stdin is True):
        manifest['spec']['containers'][0]['stdin'] = True
    if (args.container_stdin is False):
        manifest['spec']['containers'][0]['stdin'] = False
    if (args.container_tty is True):
        manifest['spec']['containers'][0]['tty'] = True
    if (args.container_tty is False):
        manifest['spec']['containers'][0]['tty'] = False
    if args.IsSpecified('container_restart_policy'):
        manifest['spec']['restartPolicy'] = RESTART_POLICY_API[args.container_restart_policy]
    metadata.value = DumpYaml(manifest)
Update konlet metadata entry using user-supplied data.
def UpdateMetadata(holder, metadata, args, instance, container_mount_disk_enabled=False, container_mount_disk=None):
    
    manifest = yaml.load(metadata.value)
    if args.IsSpecified('container_image'):
        manifest['spec']['containers'][0]['image'] = args.container_image
    if args.IsSpecified('container_command'):
        manifest['spec']['containers'][0]['command'] = [args.container_command]
    if args.IsSpecified('clear_container_command'):
        manifest['spec']['containers'][0].pop('command', None)
    if args.IsSpecified('container_arg'):
        manifest['spec']['containers'][0]['args'] = args.container_arg
    if args.IsSpecified('clear_container_args'):
        manifest['spec']['containers'][0].pop('args', None)
    if (args.container_privileged is True):
        manifest['spec']['containers'][0]['securityContext']['privileged'] = True
    if (args.container_privileged is False):
        manifest['spec']['containers'][0]['securityContext']['privileged'] = False
    if container_mount_disk_enabled:
        container_mount_disk = (container_mount_disk or [])
        disks = instance.disks
    else:
        container_mount_disk = []
        disks = []
    _UpdateMounts(holder, manifest, (args.remove_container_mounts or []), (args.container_mount_host_path or []), (args.container_mount_tmpfs or []), container_mount_disk, disks)
    _UpdateEnv(manifest, itertools.chain.from_iterable((args.remove_container_env or [])), args.container_env_file, (args.container_env or []))
    if (args.container_stdin is True):
        manifest['spec']['containers'][0]['stdin'] = True
    if (args.container_stdin is False):
        manifest['spec']['containers'][0]['stdin'] = False
    if (args.container_tty is True):
        manifest['spec']['containers'][0]['tty'] = True
    if (args.container_tty is False):
        manifest['spec']['containers'][0]['tty'] = False
    if args.IsSpecified('container_restart_policy'):
        manifest['spec']['restartPolicy'] = RESTART_POLICY_API[args.container_restart_policy]
    metadata.value = DumpYaml(manifest)