mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #103004 from vinayakankugoyal/bug
remove the path if it exists before writing pki data.
This commit is contained in:
commit
6fdb5a8100
@ -626,6 +626,8 @@ function append_or_replace_prefixed_line {
|
|||||||
function write-pki-data {
|
function write-pki-data {
|
||||||
local data="${1}"
|
local data="${1}"
|
||||||
local path="${2}"
|
local path="${2}"
|
||||||
|
# remove the path if it exists
|
||||||
|
rm -f "${path}"
|
||||||
if [[ -n "${KUBE_PKI_READERS_GROUP:-}" ]]; then
|
if [[ -n "${KUBE_PKI_READERS_GROUP:-}" ]]; then
|
||||||
(umask 027; echo "${data}" | base64 --decode > "${path}")
|
(umask 027; echo "${data}" | base64 --decode > "${path}")
|
||||||
chgrp "${KUBE_PKI_READERS_GROUP:-}" "${path}"
|
chgrp "${KUBE_PKI_READERS_GROUP:-}" "${path}"
|
||||||
|
Loading…
Reference in New Issue
Block a user