Refactor kubeconfig setup to use a temporary file and remove unnecessary directory creation
This commit is contained in:
@@ -64,12 +64,9 @@ setup_kubeconfig() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create .kube directory if it doesn't exist
|
|
||||||
mkdir -p $HOME/.kube
|
|
||||||
|
|
||||||
# Create temporary kubeconfig file from base64 encoded data
|
# Create temporary kubeconfig file from base64 encoded data
|
||||||
echo "Decoding kubeconfig..."
|
echo "Decoding kubeconfig..."
|
||||||
echo "$KUBECONFIG_DATA" | base64 -d > $HOME/.kube/config
|
echo "$KUBECONFIG_DATA" | base64 -d > /tmp/kubeconfig
|
||||||
|
|
||||||
# Set KUBECONFIG environment variable to use the temporary file
|
# Set KUBECONFIG environment variable to use the temporary file
|
||||||
export KUBECONFIG=/tmp/kubeconfig
|
export KUBECONFIG=/tmp/kubeconfig
|
||||||
|
|||||||
Reference in New Issue
Block a user