diff --git a/py/test_runner.py b/py/test_runner.py index ff52a3a5c1..04c8a3f24f 100644 --- a/py/test_runner.py +++ b/py/test_runner.py @@ -114,7 +114,16 @@ def run_test(args): # pylint: disable=too-many-branches,too-many-statements project = args.project cluster_name = args.cluster zone = args.zone - util.configure_kubectl(project, zone, cluster_name) + # TODO(jlewi): When using GKE we should copy the .kube config and any other + # files to the test directory. We should then set the environment variable + # KUBECONFIG to point at that file. This should prevent us from having + # to rerun util.configure_kubectl on each step. Instead we could run it once + # as part of GKE cluster creation and store the config in the NFS directory. + # This would make the handling of credentials + # and KUBECONFIG more consistent between GKE and minikube and eventually + # this could be extended to other K8s deployments. + if cluster_name: + util.configure_kubectl(project, zone, cluster_name) util.load_kube_config() api_client = k8s_client.ApiClient() diff --git a/py/util.py b/py/util.py index 57a810dc97..cb97d31f2a 100755 --- a/py/util.py +++ b/py/util.py @@ -1,6 +1,7 @@ """Utilities used by our python scripts for building and releasing.""" from __future__ import print_function +# TODO(jlewi): We should remove this file and use util in kubeflow/testing repository. import datetime import logging import os