Tighten access rights even further
This commit is contained in:
parent
ae7b485bbf
commit
68bbd5fa0e
1 changed files with 2 additions and 1 deletions
3
ktx
3
ktx
|
@ -7,7 +7,8 @@ _create_file_and_switch() {
|
|||
NAMESPACE=${2}
|
||||
FILENAME="$HOME/.kube/ktx/${CONTEXT}_${NAMESPACE}.conf"
|
||||
KUBECONFIG= kubectl config view --minify --flatten --context ${CONTEXT} > ${FILENAME}
|
||||
chmod o-rwx ${FILENAME}
|
||||
# Only the user is allowed to read and write
|
||||
chmod u=rw,go-rwx ${FILENAME}
|
||||
export KUBECONFIG=${FILENAME}
|
||||
kubectl config set-context --current --namespace=${NAMESPACE}
|
||||
ln -sf ${FILENAME} ${CUR_FILE}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue