Merge pull request #29687 from cjcullen/customuser

Fix potential unbound KUBE_USER variable in gci/trusty.
pull/6/head
Dawn Chen 2016-07-27 11:31:12 -07:00 committed by GitHub
commit 1aaea5fe09
2 changed files with 12 additions and 8 deletions

View File

@ -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}"

View 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}"