From 27118b21f8dd554747c48eec6016697530051641 Mon Sep 17 00:00:00 2001 From: "d.viti" Date: Wed, 8 Oct 2025 15:09:20 +0200 Subject: [PATCH] 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. --- .../templates/job-adc-sync.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/helm/api7ee-demo-k8s/templates/job-adc-sync.yaml b/helm/api7ee-demo-k8s/templates/job-adc-sync.yaml index 1c2135b..790aa26 100644 --- a/helm/api7ee-demo-k8s/templates/job-adc-sync.yaml +++ b/helm/api7ee-demo-k8s/templates/job-adc-sync.yaml @@ -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