def update_dep_ref_k8shim()

in tools/build-release.py [0:0]


def update_dep_ref_k8shim(local_repo_path):
    print("updating dependency for k8shim")
    mod_file = os.path.join(local_repo_path, "go.mod")
    if not os.path.isfile(mod_file):
        fail("k8shim go.mod does not exist")
    path = os.getcwd()
    os.chdir(local_repo_path)
    command = ['go', 'mod', 'edit']
    command.extend(['-replace', 'github.com/apache/yunikorn-core=../core'])
    command.extend(['-replace', 'github.com/apache/yunikorn-scheduler-interface=../scheduler-interface'])
    retcode = subprocess.call(command)
    if retcode:
        fail("failed to update k8shim go.mod references")
    os.chdir(path)