zdt-argocd/argocd-cmp-server-wrapper.sh
Stefan Reimer 73e0319591
All checks were successful
ZeroDownTime/zdt-argocd/pipeline/head This commit looks good
ZeroDownTime/zdt-argocd/pipeline/tag This commit looks good
fix: actually wrap the cmp-server and not the repo-server
2025-06-23 10:58:43 +00:00

32 lines
677 B
Bash
Executable File

#!/bin/sh
KUBECONFIG=/tmp/kubectl.config
SA_NAME=argo-argocd-repo-server
CA64=$(cat /run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -w0)
TOKEN=$(cat /run/secrets/kubernetes.io/serviceaccount/token)
cat > $KUBECONFIG << EOF
apiVersion: v1
kind: Config
clusters:
- name: local
cluster:
server: https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT_HTTPS
certificate-authority-data: $CA64
users:
- name: $SA_NAME
user:
token: "$TOKEN"
contexts:
- name: ${SA_NAME}_context
context:
cluster: local
user: $SA_NAME
current-context: ${SA_NAME}_context
EOF
chmod 600 $KUBECONFIG
ARGOCD_BINARY_NAME=argocd-cmp-server /usr/local/bin/argocd $@