@@ -312,7 +312,12 @@ spec:
312312 - name : cudo-config
313313 mountPath : /root/.config/cudo
314314 readOnly : true
315- {{- end }}
315+ {{- end }}
316+ {{- if .Values.digitaloceanCredentials.enabled }}
317+ - name : digitalocean-config
318+ mountPath : /root/.config/doctl
319+ readOnly : true
320+ {{- end }}
316321 {{- if .Values.ociCredentials.enabled }}
317322 - name : oci-config
318323 mountPath : /root/.oci
@@ -530,6 +535,37 @@ spec:
530535 - name : cudo-config
531536 mountPath : /root/.config/cudo
532537 {{- end }}
538+ {{- if .Values.digitaloceanCredentials.enabled }}
539+ - name : create-digitalocean-credentials
540+ {{- with .Values.securityContext }}
541+ securityContext :
542+ {{- toYaml . | nindent 10 }}
543+ {{- end }}
544+ image : {{ .Values.apiService.image }}
545+ command : ["/bin/sh", "-c"]
546+ args :
547+ - |
548+ echo "Setting up DIGITALOCEAN credentials..."
549+ if [ -n "$DIGITALOCEAN_CREDENTIALS" ]; then
550+ echo "DIGITALOCEAN credentials found in environment variable."
551+ mkdir -p /.config/doctl
552+ cat > /.config/doctl/config.yaml <<EOF
553+ access-token: $DIGITALOCEAN_CREDENTIALS
554+ EOF
555+ else
556+ echo "DIGITALOCEAN credentials not found in environment variables. Skipping credentials setup."
557+ sleep 600
558+ fi
559+ env :
560+ - name : DIGITALOCEAN_CREDENTIALS
561+ valueFrom :
562+ secretKeyRef :
563+ name : {{ .Values.digitaloceanCredentials.digitaloceanSecretName }}
564+ key : config
565+ volumeMounts :
566+ - name : digitalocean-config
567+ mountPath : /.config/doctl
568+ {{- end }}
533569 {{- if .Values.ociCredentials.enabled }}
534570 - name : create-oci-credentials
535571 {{- with .Values.securityContext }}
@@ -663,6 +699,10 @@ spec:
663699 - name : cudo-config
664700 emptyDir : {}
665701 {{- end }}
702+ {{- if .Values.digitaloceanCredentials.enabled }}
703+ - name : digitalocean-config
704+ emptyDir : {}
705+ {{- end }}
666706 {{- if .Values.ociCredentials.enabled }}
667707 - name : oci-config
668708 emptyDir : {}
0 commit comments