From f3d37e339c79a09d0b7bd5417543526022e12ebe Mon Sep 17 00:00:00 2001
From: Nicholas Nezis <nicholas.nezis@gmail.com>
Date: Mon, 18 Mar 2019 18:39:24 +0000
Subject: [PATCH] More updates to make `dataRoot` more generic

---
 production/ksonnet/README.md |  8 ++++----
 tools/promtail.sh            | 10 +++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/production/ksonnet/README.md b/production/ksonnet/README.md
index 9b3c6f66..a2f74ec6 100644
--- a/production/ksonnet/README.md
+++ b/production/ksonnet/README.md
@@ -45,12 +45,12 @@ promtail + {
       hostname: 'logs-us-west1.grafana.net',
       username: 'user-id',
       password: 'password',
-      dataroot: '/var/lib/docker',
+      container_root_path: '/var/lib/docker',
     },
   },
 }
 ```
-Notice that `dataroot` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it.
+Notice that `container_root_path` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it.
 
 Then do `ks show loki` to see the manifests that'll be deployed to your cluster.
 Apply them using `ks apply loki`.
@@ -82,14 +82,14 @@ loki + promtail + gateway {
       hostname: 'gateway.%(namespace)s.svc' % $._config,
       username: 'loki',
       password: 'password',
-      dataroot: '/var/lib/docker',
+      container_root_path: '/var/lib/docker',
     },
     replication_factor: 3,
     consul_replicas: 1,
   },
 }
 ```
-Notice that `dataroot` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it.
+Notice that `container_root_path` is your own data root for docker daemon, use `docker info | grep "Root Dir"` to get it.
 
 Do `ks show loki` to see the manifests being deployed to the cluster.
 Finally `ks apply loki` to deploy the server components to your cluster.
diff --git a/tools/promtail.sh b/tools/promtail.sh
index f51f981b..0a72fa9a 100644
--- a/tools/promtail.sh
+++ b/tools/promtail.sh
@@ -4,10 +4,10 @@ INSTANCEID="${1:-}"
 APIKEY="${2:-}"
 INSTANCEURL="${3:-}"
 NAMESPACE="${4:-default}"
-DATAROOT="${5-/var/lib/docker}"
+CONTAINERROOT="${5-/var/lib/docker}"
 
-if [ -z "$INSTANCEID" -o -z "$APIKEY" -o -z "$INSTANCEURL" -o -z "$NAMESPACE" -o -z "$DATAROOT" ]; then
-    echo "usage: $0 <instanceId> <apiKey> <url> <namespace> <dataroot>"
+if [ -z "$INSTANCEID" -o -z "$APIKEY" -o -z "$INSTANCEURL" -o -z "$NAMESPACE" -o -z "$CONTAINERROOT" ]; then
+    echo "usage: $0 <instanceId> <apiKey> <url> <namespace> <container_root_path>"
     exit 1
 fi
 
@@ -149,7 +149,7 @@ spec:
           path: /var/log
         name: varlog
       - hostPath:
-          path: <dataroot>/containers
+          path: <container_root_path>/containers
         name: varlibdockercontainers
   updateStrategy:
     type: RollingUpdate
@@ -197,4 +197,4 @@ echo "$TEMPLATE" | sed \
   -e "s#<apiKey>#${APIKEY}#" \
   -e "s#<instanceUrl>#${INSTANCEURL}#" \
   -e "s#<namespace>#${NAMESPACE}#" \
-  -e "s#<dataroot>#${DATAROOT}#"
+  -e "s#<container_root_path>#${CONTAINERROOT}#"
-- 
GitLab