This repository has been archived by the owner on Jun 28, 2023. It is now read-only.
Introduces ExistingClusterKubeconfig
option to unmanaged-cluster
#2918
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.
What this PR does / why we need it
This PR introduces the
ExistingClusterKubeconfig
config option which is supported by the--existing-cluster-kubeconfig
flag duringcreate
.This enables users to bring their own clusters that already exist and already have a kubeconfig on the filesystem.
Why not just use
KubeconfigPath
?This would have required a greater refactor since the
config.KubeconfigPath
is used to create and set the context of new created kind clusters:This means that we would have been overloading the use of
KubeconfigPath
: it would both be the path to the kubeconfig for some arbitrary created cluster or used in logic to determine if a user is attempting to provide an existing cluster.Instead, introducing a new option allows us to keep
Kubeconfig
just as it is: the file path to a kubeconfig.Deeper in the implementation, we actually take advantage of this by setting the
Kubeconfig
to the what is provided by a user when usingExistingClusterKubeconfig
. This enables existing program flow to stay in place without creating extra logic around a separate kubeconfig.Details for the Release Notes (PLEASE PROVIDE)
Which issue(s) this PR fixes
Fixes: #2890
Describe testing done for PR
Existing functionality intact, still able to create cluster and target it:
unmanaged-cluster
the kubeconfig as an option:Check the stats of the cluster:
Special notes for your reviewer
N/a