Skip to content

Commit

Permalink
Support testing on minikube. (kubeflow#485)
Browse files Browse the repository at this point in the history
* Support testing on minikube.

* When using minikube we don't want call configure_kubectl which calls
  gcloud container clusters get-credentials.

* Instead we just need to call load_kube_config to load the kube config file.

* Related to kubeflow/testing#6

* Add a TODO.

* Fix lint issue.
  • Loading branch information
jlewi authored and k8s-ci-robot committed Mar 26, 2018
1 parent e31018a commit babaec5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion py/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions py/util.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit babaec5

Please sign in to comment.