mirror of https://github.com/k3s-io/k3s
Merge pull request #29687 from cjcullen/customuser
Fix potential unbound KUBE_USER variable in gci/trusty.pull/6/head
commit
1aaea5fe09
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue