Skip to content

Commit

Permalink
fix kubeconfig permission
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdotcosta committed Apr 18, 2024
1 parent 08e6354 commit 9381dfa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions kind/kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -567,12 +567,12 @@ EOF
kind_get_clusters=$(${KIND_COMMAND} get clusters | { grep "${CLUSTER_NAME}" || test $? = 1; })
if [ ! "${kind_get_clusters}" == "" ]; then
note "1" "Cluster already exists..."
if [ "$USE_EXISTING_CLUSTER" == "y" ]; then
note "1" "...using existing cluster. Exporting cluster kubeconfig..."
note "5" "CMD: kind export kubeconfig -n ${CLUSTER_NAME}"
${KIND_COMMAND} export kubeconfig -n ${CLUSTER_NAME}
succeeded "1" "...done!"
else
if [ ! "$USE_EXISTING_CLUSTER" == "y" ]; then
# note "1" "...using existing cluster. Exporting cluster kubeconfig..."
# note "5" "CMD: kind export kubeconfig -n ${CLUSTER_NAME}"
# ${KIND_COMMAND} export kubeconfig -n ${CLUSTER_NAME}
# succeeded "1" "...done!"
# else
error "Cluster already exists. Either use the existing cluster (--use-existing-cluster) or delete the cluster (--delete-kind-cluster)."
exit 1
fi
Expand Down Expand Up @@ -619,6 +619,10 @@ EOF
note_start_task "2" "Export kubeconfig..."
${KIND_EXPORT_KC_CMD}
succeeded "2" "Export kubeconfig..."
if [ ${KUBECONFIG_GEN} == "y" ] && [ "${ROOTLESS_CONTAINERS}" == 'n' ]; then
chown $(whoami):$(whoami) ${KUBECONFIG_TGT}
# chmod 640 ${KUBECONFIG_TGT}
fi
set +e
note_start_task "2" "Connect the container registry to the kind network..."
${CRI_COMMAND} network connect "kind" ${REGISTRY_NAME}
Expand Down

0 comments on commit 9381dfa

Please sign in to comment.