Skip to content

Commit

Permalink
Preserve permissions of kubeconfig file (#42)
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Cormier <[email protected]>
  • Loading branch information
KevinFCormier authored May 18, 2021
1 parent 5c1cddc commit 1d7cd36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ function createContext {
local backup_user_kubeconfig="${user_kubeconfig}.backup-${timestamp}"
verbose 0 "Backing up $user_kubeconfig to $backup_user_kubeconfig"
cmd cp "$user_kubeconfig" "$backup_user_kubeconfig"
# Copy existing kubeconfig to .new to preserve permissions
cmd cp "$user_kubeconfig" "$new_user_kubeconfig"

# Remove pre-existing context and user from user kubeconfig
cmdTry oc config delete-context $context
Expand Down

0 comments on commit 1d7cd36

Please sign in to comment.