Updates after review

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
This commit is contained in:
Joakim Roubert 2020-05-16 14:30:39 +02:00 committed by Joakim Roubert
parent 4abf7da53e
commit 11f6d43747

View File

@ -302,7 +302,7 @@ function unique-uuid-bind-mount(){
# grep the exact match of actual device, prevents substring matching # grep the exact match of actual device, prevents substring matching
local myuuid local myuuid
myuuid=$(find -L /dev/disk/by-uuid -maxdepth 1 -samefile /dev/"${actual_device}" -printf "%P\n") myuuid=$(find -L /dev/disk/by-uuid -maxdepth 1 -samefile /dev/"${actual_device}" -printf '%P\n')
# myuuid should be the uuid of the device as found in /dev/disk/by-uuid/ # myuuid should be the uuid of the device as found in /dev/disk/by-uuid/
if [[ -z "${myuuid}" ]]; then if [[ -z "${myuuid}" ]]; then
echo "Failed to get a uuid for device ${actual_device} when mounting." >&2 echo "Failed to get a uuid for device ${actual_device} when mounting." >&2
@ -389,7 +389,7 @@ function ensure-local-ssds() {
for ssd in /dev/disk/by-id/google-local-ssd-*; do for ssd in /dev/disk/by-id/google-local-ssd-*; do
if [ -e "${ssd}" ]; then if [ -e "${ssd}" ]; then
local devicenum local devicenum
devicenum=$(echo "${ssd}" | sed -e 's@/dev/disk/by-id/google-local-ssd-\([0-9]*\)@\1@') devicenum="${ssd##*google-local-ssd-}"
if [[ "${i}" -lt "${scsiblocknum}" ]]; then if [[ "${i}" -lt "${scsiblocknum}" ]]; then
mount-ext "${ssd}" "${devicenum}" "scsi" "block" mount-ext "${ssd}" "${devicenum}" "scsi" "block"
else else
@ -420,7 +420,7 @@ function ensure-local-ssds() {
# the existing Google images does not expose NVMe devices in /dev/disk/by-id # the existing Google images does not expose NVMe devices in /dev/disk/by-id
if [[ $(udevadm info --query=property --name="${ssd}" | grep DEVTYPE | sed "s/DEVTYPE=//") == "disk" ]]; then if [[ $(udevadm info --query=property --name="${ssd}" | grep DEVTYPE | sed "s/DEVTYPE=//") == "disk" ]]; then
local devicenum local devicenum
devicenum=$(echo "${ssd}" | sed -e 's@/dev/nvme0n\([0-9]*\)@\1@') devicenum="${ssd##*nvme0n}"
if [[ "${i}" -lt "${nvmeblocknum}" ]]; then if [[ "${i}" -lt "${nvmeblocknum}" ]]; then
mount-ext "${ssd}" "${devicenum}" "nvme" "block" mount-ext "${ssd}" "${devicenum}" "nvme" "block"
else else
@ -515,7 +515,8 @@ function mount-master-pd {
# locations. # locations.
# Contains all the data stored in etcd. # Contains all the data stored in etcd.
install -d -m 700 "${mount_point}/var/etcd" mkdir -p "${mount_point}/var/etcd"
chmod 700 "${mount_point}/var/etcd"
ln -s -f "${mount_point}/var/etcd" /var/etcd ln -s -f "${mount_point}/var/etcd" /var/etcd
mkdir -p /etc/srv mkdir -p /etc/srv
# Contains the dynamically generated apiserver auth certs and keys. # Contains the dynamically generated apiserver auth certs and keys.
@ -2483,7 +2484,7 @@ EOF
fi fi
if [[ "${ENABLE_NODE_TERMINATION_HANDLER:-}" == "true" ]]; then if [[ "${ENABLE_NODE_TERMINATION_HANDLER:-}" == "true" ]]; then
setup-addon-manifests "addons" "node-termination-handler" setup-addon-manifests "addons" "node-termination-handler"
setup-node-termination-handler-manifest "$@" setup-node-termination-handler-manifest '' ''
fi fi
# Setting up the konnectivity-agent daemonset # Setting up the konnectivity-agent daemonset
if [[ "${ENABLE_EGRESS_VIA_KONNECTIVITY_SERVICE:-false}" == "true" ]]; then if [[ "${ENABLE_EGRESS_VIA_KONNECTIVITY_SERVICE:-false}" == "true" ]]; then
@ -2980,7 +2981,7 @@ function main() {
start-kube-controller-manager start-kube-controller-manager
start-kube-scheduler start-kube-scheduler
wait-till-apiserver-ready wait-till-apiserver-ready
start-kube-addons "$@" start-kube-addons ''
start-cluster-autoscaler start-cluster-autoscaler
start-lb-controller start-lb-controller
update-legacy-addon-node-labels & update-legacy-addon-node-labels &