Skip to content

Commit

Permalink
Support array for entrypoint (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelldls authored Feb 4, 2025
1 parent cd64505 commit b1614da
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 13 deletions.
24 changes: 21 additions & 3 deletions Charts/ioc-instance/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,38 @@ spec:
- name: {{ .Release.Name }}
image: {{ .Values.image }}
command:
- {{ .Values.startCommand }}
{{- if (kindIs "string" .Values.startCommand) }}
- {{ .Values.startCommand }}
{{- else if (kindIs "slice" .Values.startCommand) }}
{{- .Values.startCommand | toYaml | nindent 8 }}
{{- end }}
args:
- {{ .Values.startArgs }}
{{- if (kindIs "string" .Values.startArgs) }}
- {{ .Values.startArgs }}
{{- else if (kindIs "slice" .Values.startArgs) }}
{{- .Values.startArgs | toYaml | nindent 8 }}
{{- end }}
livenessProbe:
exec:
command:
{{- if (kindIs "string" .Values.liveness) }}
- /bin/bash
- {{ .Values.liveness }}
{{- else if (kindIs "slice" .Values.liveness) }}
{{- .Values.liveness | toYaml | nindent 12 }}
{{- end }}
initialDelaySeconds: 120
periodSeconds: 10
lifecycle:
preStop:
exec:
command: ["bash", "-c", "{{ .Values.stop }}"]
command:
{{- if (kindIs "string" .Values.stop) }}
- /bin/bash
- {{ .Values.stop }}
{{- else if (kindIs "slice" .Values.stop) }}
{{- .Values.stop | toYaml | nindent 14 }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: {{ .Values.iocConfig }}
Expand Down
52 changes: 42 additions & 10 deletions Schemas/ioc-instance.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,56 @@
"default": "/epics/ioc/config"
},
"startCommand": {
"type": "string",
"description": "The command run as the entry point of the container.",
"default": "bash"
"description": "The command to run as the entry point of the container.",
"default": "bash",
"oneOf":[
{
"type": "string"
},
{
"type": "array",
"items": { "type": "string" }
}
]
},
"startArgs": {
"type": "string",
"description": "The arguments for the entry point of the container.",
"default": "/epics/ioc/start.sh"
"default": "/epics/ioc/start.sh",
"oneOf":[
{
"type": "string"
},
{
"type": "array",
"items": { "type": "string" }
}
]
},
"stop": {
"type": "string",
"description": "Script run before stopping the IOC",
"default": "/epics/ioc/stop.sh"
"default": "/epics/ioc/stop.sh",
"oneOf":[
{
"type": "string"
},
{
"type": "array",
"items": { "type": "string" }
}
]
},
"liveness": {
"type": "string",
"description": "Script for determining the liveness of the IOC",
"default": "/epics/ioc/liveness.sh"
"description": "A bash script for determining the liveness of the IOC or list of commands",
"default": "/epics/ioc/liveness.sh",
"oneOf":[
{
"type": "string"
},
{
"type": "array",
"items": { "type": "string" }
}
]
},
"globalEnv": {
"$ref": "https://kubernetesjsonschema.dev/v1.18.1/_definitions.json#/definitions/io.k8s.api.core.v1.Container/properties/env",
Expand Down

0 comments on commit b1614da

Please sign in to comment.