@@ -29,6 +29,8 @@ type config struct {
2929 brokerLocation string
3030 runner string
3131 runnerHost string
32+ runnerRegistryUser string
33+ runnerRegistryPass string
3234 readwriter string
3335 readwriterLocation string
3436}
@@ -47,6 +49,8 @@ func New() {
4749 brokerLocation : "" ,
4850 runner : "docker" ,
4951 runnerHost : "unix:///var/run/docker.sock" ,
52+ runnerRegistryUser : "" ,
53+ runnerRegistryPass : "" ,
5054 readwriter : "memory" ,
5155 readwriterLocation : "" ,
5256 }
@@ -82,7 +86,7 @@ func New() {
8286 }
8387
8488 qs := os .Getenv ("QUEUES" )
85- if len (qs ) > 0 {
89+ if len (qs ) > 0 && instance . mode == "worker" {
8690 for _ , q := range strings .Split (qs , "," ) {
8791 q = strings .TrimSpace (q )
8892 if len (q ) == 0 {
@@ -132,6 +136,16 @@ func New() {
132136 instance .runnerHost = runnerHost
133137 }
134138
139+ runnerRegistryUser := os .Getenv ("RUNNER_REGISTRY_USER" )
140+ if len (runnerRegistryUser ) > 0 {
141+ instance .runnerRegistryUser = runnerRegistryUser
142+ }
143+
144+ runnerRegistryPass := os .Getenv ("RUNNER_REGISTRY_PASS" )
145+ if len (runnerRegistryPass ) > 0 {
146+ instance .runnerRegistryPass = runnerRegistryPass
147+ }
148+
135149 rw := os .Getenv ("READ_WRITER" )
136150 if len (rw ) > 0 {
137151 if _ , ok := readwriter .ReadWriterTypes [rw ]; ok {
@@ -240,6 +254,22 @@ func RunnerHost() string {
240254 return instance .runnerHost
241255}
242256
257+ func RunnerRegistryUser () string {
258+ if instance == nil {
259+ panic ("cfg is nil" )
260+ }
261+
262+ return instance .runnerRegistryUser
263+ }
264+
265+ func RunnerRegistryPass () string {
266+ if instance == nil {
267+ panic ("cfg is nil" )
268+ }
269+
270+ return instance .runnerRegistryPass
271+ }
272+
243273func ReadWriter () string {
244274 if instance == nil {
245275 panic ("cfg is nil" )
0 commit comments