From 1ebb670141d4bd0b7eeb91874b52be85a6843291 Mon Sep 17 00:00:00 2001 From: elementyang Date: Sat, 17 Nov 2018 14:22:14 +0800 Subject: [PATCH] fix modify deprecated --graph flag --- inventory/sample/group_vars/all/docker.yml | 4 ++++ roles/kubespray-defaults/defaults/main.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/inventory/sample/group_vars/all/docker.yml b/inventory/sample/group_vars/all/docker.yml index c8b042a74..4e423b7a5 100644 --- a/inventory/sample/group_vars/all/docker.yml +++ b/inventory/sample/group_vars/all/docker.yml @@ -57,7 +57,11 @@ docker_options: >- {% if docker_registry_mirrors is defined -%} {{ docker_registry_mirrors | map('regex_replace', '^(.*)$', '--registry-mirror=\1' ) | list | join(' ') }} {%- endif %} + {%- if docker_version is version('17.05', '<') -%} --graph={{ docker_daemon_graph }} {{ docker_log_opts }} + {%- else -%} + --data-root={{ docker_daemon_graph }} {{ docker_log_opts }} + {%- endif %} {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 673fe2c68..307ad2a2c 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -213,7 +213,11 @@ docker_options: >- {% if docker_registry_mirrors is defined -%} {{ docker_registry_mirrors | map('regex_replace', '^(.*)$', '--registry-mirror=\1' ) | list | join(' ') }} {%- endif %} + {%- if docker_version is version('17.05', '<') -%} --graph={{ docker_daemon_graph }} {{ docker_log_opts }} + {%- else -%} + --data-root={{ docker_daemon_graph }} {{ docker_log_opts }} + {%- endif %} {%- if ansible_architecture == "aarch64" and ansible_os_family == "RedHat" %} --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd