From b87762966d0882eebcb1ab0ea2a59eb9fe9c203a Mon Sep 17 00:00:00 2001 From: Vinayak Goyal Date: Fri, 30 Apr 2021 11:23:14 -0700 Subject: [PATCH] Remove remnants of basic auth from cluster bootstrap. --- cluster/gce/gci/configure-helper.sh | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 0636ac053ff..53c280b0b7d 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -721,23 +721,10 @@ function create-master-pki { # After the first boot and on upgrade, these files exist on the master-pd # and should never be touched again (except perhaps an additional service # account, see NB below.) One exception is if METADATA_CLOBBERS_CONFIG is -# enabled. In that case the basic_auth.csv file will be rewritten to make -# sure it matches the metadata source of truth. +# enabled. function create-master-auth { echo "Creating master auth files" local -r auth_dir="/etc/srv/kubernetes" - 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 - # If METADATA_CLOBBERS_CONFIG is true, we want to rewrite the file - # completely, because if we're changing KUBE_USER and KUBE_PASSWORD, we - # have nothing to match on. The file is replaced just below with - # append_or_replace_prefixed_line. - rm "${basic_auth_csv}" - fi - append_or_replace_prefixed_line "${basic_auth_csv}" "${KUBE_PASSWORD},${KUBE_USER}," "admin,system:masters" - fi - local -r known_tokens_csv="${auth_dir}/known_tokens.csv" if [[ -e "${known_tokens_csv}" && "${METADATA_CLOBBERS_CONFIG:-false}" == "true" ]]; then rm "${known_tokens_csv}"