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

Use dry-run to resolve manifest when rolling back #1133

Merged
merged 3 commits into from
Aug 22, 2019

Conversation

andresmgot
Copy link
Contributor

Follow up #997

After the feedback from @absoludity I checked that it's actually not necessary to send the chart details to tiller-proxy in order to retrieve the chart manifest that a release has.

We can get the changes we are going to perform if we run the rollback with the dry-run option.

I tested this manually and it works but there is not anything useful to test here since we are depending on the result from tiller.

Copy link
Contributor

@absoludity absoludity left a comment

Choose a reason for hiding this comment

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

Follow up #997

After the feedback from @absoludity I checked that it's actually not necessary to send the chart details to tiller-proxy in order to retrieve the chart manifest that a release has.

Great! Nice to see lots of code removed :)

We can get the changes we are going to perform if we run the rollback with the dry-run option.

Is this what helm get manifest does?

I tested this manually and it works but there is not anything useful to test here since we are depending on the result from tiller.

Hmm - I know what you mean... regarding testing the ResolveManifestFromRelease function, it doesn't seem useful to write a test which just confirms that a call to ResolveManifestFromRelease calls the fake proxy, trims and returns the result... but IMO the test isn't just to test the code you're adding here, it's also to make it easier for someone (possibly you :) ) in the future to modify that function and confirm it still behaves as expected. I'm +1 on adding a test (if you're keen, it's a chance to write a small table-based test showing that it will error if the release isn't found, and return the correct result if it is etc.) But not blocking on this :)

Regarding the handler test - I'm surprised existing handler tests don't fail - there seems to be tests there supporting rollbacks with chart details, yet you've replaced that code to instead just use the release? Even if they are validly passing (because the info is just not used) they should be updated to avoid confusion in the future imo.

@andresmgot
Copy link
Contributor Author

Is this what helm get manifest does?

They actually use a different method (but the result is the same):

https://github.com/helm/helm/blob/b0b0accdfc84e154b3d48ec334cd5b4f9b345667/cmd/helm/get_manifest.go#L75

I guess it makes more sense to use that.

I'm +1 on adding a test (if you're keen, it's a chance to write a small table-based test showing that it will error if the release isn't found, and return the correct result if it is etc.) But not blocking on this :)

Yes, I tried that. The problem was that the fake method to rollback the release didn't return anything so trying to access the manifest caused a segmentation fault. In the other hand, using ReleaseContent the fake behavior is better so I can test this.

Regarding the handler test - I'm surprised existing handler tests don't fail - there seems to be tests there supporting rollbacks with chart details, yet you've replaced that code to instead just use the release? Even if they are validly passing (because the info is just not used) they should be updated to avoid confusion in the future imo.

Yes, I missed that.

@andresmgot andresmgot merged commit e3cc60f into vmware-tanzu:master Aug 22, 2019
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