Skip to content

Commit

Permalink
[manifests] bugfix missing overwrites (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
chifu1234 authored Feb 11, 2021
1 parent 83b73d8 commit 195a1fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
8 changes: 2 additions & 6 deletions charts/manifests/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: manifests
description: "Bedag's Manifest chart. Library full of basic kubernetes manifests."
type: library
version: 0.5.0
version: 0.5.1
icon: "https://www.bedag.ch/wGlobal/wGlobal/layout/images/logo.svg"
keywords:
- Bedag
Expand All @@ -22,8 +22,4 @@ annotations:
artifacthub.io/prerelease: "false"
artifacthub.io/license: Apache-2.0
artifacthub.io/changes: |
- "[Added]: Support explicit chart.bundle template, for easier bundle declartion including documentation."
- "[Added]: Check were possible relevant YAML if it has any .Error field. Throw fail if detected."
- "[Changed]: Improved/Changed documentation with changed functionality/workflow."
- "[Fixed]: Handle empty Bundle Context causing Problems with Helm 3.5 (Function returned wrongly rendered YAML)"
- "[Removed]: Removed dedicated Values function for each manifest instead calling directly within the manifest"
- "[Fixed]: Add Overwrites to Bundle Extras"
6 changes: 5 additions & 1 deletion charts/manifests/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This library's purpose is to have more flexibility as chart author but at the sa
# Install Chart

Since this chart is of type [library](https://helm.sh/docs/topics/library_charts/) it can only be used as dependency for other charts. Just add it in your chart dependencies section:
The same goes for charts which are hosted in this helm repository. Since the manifests chart has further Dependencies, you need to include it via the repository.

```
dependencies:
Expand All @@ -23,13 +24,16 @@ dependencies:
repository: https://bedag.github.io/helm-charts/
```

If the chart is within this Github helm repository, you can reference it as local dependency
To develop locally on the manifest chart you can include the dependency locally, note that you have to include all manifests dependencies also.

```
dependencies:
- name: manifests
version: ">=1.0.0"
repository: "file://../manifests"
- name: library
version: ">=0.3.0"
repository: "https://buttahtoast.github.io/helm-charts/"
```

# Major Changes
Expand Down
15 changes: 8 additions & 7 deletions charts/manifests/templates/manifests/templates/_bundleExtras.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ limitations under the License.
*/}}
{{- define "bedag-lib.template.bundleExtras" -}}
{{- if and $.values (include "bedag-lib.utils.intern.noYamlError" $.values) $.context (include "bedag-lib.utils.intern.noYamlError" $.context) -}}
{{- if $.values.serviceAccount }}
{{- if and $.values.serviceAccount.enabled $.values.serviceAccount.create }}
---{{- include "bedag-lib.manifest.serviceaccount" (dict "values" $.values.serviceAccount "context" $.context) | nindent 0 }}
{{- $values := mergeOverwrite (dict) (default dict .values) (default dict .overwrites) -}}
{{- if and $values (include "bedag-lib.utils.intern.noYamlError" $values) $.context (include "bedag-lib.utils.intern.noYamlError" $.context) -}}
{{- if $values.serviceAccount }}
{{- if and $values.serviceAccount.enabled $values.serviceAccount.create }}
---{{- include "bedag-lib.manifest.serviceaccount" (dict "values" $values.serviceAccount "context" $.context) | nindent 0 }}
{{- end }}
{{- end }}
{{- if $.values.environment }}
{{- $environment := $.values.environment }}
{{- if $values.environment }}
{{- $environment := $values.environment }}
{{- if (include "bedag-lib.utils.environment.hasSecrets" $environment) }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ include "bedag-lib.utils.common.fullname" . }}-env
labels: {{- include "lib.utils.common.labels" (dict "labels" $.values.labels "context" $.context)| nindent 4 }}
labels: {{- include "lib.utils.common.labels" (dict "labels" $values.labels "context" $.context)| nindent 4 }}
type: Opaque
data:
{{- range $environment }}
Expand Down

0 comments on commit 195a1fc

Please sign in to comment.