Fix cluster override in k8s_test_setup #129
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The
k8s_test_setup
rule can inadvertently use the wrong cluster if there is more than onekubeconfig
defined in theWORKSPACE
. It currently has the keyword_cluster
, which cannot be overridden, as it's private. If there is more than one kubeconfig and it happens to have the namek8s_test
it will use that instead of the new config that you may define.The primary issue is that even if you wanted to have a
kubeconfig
with a different name other thank8s_test
, it will not work as the_cluster
attributes always assumes the kubeconfig will always use the labelk8s_test
.Related Issue
Motivation and Context
1). Allow ability to use a Kubeconfig that doesn't necessarily need to be named
k8s_test
.2). Allow ability to use multiple Kubeconfigs, where one may be named
k8s_test
.How Has This Been Tested?
I have two kubeconfigs, one for our CI cluster, and one for my local cluster running on my Mac as follow:
This config was then used in k8s_test_setup as follows:
When running associated tests that use
k8s_test_setup
, I can see that the objects are deployed to the "kind-kind" cluster.Types of changes
Checklist: