-
Notifications
You must be signed in to change notification settings - Fork 705
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
Fix get release #781
Fix get release #781
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the test need to be changed as the error message is different now?
No, this is because the returned error by GRPC matches the previous one. I needed to change the updateRelease code though to remove the specific error handling for 404, which I am not sure why it is needed though since the UI takes into account the code returned not the message. |
helm.ReleaseListSort(int32(services.ListSort_LAST_RELEASED)), | ||
helm.ReleaseListOrder(int32(services.ListSort_DESC)), | ||
) | ||
release, err := p.helmClient.ReleaseContent(name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find. I am checking the current helm
code and it seems that the signature of the function is different:
https://github.com/helm/helm/blob/master/cmd/helm/get.go#L90
Is that because a newer version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it? I believe that it is the same. It seems to be a variadic function that accepts zero or more options
ReleaseContent(rlsName string, opts ...ContentOption) (*rls.GetReleaseContentResponse, error)
In Helm's get
CMD it passes the version but looking at the code I noticed that if you do not pass the version, the code returns the last one which is what we want https://github.com/helm/helm/blob/7cad59091a9451b2aa4f95aa882ea27e6b195f98/pkg/tiller/release_content.go#L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I didn't check the function definition
Changes the way we retrieve a single release name. Instead of listing all the releases and retrieving the last one, we use what Helm itself uses instead.
I have also imported a helper to extract error messages from GRPC so we can imitate what helm does without the need of having extra error handling.
Also note that this method does not require passing a namespace so changes will be made in further PRs
Refs #765