From ae5ff25d2003516514cef69e1e75285e4ca7b798 Mon Sep 17 00:00:00 2001 From: z4yx Date: Mon, 16 Mar 2020 21:11:15 +0800 Subject: [PATCH] in case rsyncEnv is nil --- worker/rsync_provider.go | 3 +++ worker/two_stage_rsync_provider.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/worker/rsync_provider.go b/worker/rsync_provider.go index 96c5316..a9fdfa1 100644 --- a/worker/rsync_provider.go +++ b/worker/rsync_provider.go @@ -51,6 +51,9 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) { if c.rsyncCmd == "" { provider.rsyncCmd = "rsync" } + if c.rsyncEnv == nil { + c.rsyncEnv = map[string]string{} + } if c.username != "" { c.rsyncEnv["USER"] = c.username } diff --git a/worker/two_stage_rsync_provider.go b/worker/two_stage_rsync_provider.go index bbade4b..48fcedc 100644 --- a/worker/two_stage_rsync_provider.go +++ b/worker/two_stage_rsync_provider.go @@ -70,6 +70,9 @@ func newTwoStageRsyncProvider(c twoStageRsyncConfig) (*twoStageRsyncProvider, er }, } + if c.rsyncEnv == nil { + c.rsyncEnv = map[string]string{} + } if c.username != "" { c.rsyncEnv["USER"] = c.username }