Skip to content

fix: stop discovery errors from halting chart rendering. - #6908

Merged
technosophos merged 1 commit into
helm:masterfrom
technosophos:fix/6361-discovery-errors
Nov 7, 2019
Merged

technosophos merged 1 commit into
helm:masterfrom
technosophos:fix/6361-discovery-errors

Conversation

@technosophos

Copy link
Copy Markdown
Member

This blocks a particular error (caused by upstream discovery client),
printing a warning instead of failing. It's not a great solution, but is
a stop-gap until Client-Go gets fixed.

Closes #6361

Signed-off-by: Matt Butcher [email protected]

@technosophos technosophos self-assigned this Nov 7, 2019
@helm-bot helm-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 7, 2019
@technosophos
technosophos force-pushed the fix/6361-discovery-errors branch from 0cda232 to 06474e3 Compare November 7, 2019 23:09
This blocks a particular error (caused by upstream discovery client),
printing a warning instead of failing. It's not a great solution, but is
a stop-gap until Client-Go gets fixed.

Closes helm#6361

Signed-off-by: Matt Butcher <[email protected]>
@technosophos
technosophos force-pushed the fix/6361-discovery-errors branch from 06474e3 to 193ff2b Compare November 7, 2019 23:10
@technosophos
technosophos merged commit 865c46c into helm:master Nov 7, 2019
@technosophos
technosophos deleted the fix/6361-discovery-errors branch November 7, 2019 23:16
Comment thread pkg/action/action.go
// Client-Go emits an error when an API service is registered but unimplemented.
// We trap that error here and print a warning. But since the discovery client continues
// building the API object, it is correctly populated with all valid APIs.
// See https://github.com/kubernetes/kubernetes/issues/72051#issuecomment-521157642

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kenperkins

Copy link
Copy Markdown
Contributor

I'm not entirely sure this fix is accurate. I've looked through the code and what is documented doesn't appear to be the case:

But since the discovery client continues building the API object, it is correctly populated with all valid APIs.

If you look at https://github.com/helm/helm/blob/master/pkg/action/action.go#L171 you see that any error from client.ServerGroupsAndResources returns the chartutil.DefaultVersionSet, not anything returned from client.ServerGroupsAndResources.

If you look at https://github.com/kubernetes/client-go/blob/bec269661e48cb1e5fbb0d037f356ffe9e9978a0/discovery/discovery_client.go#L254-L282, where the implementation is, it certainly fits the commented behavior, but since the implementation of GetVersionSet disregards the return value, I'm pretty sure this behavior doesn't work as expected.

@technosophos

Copy link
Copy Markdown
Member Author

@kenperkins In our testing, the line that returned the error in question is client.VersionSet(). Are you seeing the same problem as described in #6361 appearing still?

My intention wasn't to trap all cases of that error, but just the one causing #6361

@technosophos

Copy link
Copy Markdown
Member Author

Also, if you can provide a way to reproduce the error you are seeing, or even the error message that you are seeing, that would help us track down the issue.

@cofyc

cofyc commented Dec 2, 2019

Copy link
Copy Markdown
Contributor

can this be cherry-picked into helm 2.x branches?

@cofyc

cofyc commented Dec 2, 2019

Copy link
Copy Markdown
Contributor

This can fix the problem described in #6361, but another problem is it may return wrong capabilities because it fallbacks to use chartutil.DefaultVersionSet if the client returns GroupDiscoveryFailedError. If it is a problem, I guess we should build VersionSet on partial results returned by ServerGroupsAndResources if it failed to discovery some API groups.

@technosophos technosophos added this to the 3.0.2 milestone Dec 17, 2019
@technosophos technosophos added the picked Indicates that a PR has been cherry-picked into the next release candidate. label Dec 17, 2019
@technosophos

Copy link
Copy Markdown
Member Author

Picked into 3.0.2

deanrock pushed a commit to celtra/helm that referenced this pull request Dec 24, 2019
This blocks a particular error (caused by upstream discovery client),
printing a warning instead of failing. It's not a great solution, but is
a stop-gap until Client-Go gets fixed.

Closes helm#6361

Signed-off-by: Matt Butcher <[email protected]>
@sancyx

sancyx commented Mar 19, 2020

Copy link
Copy Markdown

Any plans to pick this fix in versions 2.15/2.16?

@bacongobbler

Copy link
Copy Markdown
Member

See #6361 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

picked Indicates that a PR has been cherry-picked into the next release candidate. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unable to retrieve the complete list of server APIs

8 participants