actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
76 stars 46 forks source link

Jobs fail when services are defined without ports #54

Closed claveaur closed 1 year ago

claveaur commented 1 year ago

Hi team,

After adding changes from #53, the runner start correctly with services when there is a port defined but not without any port.

Job ok with following workflow

Job ko with following workflow

Traces :

##[debug]Job pod is ready for traffic
##[debug]Setting isAlpine to true
Error: Object reference not set to an instance of an object.
##[debug]System.NullReferenceException: Object reference not set to an instance of an object.
##[debug]   at GitHub.Runner.Worker.Container.ContainerHooks.ContainerHookManager.UpdateJobContext(IExecutionContext context, ContainerInfo jobContainer, List`1 serviceContainers, PrepareJobResponse response)
##[debug]   at GitHub.Runner.Worker.Container.ContainerHooks.ContainerHookManager.PrepareJobAsync(IExecutionContext context, List`1 containers)
##[debug]   at GitHub.Runner.Worker.ContainerOperationProvider.StartContainersAsync(IExecutionContext executionContext, Object data)
##[debug]   at GitHub.Runner.Worker.JobExtensionRunner.RunAsync()
##[debug]   at GitHub.Runner.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
##[debug]Finishing: Initialize containers
claveaur commented 1 year ago

Here is a proposal for this : commit

nikola-jokic commented 1 year ago

Do you want to make a PR? :relaxed: And if you want, please add tests

Unfortunately, I can't see the workflow (probably a private repo)

claveaur commented 1 year ago

Unfortunately, I can't see the workflow (probably a private repo)

Oh sorry I changed it to public 👍

claveaur commented 1 year ago

I opened the PR @nikola-jokic, do not hesitate to reach me for it 😉