Skip to content
This repository has been archived by the owner on Apr 27, 2020. It is now read-only.

Retain current context to remove dependency on minikube #38

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/suite.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
load helper

setup() {
current_context="$(kubectl config current-context)"
# Create a temporary namespace for test
namespace="test-kubernetes-resource-${RANDOM}"
kubectl create ns "$namespace"
# Create a kubeconfig file
kubeconfig_file="$(mktemp)"
kubectl config view --flatten --minify > "$kubeconfig_file"
# Change the current-context to $namespace
kubectl --kubeconfig "$kubeconfig_file" config set-context minikube --namespace "$namespace"
kubectl --kubeconfig "$kubeconfig_file" config set-context ${current_context} --namespace "$namespace"
}

teardown() {
Expand Down