-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(prefect-server): better support for internal and external databas…
…e configs (#365) * Create PostgreSQL Secret even if postgresql.enabled=false Ensures that the PostgreSQL Secret is created, even if `postgresql.enabled=false`. This ensures that we support a use case where folks want to use an external instance of PostgreSQL, but still want the Secret to automatically be generated with the proper connection string. With a recent change, we would skip creation of this secret if PostgreSQL was disabled which forced users to create a Secret themselves. This change now allows them to continue providing the `auth` values and letting the chart build the Secret with the correct connection string. Closes #358 * Remove custom config from postgresql subchart The `postgresql` key in `values.yaml` is for overriding the PostgreSQL chart's default values. It's not a good place to define custom keys because these are conflated with the actual configuration from the subchart. This changes removes those custom configs. It also removes any configured values that already matched the default from the PostgreSQL subchart, and were therefore not doing anything. * Support providing external connection string When the PostgreSQL subchart is disabled, we need a way to provide the connection string information for the external instance. This adds the required values and template helpers to calculate the connection string in this scenario. * Support setting name and creation of Secret - Supports setting the name to use for the Secret - Supports controlling whether or not to create the Secret - Supports someone providing their own existing Secret * Add helm unit tests for database configuration Uses https://github.com/helm-unittest/helm-unittest to unit test the database configuration. This is a replacement for coming up with test cases locally, running `helm template`, and manually validating the output. * Add script and CI workflow for helm-unittest - Adds script to run helm-unittest locally - Adds CI workflow to run helm-unittest in GitHub Actions * Update README for new external db configuration Updates the README to reflect the new configuration for external databases. * Add helm/chart-testing to mise Installs the helm/chart-testing binary at its latest version. Needed for the tests defined under `charts/<chart>/tests/test-*.yaml`. * Mention how to run the `helm-unittest` helper
- Loading branch information
1 parent
25129d3
commit bfe341a
Showing
12 changed files
with
322 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# https://github.com/marketplace/actions/helm-unit-tests | ||
|
||
name: Run Helm unit tests | ||
|
||
on: pull_request | ||
|
||
# Do not grant jobs any permissions by default | ||
permissions: {} | ||
|
||
jobs: | ||
unittest: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# required to read from the repo | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: d3adb5/helm-unittest-action@v2 | ||
with: | ||
helm-version: v3.15.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
helm-docs = '1.13.1' | ||
pre-commit = '3.7.1' | ||
helm = '3.15' | ||
helm-ct = '3.11.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,5 @@ | |
.idea/ | ||
*.tmproj | ||
.vscode/ | ||
# helm-unittest | ||
tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.