From 2acf60e44d80dfb7b77faa454eb93d20749f354c Mon Sep 17 00:00:00 2001 From: Isaac Hollander McCreery Date: Mon, 17 Apr 2017 17:05:33 -0700 Subject: [PATCH] When changing basic auth creds, just delete the whole file, in order to be able to rotate username in addition to password --- cluster/gce/gci/configure-helper.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 2d95bc5a355..4500df2cab1 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -287,9 +287,7 @@ function create-master-auth { local -r basic_auth_csv="${auth_dir}/basic_auth.csv" if [[ -n "${KUBE_PASSWORD:-}" && -n "${KUBE_USER:-}" ]]; then if [[ -e "${basic_auth_csv}" && "${METADATA_CLOBBERS_CONFIG:-false}" == "true" ]]; then - sed -i "/,${KUBE_USER},admin,system:masters$/d" "${basic_auth_csv}" - # The following is for the legacy form of the password line. - sed -i "/,${KUBE_USER},admin$/d" "${basic_auth_csv}" + rm "${basic_auth_csv}" fi replace_prefixed_line "${basic_auth_csv}" "${KUBE_PASSWORD},${KUBE_USER}," "admin,system:masters" fi