eks-anywhere icon indicating copy to clipboard operation
eks-anywhere copied to clipboard

feat(CLI): Add ValidateFileOrEnv function in kubeconfig package

Open ewollesen opened this issue 3 years ago • 3 comments

ValidateFileOrEnv validates a given kubeconfig filename, or, if and only if that filename is an empty string, falls back to a kubeconfig filename from the environment, and validates it.

This should be useful for CLI commands that want to find the first specified kubeconfig file that's fit to use.

While this isn't used yet, my next PR will use it. :)

Issue #, if available:

Description of changes:

Testing (if applicable):

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ewollesen avatar Sep 08 '22 21:09 ewollesen

Codecov Report

Merging #3309 (7553a55) into main (629d786) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #3309      +/-   ##
==========================================
+ Coverage   64.41%   64.44%   +0.02%     
==========================================
  Files         352      352              
  Lines       27980    28001      +21     
==========================================
+ Hits        18023    18044      +21     
  Misses       8648     8648              
  Partials     1309     1309              
Impacted Files Coverage Δ
pkg/kubeconfig/kubeconfig.go 95.34% <100.00%> (+4.43%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Sep 08 '22 21:09 codecov[bot]

/approve

ewollesen avatar Sep 08 '22 21:09 ewollesen

/approve /lgtm

a-cool-train avatar Sep 26 '22 22:09 a-cool-train

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-cool-train, ewollesen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • ~~OWNERS~~ [a-cool-train,ewollesen]

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

eks-distro-bot avatar Sep 26 '22 22:09 eks-distro-bot