mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Fix shellcheck lint errors in test/kubemark/resources/start-kubemark-master.sh
This commit is contained in:
parent
f72ac1f5b7
commit
adf4bf1741
@ -145,7 +145,6 @@
|
||||
./test/images/volume/rbd/create_block.sh
|
||||
./test/images/volume/rbd/mon.sh
|
||||
./test/images/volume/rbd/osd.sh
|
||||
./test/kubemark/resources/start-kubemark-master.sh
|
||||
./test/kubemark/run-e2e-tests.sh
|
||||
./test/kubemark/start-kubemark.sh
|
||||
./test/kubemark/stop-kubemark.sh
|
||||
|
@ -107,7 +107,7 @@ function find-attached-pd() {
|
||||
if [[ ! -e /dev/disk/by-id/${pd_name} ]]; then
|
||||
echo ""
|
||||
fi
|
||||
device_info=$(ls -l /dev/disk/by-id/${pd_name})
|
||||
device_info=$(ls -l "/dev/disk/by-id/${pd_name}")
|
||||
relative_path=${device_info##* }
|
||||
echo "/dev/disk/by-id/${relative_path}"
|
||||
}
|
||||
@ -288,9 +288,9 @@ function start-kubelet {
|
||||
#
|
||||
# $1 is the file to create.
|
||||
function prepare-log-file {
|
||||
touch $1
|
||||
chmod 644 $1
|
||||
chown root:root $1
|
||||
touch "$1"
|
||||
chmod 644 "$1"
|
||||
chown root:root "$1"
|
||||
}
|
||||
|
||||
# A helper function for copying addon manifests and set dir/files
|
||||
@ -301,10 +301,13 @@ function prepare-log-file {
|
||||
function setup-addon-manifests {
|
||||
local -r src_dir="${KUBE_ROOT}/$2"
|
||||
local -r dst_dir="/etc/kubernetes/$1/$2"
|
||||
|
||||
if [[ ! -d "${dst_dir}" ]]; then
|
||||
mkdir -p "${dst_dir}"
|
||||
fi
|
||||
local files=$(find "${src_dir}" -maxdepth 1 -name "*.yaml")
|
||||
|
||||
local files
|
||||
files=$(find "${src_dir}" -maxdepth 1 -name "*.yaml")
|
||||
if [[ -n "${files}" ]]; then
|
||||
cp "${src_dir}/"*.yaml "${dst_dir}"
|
||||
fi
|
||||
@ -508,7 +511,7 @@ function compute-kube-apiserver-params {
|
||||
params+=" --token-auth-file=/etc/srv/kubernetes/known_tokens.csv"
|
||||
params+=" --secure-port=443"
|
||||
params+=" --basic-auth-file=/etc/srv/kubernetes/basic_auth.csv"
|
||||
params+=" --target-ram-mb=$((${NUM_NODES} * 60))"
|
||||
params+=" --target-ram-mb=$((NUM_NODES * 60))"
|
||||
params+=" --service-cluster-ip-range=${SERVICE_CLUSTER_IP_RANGE}"
|
||||
params+=" --admission-control=${CUSTOM_ADMISSION_PLUGINS}"
|
||||
params+=" --authorization-mode=Node,RBAC"
|
||||
@ -598,7 +601,7 @@ function start-kubemaster-component() {
|
||||
local -r component=$1
|
||||
prepare-log-file /var/log/"${component}".log
|
||||
local -r src_file="${KUBE_ROOT}/${component}.yaml"
|
||||
local -r params=$(compute-${component}-params)
|
||||
local -r params=$("compute-${component}-params")
|
||||
|
||||
# Evaluate variables.
|
||||
sed -i -e "s@{{params}}@${params}@g" "${src_file}"
|
||||
@ -609,18 +612,18 @@ function start-kubemaster-component() {
|
||||
elif [ "${component}" == "kube-addon-manager" ]; then
|
||||
setup-addon-manifests "addons" "kubemark-rbac-bindings"
|
||||
else
|
||||
local -r component_docker_tag=$(cat ${KUBE_BINDIR}/${component}.docker_tag)
|
||||
local -r component_docker_tag=$(cat "${KUBE_BINDIR}/${component}.docker_tag")
|
||||
sed -i -e "s@{{${component}_docker_tag}}@${component_docker_tag}@g" "${src_file}"
|
||||
if [ "${component}" == "kube-apiserver" ]; then
|
||||
local audit_policy_config_mount=""
|
||||
local audit_policy_config_volume=""
|
||||
if [[ "${ENABLE_APISERVER_ADVANCED_AUDIT:-}" == "true" ]]; then
|
||||
read -d '' audit_policy_config_mount << EOF
|
||||
read -r -d '' audit_policy_config_mount << EOF
|
||||
- name: auditpolicyconfigmount
|
||||
mountPath: ${audit_policy_file}
|
||||
readOnly: true
|
||||
EOF
|
||||
read -d '' audit_policy_config_volume << EOF
|
||||
read -r -d '' audit_policy_config_volume << EOF
|
||||
- name: auditpolicyconfigmount
|
||||
hostPath:
|
||||
path: ${audit_policy_file}
|
||||
@ -669,7 +672,8 @@ fi
|
||||
main_etcd_mount_point="/mnt/disks/master-pd"
|
||||
mount-pd "google-master-pd" "${main_etcd_mount_point}"
|
||||
# Contains all the data stored in etcd.
|
||||
mkdir -m 700 -p "${main_etcd_mount_point}/var/etcd"
|
||||
mkdir -p "${main_etcd_mount_point}/var/etcd"
|
||||
chmod 700 "${main_etcd_mount_point}/var/etcd"
|
||||
ln -s -f "${main_etcd_mount_point}/var/etcd" /var/etcd
|
||||
mkdir -p /etc/srv
|
||||
# Setup the dynamically generated apiserver auth certs and keys to pd.
|
||||
@ -692,7 +696,8 @@ fi
|
||||
event_etcd_mount_point="/mnt/disks/master-event-pd"
|
||||
mount-pd "google-master-event-pd" "${event_etcd_mount_point}"
|
||||
# Contains all the data stored in event etcd.
|
||||
mkdir -m 700 -p "${event_etcd_mount_point}/var/etcd/events"
|
||||
mkdir -p "${event_etcd_mount_point}/var/etcd/events"
|
||||
chmod 700 "${event_etcd_mount_point}/var/etcd/events"
|
||||
ln -s -f "${event_etcd_mount_point}/var/etcd/events" /var/etcd/events
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user