Skip to content

Commit f0f4584

Browse files
Fix chart linting issues in our helm chart (#445)
# Summary Whenever we raise a PR to the https://github.com/mongodb/helm-charts/ repo to release the helm chart, as part of the CI linting of the chart is done. And that linting fails because there are some issues in our chart. The issue is a space character at the end of this file [here](https://github.com/mongodb/mongodb-kubernetes/blob/1.3.0/helm_chart/Chart.yaml#L4). To get the PR in, in the `helm-charts` repo we just fixed the problem in that repo and didn't make the changes here in the MCK repo. This PR makes the change in MCK repo and in the next PR I am going to add chart linting as part of the lint_repo task so that we will always lint of charts. When we just go ahead and remove the trailing space from the mentioned line, our pre-commit hook doesn't pass. And the reason is when pre-commit hooks tries to update the version is chart.yaml [here](https://github.com/mongodb/mongodb-kubernetes/blob/1.3.0/scripts/evergreen/release/update_helm_values_files.py#L87), the library (`ruamel.yaml.YAML()`) that is used to update the yaml automatically adds a trailing space in [that line](https://github.com/mongodb/mongodb-kubernetes/blob/1.3.0/helm_chart/Chart.yaml#L4). So, in other words, even if we manually remove the trailing space, our CI complains that there are some files that are not added after running pre-commit, and when we run pre-commit, the extra trailing space is added automatically. To fix that problem we are slightly changing the way we were adding description to the chart.yaml, and now we are using the correct way of adding multi line values in a yaml file. ## Proof of Work ``` ct lint --charts=helm_chart/ vivek.s@M-HYXVRF7WDG Linting charts... Version increment checking disabled. ------------------------------------------------------------------------------------------------------------------------ Charts to be processed: ------------------------------------------------------------------------------------------------------------------------ mongodb-kubernetes => (version: "1.3.0", path: "helm_chart/") ------------------------------------------------------------------------------------------------------------------------ Linting chart "mongodb-kubernetes => (version: \"1.3.0\", path: \"helm_chart/\")" Validating helm_chart/Chart.yaml... Validation success! 👍 Validating maintainers... ==> Linting helm_chart/ 1 chart(s) linted, 0 chart(s) failed ------------------------------------------------------------------------------------------------------------------------ ✔︎ mongodb-kubernetes => (version: "1.3.0", path: "helm_chart/") ------------------------------------------------------------------------------------------------------------------------ All charts linted successfully ``` ## Checklist - [ ] Have you linked a jira ticket and/or is the ticket in the title? - [x] Have you checked whether your jira ticket required DOCSP changes? - [x] Have you added changelog file? - use `skip-changelog` label if not needed - refer to [Changelog files and Release Notes](https://github.com/mongodb/mongodb-kubernetes/blob/master/CONTRIBUTING.md#changelog-files-and-release-notes) section in CONTRIBUTING.md for more details
1 parent c16e4aa commit f0f4584

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

helm_chart/Chart.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
apiVersion: v2
22
name: mongodb-kubernetes
3-
description: MongoDB Controllers for Kubernetes translate the human knowledge of
4-
creating a MongoDB instance into a scalable, repeatable, and standardized
3+
description: |
4+
MongoDB Controllers for Kubernetes translate the human knowledge of
5+
creating a MongoDB instance into a scalable, repeatable, and standardized
56
method.
67
version: 1.3.0
78
kubeVersion: '>=1.16-0'

helm_chart/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ community:
213213
certificateKeySecretRef: tls-certificate
214214
caCertificateSecretRef: tls-ca-key-pair
215215
certManager:
216-
certDuration: 8760h # 365 days
217-
renewCertBefore: 720h # 30 days
216+
certDuration: 8760h # 365 days
217+
renewCertBefore: 720h # 30 days
218218

219219
# MongoDBSearch settings
220220
search:

0 commit comments

Comments
 (0)