mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-14 08:36:45 +00:00
Ensure response consist no matter having ports or not. (#70)
* Ensure responseconsist no matter having ports or not. * Update packages/k8s/src/hooks/prepare-job.ts Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com> --------- Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com>
This commit is contained in:
@@ -125,12 +125,11 @@ function generateResponseFile(
|
|||||||
)
|
)
|
||||||
if (serviceContainers?.length) {
|
if (serviceContainers?.length) {
|
||||||
response.context['services'] = serviceContainers.map(c => {
|
response.context['services'] = serviceContainers.map(c => {
|
||||||
if (!c.ports?.length) {
|
|
||||||
return { image: c.image }
|
|
||||||
}
|
|
||||||
const ctxPorts: ContextPorts = {}
|
const ctxPorts: ContextPorts = {}
|
||||||
for (const port of c.ports) {
|
if (c.ports?.length) {
|
||||||
ctxPorts[port.containerPort] = port.hostPort
|
for (const port of c.ports) {
|
||||||
|
ctxPorts[port.containerPort] = port.hostPort
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user