runner/act
Earl Warren c2f91f63df fix: image credentials for services must not override container image credentials (#181)
- do not override username and password when looping over services
- split prepareJobContainer out of startJobContainer
- split getNetworkName out as it is used by both
- add unit tests for prepareJobContainer
- make containre.NewContainer mockable
- add MockVariable helper

Closes forgejo/runner#575

---

Note to reviewers: do not show whitespace change, the refactor will show in  a minimal way. When the fix is reverted the tests fail as follows:

```
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -81,4 +81,4 @@
        	            	   Image: (string) (len=10) "some:image",
        	            	-  Username: (string) (len=17) "containerusername",
        	            	-  Password: (string) (len=17) "containerpassword",
        	            	+  Username: (string) (len=16) "service2username",
        	            	+  Password: (string) (len=16) "service2password",
        	            	   Entrypoint: ([]string) (len=3) {
        	Test:       	TestStartJobContainer/Overlapping
```

Reviewed-on: https://code.forgejo.org/forgejo/act/pulls/181
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-07-15 20:55:38 +00:00
..
artifactcache Revert "fix: docker buildx cache restore not working" (#173) 2025-07-07 11:06:04 +00:00
artifacts fix: artifacts: format IP:port pair using net.JoinHostPort() 2025-06-01 12:10:47 +02:00
cacheproxy chore(refactor): add common.RandName to keep name generation DRY 2025-07-12 18:54:17 +02:00
common chore(refactor): add common.RandName to keep name generation DRY 2025-07-12 18:54:17 +02:00
container fix: image credentials for services must not override container image credentials (#181) 2025-07-15 20:55:38 +00:00
exprparser chore(lint): fix lint errors 2024-12-30 21:11:02 +00:00
filecollector [RDNF #18] Meta-copy-symlinks-new-actions-cache (#2337) (#159) 2025-07-02 13:48:12 +00:00
jobparser chore(tests): fix invalid jobparser tests 2025-07-11 14:12:22 +02:00
lookpath feat: Host environment (#1293) 2022-11-16 21:29:45 +00:00
model chore(docs): do not link to nektosact web page on validation error 2025-07-11 14:12:22 +02:00
runner fix: image credentials for services must not override container image credentials (#181) 2025-07-15 20:55:38 +00:00
schema feat: expressions in env can use the env context, that works 2025-07-12 17:46:16 +02:00
testutils fix: image credentials for services must not override container image credentials (#181) 2025-07-15 20:55:38 +00:00
workflowpattern feat: workflowpattern package (#1618) 2023-02-23 18:21:08 +00:00