Skip to content

Commit

Permalink
qa/tasks/kubeadm: modify (do not clobber) daemon.json
Browse files Browse the repository at this point in the history
Otherwise we blow away the mirror config.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Sep 15, 2021
1 parent 13238ad commit 2a6ad93
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions qa/tasks/kubeadm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import argparse
import contextlib
import ipaddress
import json
import logging
import random
import yaml
Expand Down Expand Up @@ -58,18 +59,18 @@ def preflight(ctx, config):
# set docker cgroup driver = systemd
# see https://kubernetes.io/docs/setup/production-environment/container-runtimes/#docker
# see https://github.com/kubernetes/kubeadm/issues/2066
daemon_json = """
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
"""
for remote in ctx.cluster.remotes.keys():
remote.write_file('/etc/docker/daemon.json', daemon_json, sudo=True)
try:
orig = remote.read_file('/etc/docker/daemon.json', sudo=True)
j = json.loads(orig)
except Exception as e:
log.info(f'Failed to pull old daemon.json: {e}')
j = {}
j["exec-opts"] = ["native.cgroupdriver=systemd"]
j["log-driver"] = "json-file"
j["log-opts"] = {"max-size": "100m"}
j["storage-driver"] = "overlay2"
remote.write_file('/etc/docker/daemon.json', json.dumps(j), sudo=True)
run.wait(
ctx.cluster.run(
args=[
Expand Down

0 comments on commit 2a6ad93

Please sign in to comment.