Ver Fonte

in case rsyncEnv is nil

z4yx há 5 anos atrás
pai
commit
ae5ff25d20
2 ficheiros alterados com 6 adições e 0 exclusões
  1. 3 0
      worker/rsync_provider.go
  2. 3 0
      worker/two_stage_rsync_provider.go

+ 3 - 0
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
 	}

+ 3 - 0
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
 	}