---
apiVersion: v1
kind: ConfigMap
metadata:
  name: stratum-startup-scripts
  labels:
    app: stratum
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    release: "{{ .Release.Name }}"
    heritage: "{{ .Release.Service }}"
data:
  stratum-startup: |
    #!/bin/sh
    set -e -x
    LOCAL_CHASSIS_CONFIG=$CFG_MOUNT/chassis_config.pb.txt
    if [ -f $LOCAL_CHASSIS_CONFIG ]; then
        /usr/bin/start-stratum.sh -enable_onlp=false -chassis_config_file=$LOCAL_CHASSIS_CONFIG {{ template "extraParams" .Values.extraParams }}
    else
        /usr/bin/start-stratum.sh -enable_onlp=false {{ template "extraParams" .Values.extraParams }}
    fi
