Skip to content
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

Support setting helm namespace in Bookfile #173

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Support setting helm namespace in Bookfile #173

merged 4 commits into from
Sep 27, 2023

Conversation

moensch
Copy link
Contributor

@moensch moensch commented Sep 27, 2023

Summary

Introduces a new config option into Bookfile.yaml to set the helm namespace since some charts consume .Release.Namespace in their templates.

Testing

If string is empty, reposerver will not append the --namespace parameter.

With namespace set

INFO[0001] Trace   args="[helm template . --name-template podinfo --namespace podinfo --values /tmp/4176594743/repo/chart/values-dev.yaml --include-crds]" dir=/tmp/4176594743/repo/chart operation_name="exec helm" time_ms=82.134863

Without

INFO[0002] Trace   args="[helm template . --name-template podinfo --values /tmp/876360118/repo/chart/values-dev.yaml --include-crds]" dir=/tmp/876360118/repo/chart operation_name="exec helm" time_ms=168.38142200000001

Example config

- pattern: env/(\w+)
  appConfigs:
    podinfo:
      configManagement:
        helm:
          releaseName: podinfo
          chartPath: chart
          namespace: podinfo
          valuesPaths:
          - chart/values-${1}.yaml
      outputPath: environments/${1}

Note

I did contemplate adding it as a cli flag first, but this seemed better suited (since it's not expected to change dynamically).

References

fixes #171

@netlify
Copy link

netlify bot commented Sep 27, 2023

Deploy Preview for docs-bookkeeper-akuity-io canceled.

Name Link
🔨 Latest commit 258bcfa
🔍 Latest deploy log https://app.netlify.com/sites/docs-bookkeeper-akuity-io/deploys/6514ae487a54250008ebf242

@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c345348) 37.26% compared to head (258bcfa) 37.33%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
+ Coverage   37.26%   37.33%   +0.07%     
==========================================
  Files          19       19              
  Lines        1146     1149       +3     
==========================================
+ Hits          427      429       +2     
- Misses        702      703       +1     
  Partials       17       17              
Files Coverage Δ
internal/helm/config.go 100.00% <ø> (ø)
rendering.go 48.48% <100.00%> (+0.63%) ⬆️
service.go 6.76% <ø> (ø)
internal/helm/helm.go 0.00% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Samuel Suter <samuel@suter.is>
@krancour
Copy link
Member

@moensch thanks for this! Great PR. Very thorough and much appreciated!

@krancour krancour merged commit 4ad4569 into akuity:main Sep 27, 2023
10 checks passed
@moensch moensch deleted the helm-namespace branch September 29, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

helm: Support setting namespace name
2 participants