Skip to content

Commit

Permalink
Install cifs-utils on existing nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
vpnachev committed Sep 25, 2020
1 parent 0ccb181 commit 35e69c9
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If multiple identifiers make sense you can also state the commands multiple time
/area TODO
/kind bug
/priority normal
/os gardenlinux
/os garden-linux

**What happened**:

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ If multiple identifiers make sense you can also state the commands multiple time
/area TODO
/kind enhancement
/priority normal
/os gardenlinux
/os garden-linux

**What would you like to be added**:

Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For Gardener Enhancement Proposals (GEPs), please check the following [documenta
/area TODO
/kind TODO
/priority normal
/os gardenlinux
/os garden-linux

**What this PR does / why we need it**:

Expand Down
2 changes: 1 addition & 1 deletion hack/update-github-templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ for file in `find "$(dirname $0)"/../vendor/github.com/gardener/gardener/.github
sed 's/to the Gardener project/for this extension/g' |\
sed 's/to Gardener/to this extension/g' |\
sed 's/- Gardener version:/- Gardener version (if relevant):\n- Extension version:/g' |\
sed 's/\/priority normal/\/priority normal\n\/os gardenlinux/g' \
sed 's/\/priority normal/\/priority normal\n\/os garden-linux/g' \
> "$(dirname $0)/../.github/${file#*.github/}"
done
17 changes: 12 additions & 5 deletions pkg/generator/templates/cloud-init.gardenlinux.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,24 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr
fi

{{- if .Bootstrap }}
{{- if isContainerDEnabled .CRI }}
systemctl enable containerd && systemctl restart containerd
{{- end }}
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils; do sleep 1; done
mount -o remount,ro ${PARTITION} /usr

mkdir -p /etc/docker
cat << EOF > /etc/docker/daemon.json
{ "storage-driver": "overlay2",
Expand Down
12 changes: 9 additions & 3 deletions pkg/generator/testfiles/cloud-init
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils; do sleep 1; done
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr

fi
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release
then
mkdir -p /etc/docker
cat << EOF > /etc/docker/daemon.json
{ "storage-driver": "overlay2",
Expand Down
14 changes: 10 additions & 4 deletions pkg/generator/testfiles/containerd-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,20 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload
systemctl enable containerd && systemctl restart containerd
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils; do sleep 1; done
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr

fi
systemctl enable containerd && systemctl restart containerd
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release
then
mkdir -p /etc/docker
cat << EOF > /etc/docker/daemon.json
{ "storage-driver": "overlay2",
Expand Down
11 changes: 11 additions & 0 deletions pkg/generator/testfiles/containerd-reconcile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr
fi
systemctl enable 'unit1' && systemctl restart 'unit1'
systemctl enable 'unit2' && systemctl restart 'unit2'
12 changes: 9 additions & 3 deletions pkg/generator/testfiles/docker-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils; do sleep 1; done
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr

fi
if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release
then
mkdir -p /etc/docker
cat << EOF > /etc/docker/daemon.json
{ "storage-driver": "overlay2",
Expand Down
11 changes: 11 additions & 0 deletions pkg/generator/testfiles/docker-reconcile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ grep -sq "^nfsd$" /etc/modules || echo "nfsd" >>/etc/modules
modprobe nfsd
nslookup $(hostname) || systemctl restart systemd-networkd
systemctl daemon-reload

if grep -q '^GARDENLINUX_BUILD_ID=27.[01]' /etc/os-release && ! dpkg-query --show cifs-utils &>/dev/null
then
PARTITION=$(mount -v | grep "^/.*/usr" | awk '{print $1}')
mount -o remount,rw ${PARTITION} /usr
until apt update -qq && apt install --no-upgrade -qqy cifs-utils
do
sleep 1
done
mount -o remount,ro ${PARTITION} /usr
fi
systemctl enable 'unit1' && systemctl restart 'unit1'
systemctl enable 'unit2' && systemctl restart 'unit2'

0 comments on commit 35e69c9

Please sign in to comment.