Skip to content

Commit a3ea537

Browse files
committed
Grant access to file when SELinux is used
1 parent 3c90680 commit a3ea537

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

initdemo.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,13 @@ export TF_VAR_git_organization="octopuscac"
103103
if which minikube
104104
then
105105
# If the kube config file does not exist, we need to recreate the minikube cluster.
106-
# Because the file is in /tmp, it will get cleaned up automatically at some point.
107-
if [[ ! -f /tmp/octoconfig.yml ]]
106+
if [[ ! -f /$HOME/octoconfig.yml ]]
108107
then
109108
minikube delete
110109
fi
111110

112111
# KUBECONFIG is the environment variable that defines the path for a k8s config file for all k8s tooling
113-
export KUBECONFIG=/tmp/octoconfig.yml
112+
export KUBECONFIG=/$HOME/octoconfig.yml
114113

115114
# It is not uncommon for minikube to fail to start, especially if the docker stack and its network is started.
116115
# This retry loop will attempt to start minikube, and on failure to a hard cleanup and try again.
@@ -148,8 +147,8 @@ then
148147
CLUSTER_PORT="8443"
149148

150149
# Extract the client certificate data
151-
CLIENT_CERTIFICATE=$(docker run --rm -v /tmp:/workdir mikefarah/yq '.users[0].user.client-certificate' octoconfig.yml)
152-
CLIENT_KEY=$(docker run --rm -v /tmp:/workdir mikefarah/yq '.users[0].user.client-key' octoconfig.yml)
150+
CLIENT_CERTIFICATE=$(docker run --rm -v /$HOME/octoconfig.yml:/workdir/octoconfig.yml:Z mikefarah/yq '.users[0].user.client-certificate' octoconfig.yml)
151+
CLIENT_KEY=$(docker run --rm -v /$HOME/octoconfig.yml:/workdir/octoconfig.yml:Z mikefarah/yq '.users[0].user.client-key' octoconfig.yml)
153152

154153
# Create a self contained PFX certificate
155154
openssl pkcs12 -export -name 'test.com' -password 'pass:Password01!' -out /tmp/kind.pfx -inkey "${CLIENT_KEY}" -in "${CLIENT_CERTIFICATE}"

0 commit comments

Comments
 (0)