You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Summary
Update:
Thanks to @MaciejKaras for the comment
[here](#487 (review))
and it looks like we were trying to lint the helm chart in parallel to
other jobs that were trying to update the helm chart. This PR tries to
change that and runs the helm chart linting after the updates to helm
chart are made by `update_jobs` job.
**Old Desc:**
The chart linting command that we run as part of lint_repo task
```
ct lint --charts="${PROJECT_DIR}/helm_chart/" \
--chart-yaml-schema "${PROJECT_DIR}/helm_chart/tests/schemas/chart_schema.yaml" \
--lint-conf "${PROJECT_DIR}/helm_chart/tests/schemas/lintconf.yaml"
```
seems to be flakey. It doesn't seem to fail regularly but we have seen
issues that are [reported
here](https://mongodb.slack.com/archives/CGLP6R2PQ/p1759148259540819).
If we look into the error
```
[ERROR] templates/: template: mongodb-kubernetes/templates/secret-config.yaml:1:14: executing "mongodb-kubernetes/templates/secret-config.yaml" at <.Values.operator.vaultSecretBackend>: nil pointer evaluating interface
```
It looks like `.Values` object that is passed to the template file
doesn't have the field `.Values.operator.vaultSecretBackend`. And the
only places where the values.yaml doesn't have `vaultSecretBackend`
defined are the files `values-openshift.yaml` and
`values-multi-cluster.yaml`.
And I suspect that
- Either these values files are merged and then passed to `helm
template`, and merge doesn't work properly and eventually
`.Values.operator` has the value that is defined in either
`values-openshift.yaml` or in `values-multi-cluster.yaml` (and it
doesn't have `vaultSecretBackend`).
- Or `helm template` is run using the other values.yaml files which
doesn't have `operator.vaultSecretBackend`. This is less likely because
this could have caused consistent failure in CI.
One option that I considered to fix this is explicitly passing just the
main values.yaml file to the `ct lint` command, using
`--helm-extra-args` flag, but that didn't resolve the issues. I was able
to reproduce it once if I ran 15 manual patches.
The other option was to have the `vaultSecretBackend` field in the other
values files as well. And this is what I have done in this PR. I am not
really sure if this actually fixed the problem but I was not able to
reproduce it in 20 manual patches. The other small change that this PR
does is, running `helm template` before running `ct lint` so that if the
test fails ever again we can check and see if `vaultSecretBackend` is
eventually generated in the template.
## Proof of Work
Output of successful run of `make precommit`:
https://gist.github.com/viveksinghggits/45a6f80f2b5b85d26d7d21dcc3dfb56c
Output of failed run of `make precommit`:
https://gist.github.com/viveksinghggits/7bb5a35e8bfe3a9be93e668ee8e734b9
Ran 20 manual evg patches and all of them are successful.
<img width="1451" height="1178" alt="image"
src="https://github.com/user-attachments/assets/39a5f46a-8ade-44ad-aff3-425bc5891e60"
/>
## Checklist
- [x] 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
0 commit comments