@@ -36,23 +36,25 @@ RUN curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get | bas
36
36
# Copy localhost's ~/.kube/config file into the container and swap out localhost
37
37
# for host.docker.internal whenever a new shell starts to keep them in sync.
38
38
RUN echo '\n \
39
- if [ "$SYNC_LOCALHOST_KUBECONFIG" == "true" ]; then\n \
40
- mkdir -p $HOME/.kube\n \
41
- cp -r $HOME/.kube-localhost/* $HOME/.kube\n \
42
- sed -i -e "s/localhost/host.docker.internal/g" $HOME/.kube/config;\n \
43
- fi' \
39
+ mkdir -p $HOME/.kube\n \
40
+ cp -r $HOME/.kube-localhost/* $HOME/.kube\n \
41
+ sed -i -e "s/localhost/host.docker.internal/g" $HOME/.kube/config' \
44
42
>> $HOME/.bashrc
45
43
46
44
# Copy localhost's minikube certificate file into the container and swap out localhost
47
45
RUN echo '\n \
48
- if [ "$SYNC_LOCALHOST_MINIKUBE" == "true" ]; then \n \
49
- mkdir -p $HOME/.minikube\n \
46
+ mkdir -p $HOME/.minikube \n \
47
+ if [[ -f " $HOME/.minikube-localhost/ca.crt" ]]; then \n \
50
48
cp -r $HOME/.minikube-localhost/ca.crt $HOME/.minikube\n \
49
+ sed -i -r "s|(\s *certificate-authority:\s ).*|\\ 1$HOME\/ .minikube\/ ca.crt|g" $HOME/.kube/config\n \
50
+ fi\n \
51
+ if [[ -f "$HOME/.minikube-localhost/client.crt" ]]; then\n \
51
52
cp -r $HOME/.minikube-localhost/client.crt $HOME/.minikube\n \
52
- cp -r $HOME/.minikube-localhost/client.key $HOME/.minikube\n \
53
- sed -i -r "s|(\s *client-key:\s ).*|\\ 1$HOME\/ .minikube\/ client.key|g" $HOME/.kube/config;\n \
54
53
sed -i -r "s|(\s *client-certificate:\s ).*|\\ 1$HOME\/ .minikube\/ client.crt|g" $HOME/.kube/config\n \
55
- sed -i -r "s|(\s *certificate-authority:\s ).*|\\ 1$HOME\/ .minikube\/ ca.crt|g" $HOME/.kube/config;\n \
54
+ fi\n \
55
+ if [[ -f "$HOME/.minikube-localhost/client.key" ]]; then\n \
56
+ cp -r $HOME/.minikube-localhost/client.key $HOME/.minikube\n \
57
+ sed -i -r "s|(\s *client-key:\s ).*|\\ 1$HOME\/ .minikube\/ client.key|g" $HOME/.kube/config\n \
56
58
fi' \
57
59
>> $HOME/.bashrc
58
60
0 commit comments