some issue about exec-env
Summary
When use in k8s. mounted files are soft link file. /scripts/exec-env can't find the symbolic link file.
- soft link files by secrets mount
root@mypod:/etc/foo# ls -l
total 0
lrwxrwxrwx 1 root root 15 Apr 21 00:29 password -> ..data/password
lrwxrwxrwx 1 root root 15 Apr 21 00:29 username -> ..data/username
root@mypod:/etc/foo#
- exec-env source code
#!/bin/bash
ENVIRONMENT_DIR=/etc/gitlab/environment
if [ -d $ENVIRONMENT_DIR ]; then
# find all the files, export their content under their name.
for f in $(find -P $ENVIRONMENT_DIR -maxdepth 1 -type f) ; do
size=$(stat -c%s "$f")
if [ "$size" -gt 0 ]; then
export $(basename "$f")=$(cat "$f")
fi
done
fi
exec "$@"
Steps to reproduce
use exec-env in k8s.
Configuration used
Current behavior
/scripts/exec-env can't find the symbolic link file.
Expected behavior
/scripts/exec-env find the symbolic link file.
Versions
- Chart: (tagged version | branch | hash
git rev-parse HEAD
) - Platform:
- Cloud: (GKE | AKS | EKS | ?)
- Self-hosted: (OpenShift | Minikube | Rancher RKE | ?)
- Kubernetes: (
kubectl version
)- Client:
- Server:
- Helm: (
helm version
)- Client:
- Server:
Relevant logs
(Please provide any relevate log snippets you have collected, using code blocks (```) to format)
Edited by yuanxiongxiong