Skip to content

Disable docker's log rotation because it conflicts with gardener's #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion pkg/internal/templates/cloud-init.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,23 @@ mkdir -p '{{ $unit.DropIns.Path }}'

# Adjust docker config
file="/etc/docker/daemon.json"
dockerreload=false

# Change existing worker to use docker registry-mirror
if [ $(jq -r 'has("registry-mirrors")' "${file}") == "false" ]; then
contents=$(jq -M '. += {"registry-mirrors": ["https://mirror.gcr.io"]}' ${file})
echo "${contents}" > ${file}
dockerreload=true
fi

# Change existing worker to use docker registry-mirror
if [ $(jq -r 'has("live-restore")' "${file}") == "false" ]; then
contents=$(jq -M '. += {"live-reload": true}' ${file})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo ? live-restore ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed a typo.

echo "${contents}" > ${file}
dockerreload=true
fi

if [ $dockerreload == true ]; then
systemctl daemon-reload
systemctl reload docker
fi
Expand All @@ -60,7 +72,8 @@ if [ $(jq -r 'has("log-opts")' "${file}") == "true" ]; then
contents=$(jq 'del(."log-opts")' ${file})
echo "${contents}" > ${file}
systemctl daemon-reload
systemctl reload docker
# We need to restart docker because reloading it can not change logging configuration.
systemctl restart docker
fi

{{ if .Bootstrap -}}
Expand Down