mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-02 18:14:54 +00:00
@@ -134,6 +134,7 @@ func podContainer(step *types.Step, podName, goos string) (v1.Container, error)
|
||||
}
|
||||
|
||||
container.Env = mapToEnvVars(step.Environment)
|
||||
container.Ports = containerPorts(step.Ports)
|
||||
container.SecurityContext = containerSecurityContext(step.BackendOptions.Kubernetes.SecurityContext, step.Privileged)
|
||||
|
||||
container.Resources, err = resourceRequirements(step.BackendOptions.Kubernetes.Resources)
|
||||
@@ -198,6 +199,21 @@ func volumeMount(name, path string) v1.VolumeMount {
|
||||
}
|
||||
}
|
||||
|
||||
func containerPorts(ports []types.Port) []v1.ContainerPort {
|
||||
containerPorts := make([]v1.ContainerPort, len(ports))
|
||||
for i, port := range ports {
|
||||
containerPorts[i] = containerPort(port)
|
||||
}
|
||||
return containerPorts
|
||||
}
|
||||
|
||||
func containerPort(port types.Port) v1.ContainerPort {
|
||||
return v1.ContainerPort{
|
||||
ContainerPort: int32(port.Number),
|
||||
Protocol: v1.Protocol(strings.ToUpper(port.Protocol)),
|
||||
}
|
||||
}
|
||||
|
||||
// Here is the service IPs (placed in /etc/hosts in the Pod)
|
||||
func hostAliases(extraHosts []types.HostAlias) []v1.HostAlias {
|
||||
hostAliases := []v1.HostAlias{}
|
||||
|
Reference in New Issue
Block a user