From fe54db902779f350b08c4ab601e178d8d9a18c6c Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Thu, 15 Sep 2016 21:28:12 +0900 Subject: [PATCH 1/2] cadvisor: 0.10.1 -> 0.23.8 --- pkgs/servers/monitoring/cadvisor/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/monitoring/cadvisor/default.nix b/pkgs/servers/monitoring/cadvisor/default.nix index c0126fda5723..881a14b1117c 100644 --- a/pkgs/servers/monitoring/cadvisor/default.nix +++ b/pkgs/servers/monitoring/cadvisor/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { name = "cadvisor-${version}"; - version = "0.10.1"; + version = "0.23.8"; src = fetchFromGitHub { owner = "google"; repo = "cadvisor"; - rev = "${version}"; - sha256 = "0k0qfhw755k3ripsfkhml0ixaglhy64hdzxrjvlmbgc50s3j37vh"; + rev = "v${version}"; + sha256 = "0wan6a4rpyh5fflq88saznyf2kiic9nmj8sil1s49nh3c3y4yxcj"; }; buildInputs = [ go ]; From db387a6f0d2dee8e74dd150e175f06983646dad5 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Thu, 15 Sep 2016 21:28:41 +0900 Subject: [PATCH 2/2] cadvisor: fix test --- nixos/tests/cadvisor.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nixos/tests/cadvisor.nix b/nixos/tests/cadvisor.nix index c55b08c0e924..3a887514773a 100644 --- a/nixos/tests/cadvisor.nix +++ b/nixos/tests/cadvisor.nix @@ -13,10 +13,6 @@ import ./make-test.nix ({ pkgs, ... } : { services.cadvisor.enable = true; services.cadvisor.storageDriver = "influxdb"; services.influxdb.enable = true; - systemd.services.influxdb.postStart = mkAfter '' - ${pkgs.curl.bin}/bin/curl -X POST 'http://localhost:8086/db?u=root&p=root' \ - -d '{"name": "root"}' - ''; }; }; @@ -27,6 +23,15 @@ import ./make-test.nix ({ pkgs, ... } : { $machine->succeed("curl http://localhost:8080/containers/"); $influxdb->waitForUnit("influxdb.service"); + + # Wait until influxdb admin interface is available + $influxdb->waitUntilSucceeds("curl -f 127.0.0.1:8083"); + + # create influxdb database + $influxdb->succeed(q~ + curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root" + ~); + $influxdb->waitForUnit("cadvisor.service"); $influxdb->succeed("curl http://localhost:8080/containers/"); '';