From 5d0c528147f054c735fe8766283bc46227a08e47 Mon Sep 17 00:00:00 2001 From: peteski22 Date: Tue, 4 Oct 2022 12:56:20 +0100 Subject: [PATCH] Ensure that nomad config is copied over when not nil --- .github/workflows/ci.yml | 2 +- config/config.go | 2 +- manager/runner_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed7aa10f3..cf357a3ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: with: go-version: ${{ matrix.go }} - - name: Install Consul and Vault for integration testing + - name: Install Consul, Vault and Nomad for integration testing run: | curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" diff --git a/config/config.go b/config/config.go index 0b3879680..8f8bb24af 100644 --- a/config/config.go +++ b/config/config.go @@ -173,7 +173,7 @@ func (c *Config) Copy() *Config { o.BlockQueryWaitTime = c.BlockQueryWaitTime if c.Nomad != nil { - o.Nomad = o.Nomad.Copy() + o.Nomad = c.Nomad.Copy() } return &o diff --git a/manager/runner_test.go b/manager/runner_test.go index 0fb162d29..3b20099b1 100644 --- a/manager/runner_test.go +++ b/manager/runner_test.go @@ -1155,8 +1155,8 @@ func TestRunner_command(t *testing.T) { case stderr.Len() > 0: t.Errorf("unexpected error output: %s", stderr.String()) case tc.out != stdout.String(): - t.Errorf("wrong command output\n got: '%#v'\nwanted: '%#v'", - stdout.String(), tc.out) + t.Errorf("wrong command output: %s \n got: '%#v'\nwanted: '%#v'", + tc.name, stdout.String(), tc.out) } } for i, tc := range []testCase{