Commit 1aaea5fe authored by Dawn Chen's avatar Dawn Chen Committed by GitHub

Merge pull request #29687 from cjcullen/customuser

Fix potential unbound KUBE_USER variable in gci/trusty.
parents 6456d67b 6d2c4117
......@@ -653,10 +653,12 @@ function start-kube-apiserver {
fi
local -r src_dir="${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty"
local -r abac_policy_json="${src_dir}/abac-authz-policy.jsonl"
remove-salt-config-comments "${abac_policy_json}"
sed -i -e "s@{{kube_user}}@${KUBE_USER}@g" "${abac_policy_json}"
cp "${abac_policy_json}" /etc/srv/kubernetes/
if [[ -n "${KUBE_USER:-}" ]]; then
local -r abac_policy_json="${src_dir}/abac-authz-policy.jsonl"
remove-salt-config-comments "${abac_policy_json}"
sed -i -e "s@{{kube_user}}@${KUBE_USER}@g" "${abac_policy_json}"
cp "${abac_policy_json}" /etc/srv/kubernetes/
fi
src_file="${src_dir}/kube-apiserver.manifest"
remove-salt-config-comments "${src_file}"
......
......@@ -558,10 +558,12 @@ start_kube_apiserver() {
src_dir="/home/kubernetes/kube-manifests/kubernetes/gci-trusty"
local -r abac_policy_json="${src_dir}/abac-authz-policy.jsonl"
remove_salt_config_comments "${abac_policy_json}"
sed -i -e "s@{{kube_user}}@${KUBE_USER}@g" "${abac_policy_json}"
cp "${abac_policy_json}" /etc/srv/kubernetes/
if [[ -n "${KUBE_USER:-}" ]]; then
local -r abac_policy_json="${src_dir}/abac-authz-policy.jsonl"
remove_salt_config_comments "${abac_policy_json}"
sed -i -e "s@{{kube_user}}@${KUBE_USER}@g" "${abac_policy_json}"
cp "${abac_policy_json}" /etc/srv/kubernetes/
fi
src_file="${src_dir}/kube-apiserver.manifest"
remove_salt_config_comments "${src_file}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment