Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #498
Implemented solution:
The
helm.py
module, responsible for the helm chart generation, is modified to include a detection of unused DBs.The
__clear_unused_db_configuration
contains the cleaning logic.First, the used db is identified using the
type
property of thedatabase
entry of the current configuration.All the DBs configurations are extracted relying on the fact that each DB entry always contains an
image
key and aports
key.The DBs configurations that are not used in the project are deleted.
Writing tests I saw that even if I remove the entries from the helm_values during the process, some are added back by the HarnessMainConfig at the end.
This is not a problem for the deployment/values.yaml generation as the file generation is performed before the instance of HarnessMainConfig is created, but it looks weird anyway.
How to test this PR:
Some tests are integrated with the PR.
To test the PR, it is possible to generate an app for a dedicated DB and check in the
values.yaml
that there is no other entries.The generation of the app:
Sanity checks:
Breaking changes (select one):
breaking-change
Possible deployment updates issues (select one):
alert:deployment
Test coverage (select one):
Documentation (select one):
Nice to have (if relevant):