Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
use non-root folder to create apply-license script (#880)
Browse files Browse the repository at this point in the history
Use /tmp/scripts folder instead of the WORKDIR which is / to avoid getting permission denied errors when security context defaults to the non-root user
  • Loading branch information
osdemah committed Mar 31, 2021
1 parent 6bac7c4 commit 3b631ad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions templates/enterprise-license-job.yaml
Expand Up @@ -77,7 +77,8 @@ spec:
- "-c"
- |
# Create a script that we can execute with the timeout command.
cat > apply-license.sh << 'EOF'
mkdir -p /tmp/scripts/
cat > /tmp/scripts/apply-license.sh << 'EOF'
#!/bin/sh
while true; do
echo "Applying license..."
Expand All @@ -89,10 +90,10 @@ spec:
sleep 2
done
EOF
chmod +x ./apply-license.sh
chmod +x /tmp/scripts/apply-license.sh
# Time out after 20 minutes. Use || to support new timeout versions that don't accept -t
timeout -t 1200 ./apply-license.sh 2> /dev/null || timeout 1200 ./apply-license.sh 2> /dev/null
timeout -t 1200 /tmp/scripts/apply-license.sh 2> /dev/null || timeout 1200 /tmp/scripts/apply-license.sh 2> /dev/null
{{- if .Values.global.tls.enabled }}
volumeMounts:
- name: consul-ca-cert
Expand Down

0 comments on commit 3b631ad

Please sign in to comment.