diff --git a/charts/stable/homebridge/Chart.yaml b/charts/stable/homebridge/Chart.yaml index 1b3a8e37..8be78da8 100644 --- a/charts/stable/homebridge/Chart.yaml +++ b/charts/stable/homebridge/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: 4.0.0 +appVersion: "2022-04-28" description: A lightweight NodeJS server that emulates the iOS HomeKit API name: homebridge -version: 4.3.1 +version: 5.0.0 kubeVersion: ">=1.16.0-0" keywords: - homebridge @@ -21,5 +21,7 @@ dependencies: version: 4.3.0 annotations: artifacthub.io/changes: | - - kind: fixed - description: Set permissions for startup.sh to be executable + - kind: changed + description: "**BREAKING:** Moved startup script configuration to configMap.scripts key" + - kind: changed + description: Updated appVersion to 2022-04-28 diff --git a/charts/stable/homebridge/templates/common.yaml b/charts/stable/homebridge/templates/common.yaml index 77b2fd2a..23981370 100644 --- a/charts/stable/homebridge/templates/common.yaml +++ b/charts/stable/homebridge/templates/common.yaml @@ -2,17 +2,24 @@ {{- include "common.values.setup" . }} {{/* Append the configMap volume to the volumes */}} -{{- define "homebridge.configVolume" -}} -enabled: "true" -mountPath: "/homebridge/startup.sh" -subPath: "startup.sh" -type: "custom" -volumeSpec: - configMap: - name: {{ include "common.names.fullname" . }}-config - defaultMode: 0755 +{{- define "homebridge.harcodedValues" -}} + {{- if .Values.configmap.scripts.enabled }} + {{/* merge homebridge specific annotations with podAnnotations*/}} + podAnnotations: + configmap/checksum: "{{ .Values.configmap.scripts.data | toYaml | sha256sum }}" + + {{/* Append the configMap volume to the volumes */}} + persistence: + scripts: + enabled: true + type: "configMap" + name: "{{ printf "%v-scripts" (include "common.names.fullname" .) }}" + mountPath: "/homebridge/startup.sh" + subPath: "startup.sh" + defaultMode: 0755 + {{- end }} {{- end -}} -{{- $_ := set .Values.persistence "homebridge-config" (include "homebridge.configVolume" . | fromYaml) -}} +{{- $_ := mergeOverwrite .Values (include "homebridge.harcodedValues" . | fromYaml) -}} {{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/stable/homebridge/templates/configmap.yaml b/charts/stable/homebridge/templates/configmap.yaml deleted file mode 100644 index df774bc0..00000000 --- a/charts/stable/homebridge/templates/configmap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "common.names.fullname" . }}-config - labels: - {{- include "common.labels" . | nindent 4 }} -data: - startup.sh: | - {{- .Values.config | nindent 4 }} diff --git a/charts/stable/homebridge/values.yaml b/charts/stable/homebridge/values.yaml index 834e8634..8254be72 100644 --- a/charts/stable/homebridge/values.yaml +++ b/charts/stable/homebridge/values.yaml @@ -9,7 +9,8 @@ image: # -- image repository repository: ghcr.io/oznu/homebridge # -- image tag - tag: latest@sha256:4703dca68510307587361f4312e6bad0e765e85f8986a7517e0f393d8d0e2410 + # @default -- chart.appVersion + tag: # -- image pull policy pullPolicy: IfNotPresent @@ -49,26 +50,33 @@ persistence: enabled: false mountPath: /homebridge -# -- Custom startup.sh script to install additional packages in the container -# @default -- string -config: | - #!/bin/sh +configmap: + scripts: + # -- Enable custom homebridge startup script + enabled: false - # - # Docker Homebridge Custom Startup Script - oznu/homebridge - # - # This script can be used to customise the environment and will be executed as - # the root user each time the container starts. - # - # If using this to install plugins DO NOT use the global flag (-g). - # - # Example installing homebridge plugin: - # - # npm install homebridge-hue - # - # Example installing packages using default image (Alpine Linux): - # - # apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev - # - # If you're running a debian based version of this container please use apt-get to install packages. - # + data: + # -- Custom homebridge startup script contents + # @default -- See values.yaml + startup.sh: | + #!/bin/sh + + # + # Docker Homebridge Custom Startup Script - oznu/homebridge + # + # This script can be used to customise the environment and will be executed as + # the root user each time the container starts. + # + # If using this to install plugins DO NOT use the global flag (-g). + # + # Example installing homebridge plugin: + # + # npm install homebridge-hue + # + # Example installing packages using default image (Alpine Linux): + # + # apk add --no-cache ffmpeg ffmpeg-libs libpcap-dev + # + # If you're running a debian based version of this container please use apt-get to install packages. + # + echo "Started successfully."