Updates to migrate from travis CI to GitHub Actions
@@ -32,7 +32,8 @@ setenforce 0
# Mount root to fix dns issues
# Define $HOME since somehow this is not defined
-HOME=/home/travis
+# Changed from travis to GH Actions agent default user
+HOME=/home/runner
sudo mount --make-rshared /
# Install conntrack (required by minikube/K8s 1.18+),
@@ -70,12 +71,12 @@ echo "Checking docker service"
sudo docker ps
echo "Download Kubernetes CLI"
-wget -O kubectl "http://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl"
+wget -q -O kubectl "http://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl"
sudo chmod +x kubectl
sudo mv kubectl /usr/local/bin/
echo "Download minikube from minikube project"
-wget -O minikube "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64"
+wget -q -O minikube "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64"
sudo chmod +x minikube
sudo mv minikube /usr/local/bin/
@@ -99,6 +100,18 @@ sudo minikube start --vm-driver=$MINIKUBE_DRIVER --bootstrapper=kubeadm --logtos
MINIKUBE_OK="false"
+# Adding below as CHANGE_MINIKUBE_NONE_USER=true is not helping
+echo "Copy root .minikube to $HOME"
+sudo cp -r /root/.minikube $HOME
+
+echo "Copy root .kube to $HOME"
+sudo cp -r /root/.kube $HOME
+
+sudo chown -R runner:runner $HOME/.kube $HOME/.minikube
+
+# Correct paths to make kubectl accessible without sudo
+sed 's/root/home\/runner/g' $KUBECONFIG > tmp; mv tmp $KUBECONFIG
+
echo "Waiting for minikube to start..."
# this for loop waits until kubectl can access the api server that Minikube has created
for i in {1..90}; do # timeout for 3 minutes
