Add IN_CLUSTER setting to the kubernetes driver.
The kubernetes driver defaults KUBECONFIG to ~/.kube/config when not set. This prevents the incluster configuration from being used.
To preserve the existing behavior, I have added IN_CLUSTER which indicates that ambient kubernetes configuration should be used. This is intended for when the cnab process is running inside a pod.
Do not panic when setting driver config
Use the go, Luke. Return errors instead of throwing a panic. This is a breaking change to the driver API, but we aren't at 1.0 and avoiding panics seems worth it.
I didn't see a way to add a test for in-cluster without a ton of extra test infra that we don't have right now. If we are concerned that incluster config needs a test case, we will need to add a docker registry to our kind cluster, build a custom image with a fake cnab-go cli, push it to the kind registry and then run it as a pod. It didn't seem worth it just for this one test. 🤷♀️
Add IN_CLUSTER setting to the kubernetes driver. The kubernetes driver defaults KUBECONFIG to ~/.kube/config when not set. This prevents the incluster configuration from being used.
To preserve the existing behavior, I have added IN_CLUSTER which indicates that ambient kubernetes configuration should be used. This is intended for when the cnab process is running inside a pod.
I didn't see a way to add a test for in-cluster without a ton of extra test infra that we don't have right now. If we are concerned that incluster config needs a test case, we will need to add a docker registry to our kind cluster, build a custom image with a fake cnab-go cli, push it to the kind registry and then run it as a pod. It didn't seem worth it just for this one test. 🤷♀️