Skip to content

Commit ca3d18b

Browse files
Merge pull request #5947 from enxebre/kas-bootstrap-cpov2
CNTRLPLANE-378: Run kas-bootstrap binary for cpov2
2 parents 3ea3136 + 7dfe25f commit ca3d18b

File tree

4 files changed

+25
-100
lines changed

4 files changed

+25
-100
lines changed

control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents.yaml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -81,42 +81,17 @@ spec:
8181
topologyKey: kubernetes.io/hostname
8282
automountServiceAccountToken: false
8383
containers:
84-
- args:
85-
- -c
86-
- |
87-
#!/bin/sh
88-
function cleanup() {
89-
pkill -P $$$
90-
wait
91-
exit
92-
}
93-
trap cleanup SIGTERM
94-
while true; do
95-
if oc apply -f /work; then
96-
echo "Bootstrap manifests applied successfully."
97-
break
98-
fi
99-
sleep 1
100-
done
101-
while true; do
102-
if oc replace --subresource=status -f /work/99_feature-gate.yaml; then
103-
echo "FeatureGate status applied successfully."
104-
break
105-
fi
106-
sleep 1
107-
done
108-
while true; do
109-
sleep 1000 &
110-
wait $!
111-
done
112-
command:
113-
- /bin/bash
84+
- command:
85+
- /usr/bin/control-plane-operator
86+
- kas-bootstrap
87+
- --resources-path
88+
- /work
11489
env:
11590
- name: KUBECONFIG
11691
value: /var/secrets/localhost-kubeconfig/kubeconfig
117-
image: cli
92+
image: controlplane-operator
11893
imagePullPolicy: IfNotPresent
119-
name: apply-bootstrap
94+
name: bootstrap
12095
resources:
12196
requests:
12297
cpu: 10m
@@ -383,7 +358,7 @@ spec:
383358
featureGates: null
384359
image: cluster-config-api
385360
imagePullPolicy: IfNotPresent
386-
name: init-bootstrap
361+
name: init-bootstrap-render
387362
resources:
388363
requests:
389364
cpu: 30m

control-plane-operator/controllers/hostedcontrolplane/testdata/kube-apiserver/zz_fixture_TestControlPlaneComponents_TechPreviewNoUpgrade.yaml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -81,42 +81,17 @@ spec:
8181
topologyKey: kubernetes.io/hostname
8282
automountServiceAccountToken: false
8383
containers:
84-
- args:
85-
- -c
86-
- |
87-
#!/bin/sh
88-
function cleanup() {
89-
pkill -P $$$
90-
wait
91-
exit
92-
}
93-
trap cleanup SIGTERM
94-
while true; do
95-
if oc apply -f /work; then
96-
echo "Bootstrap manifests applied successfully."
97-
break
98-
fi
99-
sleep 1
100-
done
101-
while true; do
102-
if oc replace --subresource=status -f /work/99_feature-gate.yaml; then
103-
echo "FeatureGate status applied successfully."
104-
break
105-
fi
106-
sleep 1
107-
done
108-
while true; do
109-
sleep 1000 &
110-
wait $!
111-
done
112-
command:
113-
- /bin/bash
84+
- command:
85+
- /usr/bin/control-plane-operator
86+
- kas-bootstrap
87+
- --resources-path
88+
- /work
11489
env:
11590
- name: KUBECONFIG
11691
value: /var/secrets/localhost-kubeconfig/kubeconfig
117-
image: cli
92+
image: controlplane-operator
11893
imagePullPolicy: IfNotPresent
119-
name: apply-bootstrap
94+
name: bootstrap
12095
resources:
12196
requests:
12297
cpu: 10m
@@ -384,7 +359,7 @@ spec:
384359
featureGates: null
385360
image: cluster-config-api
386361
imagePullPolicy: IfNotPresent
387-
name: init-bootstrap
362+
name: init-bootstrap-render
388363
resources:
389364
requests:
390365
cpu: 30m

control-plane-operator/controllers/hostedcontrolplane/v2/assets/kube-apiserver/deployment.yaml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,17 @@ spec:
2020
app: kube-apiserver
2121
spec:
2222
containers:
23-
- args:
24-
- -c
25-
- |
26-
#!/bin/sh
27-
function cleanup() {
28-
pkill -P $$$
29-
wait
30-
exit
31-
}
32-
trap cleanup SIGTERM
33-
while true; do
34-
if oc apply -f /work; then
35-
echo "Bootstrap manifests applied successfully."
36-
break
37-
fi
38-
sleep 1
39-
done
40-
while true; do
41-
if oc replace --subresource=status -f /work/99_feature-gate.yaml; then
42-
echo "FeatureGate status applied successfully."
43-
break
44-
fi
45-
sleep 1
46-
done
47-
while true; do
48-
sleep 1000 &
49-
wait $!
50-
done
51-
command:
52-
- /bin/bash
23+
- command:
24+
- /usr/bin/control-plane-operator
25+
- kas-bootstrap
26+
- --resources-path
27+
- /work
5328
env:
5429
- name: KUBECONFIG
5530
value: /var/secrets/localhost-kubeconfig/kubeconfig
56-
image: cli
31+
image: controlplane-operator
5732
imagePullPolicy: IfNotPresent
58-
name: apply-bootstrap
33+
name: bootstrap
5934
resources:
6035
requests:
6136
cpu: 10m
@@ -282,7 +257,7 @@ spec:
282257
- /bin/bash
283258
image: cluster-config-api
284259
imagePullPolicy: IfNotPresent
285-
name: init-bootstrap
260+
name: init-bootstrap-render
286261
resources:
287262
requests:
288263
cpu: 30m

control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func updateBootstrapInitContainer(deployment *appsv1.Deployment, hcp *hyperv1.Ho
208208
}
209209
featureGateYaml := featureGateBuffer.String()
210210

211-
util.UpdateContainer("init-bootstrap", deployment.Spec.Template.Spec.InitContainers, func(c *corev1.Container) {
211+
util.UpdateContainer("init-bootstrap-render", deployment.Spec.Template.Spec.InitContainers, func(c *corev1.Container) {
212212
c.Env = append(c.Env,
213213
corev1.EnvVar{
214214
Name: "PAYLOAD_VERSION",

0 commit comments

Comments
 (0)