Use debian:bookworm-slim image for adc-sync job
Update dependency installation logic to support Debian, Alpine, and RHEL/CentOS distributions. Add error handling for unsupported Linux distributions.
This commit is contained in:
@@ -42,8 +42,8 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: adc-sync
|
- name: adc-sync
|
||||||
image: {{ .Values.api7.adc.image | default "ghcr.io/api7/adc:latest" }}
|
image: debian:bookworm-slim
|
||||||
imagePullPolicy: {{ .Values.api7.adc.imagePullPolicy | default "IfNotPresent" }}
|
imagePullPolicy: IfNotPresent
|
||||||
command:
|
command:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
@@ -53,12 +53,18 @@ spec:
|
|||||||
|
|
||||||
# Install dependencies and ADC binary
|
# Install dependencies and ADC binary
|
||||||
echo "Installing curl and dependencies..."
|
echo "Installing curl and dependencies..."
|
||||||
if command -v apk &> /dev/null; then
|
if [ -f /etc/debian_version ]; then
|
||||||
apk add --no-cache curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
# Debian/Ubuntu
|
||||||
elif command -v apt-get &> /dev/null; then
|
|
||||||
apt-get update && apt-get install -y curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
apt-get update && apt-get install -y curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
||||||
elif command -v yum &> /dev/null; then
|
elif [ -f /etc/alpine-release ]; then
|
||||||
|
# Alpine
|
||||||
|
apk add --no-cache curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
||||||
|
elif [ -f /etc/redhat-release ]; then
|
||||||
|
# RHEL/CentOS
|
||||||
yum install -y curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
yum install -y curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
||||||
|
else
|
||||||
|
echo "ERROR: Unsupported Linux distribution"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download and install ADC binary
|
# Download and install ADC binary
|
||||||
|
|||||||
Reference in New Issue
Block a user