def generate_dest_name(src_repo, name):
    """ generate dest repo image name

    :param src_repo: one of
        - k8s.gcr.io
        - gcr.io/ml-pipeline
        - quay.io/metallb
        - gcr.io/knative-releases/knative.dev/eventing/cmd
    :param name: image name
    :return dest_image_name
    """
    if src_repo.endswith('/cmd'):
        t = src_repo.split('/')
        if t[-1] == 'cmd':
            return f'{t[-2]}-{name}'

    return name