From 08a699b777df547523a5a9574e5bf07d2dd78d67 Mon Sep 17 00:00:00 2001 From: James Rasell Date: Mon, 18 May 2020 09:00:19 +0200 Subject: [PATCH] deps: update Nomad API dependancy to latest 0.11.2 release. --- go.mod | 5 ++--- go.sum | 10 ++++++---- plugins/builtin/target/nomad/plugin/state.go | 4 +--- plugins/builtin/target/nomad/plugin/state_test.go | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 208da45e..fa4938d5 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/hashicorp/go-multierror v1.0.0 github.com/hashicorp/go-plugin v1.0.1 github.com/hashicorp/hcl/v2 v2.3.0 - github.com/hashicorp/nomad/api v0.0.0-20200408184239-65bff323cf78 + github.com/hashicorp/nomad/api v0.0.0-20200514223145-f2210cedd9d6 github.com/kr/pretty v0.2.0 // indirect github.com/mattn/go-isatty v0.0.12 // indirect github.com/mitchellh/cli v1.0.0 @@ -20,8 +20,7 @@ require ( github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/prometheus/client_golang v1.5.1 github.com/prometheus/common v0.9.1 - github.com/stretchr/testify v1.4.0 + github.com/stretchr/testify v1.5.1 github.com/zclconf/go-cty v1.3.1 // indirect golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect ) diff --git a/go.sum b/go.sum index 9a7ab3f0..2f940b23 100644 --- a/go.sum +++ b/go.sum @@ -48,12 +48,12 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75 h1:f0n1xnMSmBLzVfsMMvriDyA75NB/oBgILX2GcHXIQzY= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/hashicorp/cronexpr v1.1.0 h1:dnNsWtH0V2ReN7JccYe8m//Bj14+PjJDntR1dz0Cixk= +github.com/hashicorp/cronexpr v1.1.0/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= @@ -70,8 +70,8 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/nomad/api v0.0.0-20200408184239-65bff323cf78 h1:ely9ExJEs9t8I+wZwtS1zC21efQc1bussa6UGQcZ9yQ= -github.com/hashicorp/nomad/api v0.0.0-20200408184239-65bff323cf78/go.mod h1:WKCL+tLVhN1D+APwH3JiTRZoxcdwRk86bWu1LVCUPaE= +github.com/hashicorp/nomad/api v0.0.0-20200514223145-f2210cedd9d6 h1:Sp9lwJLD841yaXWQCHcYojb73jV/ktjX0vA4DxFJeSM= +github.com/hashicorp/nomad/api v0.0.0-20200514223145-f2210cedd9d6/go.mod h1:DCi2k47yuUDzf2qWAK8E1RVmWgz/lc0jZQeEnICTxmY= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -151,6 +151,8 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.3.1 h1:QIOZl+CKKdkv4l2w3lG23nNzXgLoxsWLSEdg1MlX4p0= diff --git a/plugins/builtin/target/nomad/plugin/state.go b/plugins/builtin/target/nomad/plugin/state.go index 6117853e..5940f701 100644 --- a/plugins/builtin/target/nomad/plugin/state.go +++ b/plugins/builtin/target/nomad/plugin/state.go @@ -94,11 +94,9 @@ func (jsh *jobScaleStatusHandler) status(group string) (*target.Status, error) { // Hydrate the response object with the information we have collected that // is nil safe. - // TODO(jrasell) Currently "Running" is not populated in a tagged release: - // https://github.com/hashicorp/nomad/issues/7789 resp := target.Status{ Ready: !jsh.scaleStatus.JobStopped, - Count: int64(status.Healthy), + Count: int64(status.Running), Meta: map[string]string{ metaKeyPrefix + jsh.jobID + metaKeyJobStoppedSuffix: strconv.FormatBool(jsh.scaleStatus.JobStopped), }, diff --git a/plugins/builtin/target/nomad/plugin/state_test.go b/plugins/builtin/target/nomad/plugin/state_test.go index 026dde68..317a3c4b 100644 --- a/plugins/builtin/target/nomad/plugin/state_test.go +++ b/plugins/builtin/target/nomad/plugin/state_test.go @@ -63,7 +63,7 @@ func Test_jobStateHandler_status(t *testing.T) { scaleStatus: &api.JobScaleStatusResponse{ JobStopped: false, TaskGroups: map[string]api.TaskGroupScaleStatus{ - "this-does-exist": {Healthy: 7}, + "this-does-exist": {Running: 7}, }, }, }, @@ -84,7 +84,7 @@ func Test_jobStateHandler_status(t *testing.T) { scaleStatus: &api.JobScaleStatusResponse{ JobStopped: true, TaskGroups: map[string]api.TaskGroupScaleStatus{ - "this-does-exist": {Healthy: 7}, + "this-does-exist": {Running: 7}, }, }, },