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 }}
|
||||
containers:
|
||||
- name: adc-sync
|
||||
image: {{ .Values.api7.adc.image | default "ghcr.io/api7/adc:latest" }}
|
||||
imagePullPolicy: {{ .Values.api7.adc.imagePullPolicy | default "IfNotPresent" }}
|
||||
image: debian:bookworm-slim
|
||||
imagePullPolicy: IfNotPresent
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
@@ -53,12 +53,18 @@ spec:
|
||||
|
||||
# Install dependencies and ADC binary
|
||||
echo "Installing curl and dependencies..."
|
||||
if command -v apk &> /dev/null; then
|
||||
apk add --no-cache curl {{- if .Values.api7.autoPublish }} jq{{- end }}
|
||||
elif command -v apt-get &> /dev/null; then
|
||||
if [ -f /etc/debian_version ]; then
|
||||
# Debian/Ubuntu
|
||||
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 }}
|
||||
else
|
||||
echo "ERROR: Unsupported Linux distribution"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Download and install ADC binary
|
||||
|
||||
Reference in New Issue
Block a user