mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Fix potential unbound KUBE_USER variable in gci/trusty.
This commit is contained in:
parent
6456d67bd0
commit
6d2c411757
@ -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
Block a user