-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add support of setting revisionHistoryLimit #386
Conversation
@@ -31,6 +31,9 @@ spec: | |||
{{- if not .Values.autoscaling.enabled }} | |||
replicas: {{ .Values.replicaCount }} | |||
{{- end }} | |||
{{- if not (has (quote .Values.revisionHistoryLimit) (list "" (quote ""))) }} |
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.
@MonkeyCanCode we just merged support for helm-unit. If you update your branch, maybe you could add a small unit test for this field? Especially for the logic around differentiating 0
from nil
or ""
. Thanks 🙏
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.
Nice. Will look into this later today.
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.
@adutra this had being added. I really like this approach with validating helm (compared to how I was doing it earlier via helm template). I can add the remaining test cases in for the next PR if there is no concern on your end and no one is already working on it.
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.
Excellent tests 👍
And OK to add missing test cases little by little.
@MonkeyCanCode I merged #409 before this one, which was probably a mistake. And now we have a conflict on this PR. Could you resolve the conflict please? I'll merge as soon as CI passes. |
Checking |
@adutra PR is fixed. What u did there is correct. The problem for the conflict is due to both MR making the same change to ingress.yaml (I fixed one thing there earlier for this PR...then one week later fix the same on the PR you just merged along with additional unit cases etc.). Here is the local test status: yong@DESKTOP:~/k8s/polaris(add_revisionHistoryLimit)$ helm unittest helm/polaris/ 2>&1 | grep -v 'symbolic link'
### Chart [ polaris ] helm/polaris/
PASS helm/polaris/tests/configmap_test.yaml
PASS helm/polaris/tests/deployment_test.yaml
PASS helm/polaris/tests/hpa_test.yaml
PASS helm/polaris/tests/ingress_test.yaml
PASS helm/polaris/tests/job_test.yaml
PASS helm/polaris/tests/service_test.yaml
PASS helm/polaris/tests/serviceaccount_test.yaml
Charts: 1 passed, 1 total
Test Suites: 7 passed, 7 total
Tests: 156 passed, 156 total
Snapshot: 0 passed, 0 total
Time: 408.283818ms |
Description
The current Helm chart doesn’t allow customization of the revisionHistoryLimit parameter, which is crucial for controlling the number of ReplicaSets retained for K8S deployment. This PR introduces the ability to set revisionHistoryLimit in the values file, defaulting to the standard value if not specified.
Also, I cleanup one comment in ingress.yaml which is not needed.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
When revisionHistoryLimit is not set:
When revisionHistoryLimit is set to 0:
When revisionHistoryLimit is set to 1:
Checklist:
Please delete options that are not relevant.