Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing default KUBECONFIG ordering
This commit aims to make aware `eksctl` of the `KUBECONFIG` environment variable, especially during cluster creation and kubeconfig retrieval via the `eksctl utils write-kubeconfig` command. To avoid conflicts and keep the actual convention, the variable `DefaultPath` has been declared using a simple _func_ in order to don't perform an invasive refactoring requested by a switch to function declaration. Actually, using the standard library to retrieve the environment variable and not using the `viper` helper (although already a dependency) since the `KUBECONFIG` one is considered as a global one, so totally unbounded from `eksctl`. Code coverage is going to decrease since during the test suite setup, the environment variable is evaluated before the execution of tests: to provide further coverage, the conversion from variable to function has to be performed, although this requires some changes in the following files and should be considered and approved by maintainers: - pkg/ctl/cmdutils/cmdutils.go - pkg/ctl/create/cluster.go - pkg/ctl/utils/write_kubeconfig.go - pkg/utils/kubeconfig/kubeconfig.go Closes eksctl-io#228
- Loading branch information