Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/api/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ const (

NestedPodmanSCC = "nested-podman"
NestedPodmanClusterRole = "nested-podman-creater"

LeaseProxyServerPort = 8082
)

var (
Expand Down
2 changes: 2 additions & 0 deletions pkg/prowgen/jobbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ func NewProwJobBaseBuilderForTest(configSpec *cioperatorapi.ReleaseBuildConfigur
case test.MultiStageTestConfigurationLiteral != nil:
if clusterProfile := test.MultiStageTestConfigurationLiteral.ClusterProfile; clusterProfile != "" {
p.PodSpec.Add(LeaseClient())
p.PodSpec.Add(LeaseProxyServer())
p.WithLabel(cioperatorapi.CloudClusterProfileLabel, string(clusterProfile))
p.WithLabel(cioperatorapi.CloudLabel, clusterProfile.ClusterType())
}
Expand All @@ -158,6 +159,7 @@ func NewProwJobBaseBuilderForTest(configSpec *cioperatorapi.ReleaseBuildConfigur
case test.MultiStageTestConfiguration != nil:
if clusterProfile := test.MultiStageTestConfiguration.ClusterProfile; clusterProfile != "" {
p.PodSpec.Add(LeaseClient())
p.PodSpec.Add(LeaseProxyServer())
p.WithLabel(cioperatorapi.CloudClusterProfileLabel, string(clusterProfile))
p.WithLabel(cioperatorapi.CloudLabel, clusterProfile.ClusterType())
}
Expand Down
24 changes: 24 additions & 0 deletions pkg/prowgen/podspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ func addVolumeMount(container *corev1.Container, wantMount corev1.VolumeMount) e
return nil
}

func addPort(c *corev1.Container, name string, port int32) {
c.Ports = append(c.Ports, corev1.ContainerPort{
Name: name,
ContainerPort: port,
})
}

func makeSecretAddingMutator(secretName string) PodSpecMutator {
return func(spec *corev1.PodSpec) error {
safeName := strings.ReplaceAll(secretName, ".", "-")
Expand Down Expand Up @@ -460,6 +467,15 @@ var (
MountPath: "/etc/boskos",
ReadOnly: true,
}

leaseProxyServerEnv = corev1.EnvVar{
Name: "CI_OPERATOR_POD_IP",
ValueFrom: &corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "status.podIP",
},
},
}
)

// LeaseClient configures ci-operator to be able to interact with Boskos (lease
Expand All @@ -479,6 +495,14 @@ func LeaseClient() PodSpecMutator {

}

func LeaseProxyServer() PodSpecMutator {
return func(spec *corev1.PodSpec) error {
container := &spec.Containers[0]
addPort(container, "lease-proxy", cioperatorapi.LeaseProxyServerPort)
return addEnvVar(container, leaseProxyServerEnv)
}
}

var (
hiveSecretVolume = corev1.Volume{
Name: cioperatorapi.HiveControlPlaneKubeconfigSecret,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ spec:
- --target=simple
command:
- ci-operator
env:
- name: CI_OPERATOR_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
imagePullPolicy: Always
name: ""
ports:
- containerPort: 8082
name: lease-proxy
resources:
requests:
cpu: 10m
Expand Down