Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

release: allow MaxHistory to be overriden for a HelmRelease #235

Merged
merged 1 commit into from
Jan 23, 2020

Conversation

stefansedich
Copy link
Contributor

Currently the --history-max=10 was hard-coded and not user configurable, this adds maxHistory to the HelmRelease CRD to allow a user to override this if desired.

@hiddeco hoping I got all the required bits this is my first CRD related PR let me know what I am missing.

Closes #224

Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Can you also add the CRD change in the Helm chart to make sure we do not forget about this later on?

pkg/release/release.go Outdated Show resolved Hide resolved
@stefansedich stefansedich force-pushed the v3-history-max branch 3 times, most recently from d99074a to bd7548c Compare January 21, 2020 22:51
@stefansedich
Copy link
Contributor Author

@hiddeco added to CRD I assume this was manual as I had done?

@stefansedich stefansedich force-pushed the v3-history-max branch 2 times, most recently from bf9490d to 79b9cef Compare January 21, 2020 22:57
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

Splendid! 🥇

Comment on lines 33 to 34
count=$(k get secret -n $DEMO_NAMESPACE --output name | grep 'sh.helm.release.v1.podinfo-helm-repository' | wc -l)
[ "$count" -le 10 ]
Copy link
Member

Choose a reason for hiding this comment

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

I think it is wiser to not use our human knowledge here about the configured storage mechanism but instead exec into the running container and use the helm3 binary there to get this information. This would make the end-to-end tests still succeed if for some reason the storage mechanism is configured differently.

I also think the stricter [ "$count" -eq 10 ] can be used, given we use poll_until_equals in the for loop and there should thus be no divergence due to e.g. the operator not being ready with processing.

Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for adding the end-to-end tests. ⭐

@hiddeco hiddeco changed the title release: allow MaxHistory to be overriden for a HelmRelease Merge pull request #235 from stefansedich/v3-history-max Jan 23, 2020
@hiddeco hiddeco merged commit 83c8f80 into fluxcd:master Jan 23, 2020
@hiddeco hiddeco changed the title Merge pull request #235 from stefansedich/v3-history-max release: allow MaxHistory to be overriden for a HelmRelease Jan 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helmrelease spec should contain --history-max for v3 releases
2 participants