Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved error handling for kubeconfig errors #2599

Merged

Conversation

EronWright
Copy link
Contributor

@EronWright EronWright commented Oct 7, 2023

Proposed changes

This PR tightens the kubeconfig loading logic of the provider.

  1. Errors are not suppressed for the non-default provider (see Handle invalid kubeconfig context #960). The rationale is to stabilize the diff when the inputs are unprocessable, without breaking the invoke use-case.
  2. Use a non-interactive loader for the kubeconfig, since the provider is a non-interactive server (see original PR). The rationale is to be consistent with the (newer) Helm code.
  3. When the kubeconfig property is path-like, don't try to parse it as content. This improves the error message.

TODO: fix test: TestSkipUpdateUnreachableFlag

Related issues (optional)

@EronWright EronWright changed the base branch from master to eronwright/issue-2486 October 7, 2023 00:06
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@codecov-commenter
Copy link

Codecov Report

Merging #2599 (5be418f) into eronwright/issue-2486 (c52f572) will decrease coverage by 0.22%.
The diff coverage is 0.00%.

❗ Current head 5be418f differs from pull request most recent head a60ebd4. Consider uploading reports for the commit a60ebd4 to get more accurate results

@@                    Coverage Diff                    @@
##           eronwright/issue-2486    #2599      +/-   ##
=========================================================
- Coverage                  18.58%   18.37%   -0.22%     
=========================================================
  Files                         47       47              
  Lines                       9609     9610       +1     
=========================================================
- Hits                        1786     1766      -20     
- Misses                      7719     7745      +26     
+ Partials                     104       99       -5     
Files Coverage Δ
provider/pkg/provider/util.go 59.25% <0.00%> (ø)
provider/pkg/provider/provider.go 7.26% <0.00%> (-0.01%) ⬇️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@EronWright EronWright merged commit f715982 into eronwright/issue-2486 Oct 9, 2023
2 checks passed
@EronWright EronWright deleted the eronwright/kubeconfig-error-handling branch October 9, 2023 22:13
@EronWright EronWright changed the title Strict mode for provider kubeconfig handling Improved error handling for kubeconfig errors Oct 9, 2023
@EronWright
Copy link
Contributor Author

Sorry for any confusion about this PR, it was merged into a parent feature branch, see this PR: #2598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants