From 68fd8e8db1fb79120711c0cb291c1dc3ec397854 Mon Sep 17 00:00:00 2001 From: Oleg Atamanenko Date: Mon, 16 Nov 2020 13:23:14 -0800 Subject: [PATCH] Simplify Signed-off-by: Oleg Atamanenko --- .github/workflows/ci.yaml | 2 +- controllers/script_runner.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1303bd9a..620e29ff 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: uses: actions/checkout@v2 - name: Golangci-lint - uses: golangci/golangci-lint-action@v1 + uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.32 diff --git a/controllers/script_runner.go b/controllers/script_runner.go index bf13186a..227b401e 100644 --- a/controllers/script_runner.go +++ b/controllers/script_runner.go @@ -60,9 +60,7 @@ func (r *ScriptRunner) drainNode(nodeName string, ruObj *upgrademgrv1alpha1.Roll func (r *ScriptRunner) runScriptWithEnv(script string, background bool, ruObj *upgrademgrv1alpha1.RollingUpgrade, env []string) (string, error) { r.info(ruObj, "Running script", "script", script) command := exec.Command(ShellBinary, "-c", script) - if env != nil { - command.Env = append(os.Environ(), env...) - } + command.Env = append(os.Environ(), env...) if background { r.info(ruObj, "Running script in background. Logs not available.")