Merge pull request #103004 from vinayakankugoyal/bug

remove the path if it exists before writing pki data.
This commit is contained in:
Kubernetes Prow Robot 2021-06-18 16:42:54 -07:00 committed by GitHub
commit 6fdb5a8100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -626,6 +626,8 @@ function append_or_replace_prefixed_line {
function write-pki-data {
local data="${1}"
local path="${2}"
# remove the path if it exists
rm -f "${path}"
if [[ -n "${KUBE_PKI_READERS_GROUP:-}" ]]; then
(umask 027; echo "${data}" | base64 --decode > "${path}")
chgrp "${KUBE_PKI_READERS_GROUP:-}" "${path}"