Skip to content

Commit

Permalink
Added extraDeploy array (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
grantbruneau authored Sep 2, 2023
1 parent c54e10c commit 890cd55
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Lint and Test Charts

on: pull_request


jobs:
lint-test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,14 +36,13 @@ jobs:
run: ct lint

- name: Create kind cluster
uses: helm/kind-action@v1.2.0
uses: helm/kind-action@v1.8.0
if: steps.list-changed.outputs.changed == 'true'

- name: Install LoadBalancer
run: |-
kubectl config use-context kind-chart-testing
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/namespace.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/metallb.yaml
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.10/config/manifests/metallb-native.yaml
kubectl apply -f .github/metallb-configmap.yaml
- name: Run chart-testing (install)
Expand Down
2 changes: 1 addition & 1 deletion charts/minecraft-bedrock/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: minecraft-bedrock
version: 2.1.0
version: 2.1.2
appVersion: SeeValues
home: https://minecraft.net/
description: Minecraft server
Expand Down
13 changes: 13 additions & 0 deletions charts/minecraft-bedrock/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "extraDeploy.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/minecraft-bedrock/templates/extra-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "extraDeploy.render" (dict "value" . "context" $) }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/minecraft-bedrock/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ initContainers: []
# - vers=4
extraVolumes: []

## Array of extra objects to deploy with the release
##
# extraDeploy:
# - |
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: {{ template "minecraft.fullname" . }}-extra-cm
# data:
# key: |-
# {
# "key": "value"
# }
extraDeploy: []

minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "FALSE"
Expand Down
2 changes: 1 addition & 1 deletion charts/minecraft/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: minecraft
version: 4.9.5
version: 4.9.6
appVersion: SeeValues
home: https://minecraft.net/
description: Minecraft server
Expand Down
15 changes: 14 additions & 1 deletion charts/minecraft/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,17 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
- name: {{ index . 0 }}
value: {{ index . 1 | quote }}
{{- end }}
{{- end }}
{{- end }}

{{- define "extraDeploy.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- if .scope }}
{{- tpl (cat "{{- with $.RelativeScope -}}" $value "{{- end }}") (merge (dict "RelativeScope" .scope) .context) }}
{{- else }}
{{- tpl $value .context }}
{{- end }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
4 changes: 4 additions & 0 deletions charts/minecraft/templates/extra-list.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "extraDeploy.render" (dict "value" . "context" $) }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/minecraft/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,22 @@ sidecarContainers: []
# - vers=4
extraVolumes: []


## Array of extra objects to deploy with the release
##
# extraDeploy:
# - |
# apiVersion: v1
# kind: ConfigMap
# metadata:
# name: {{ template "minecraft.fullname" . }}-extra-cm
# data:
# key: |-
# {
# "key": "value"
# }
extraDeploy: []

minecraftServer:
# This must be overridden, since we can't accept this for the user.
eula: "FALSE"
Expand Down

0 comments on commit 890cd55

Please sign in to comment.