Skip to content

Commit 535ab1d

Browse files
wainersmstevenhorsman
authored andcommitted
ci: build peerpod-ctrl and webhook images in nightly e2e
After the kustomize-to-helm migration, nightly e2e tests deploy peerpod-ctrl and webhook as sub-charts but use stale `latest` images from quay.io. Since peerpod-ctrl shares the cloud-providers Go module with caa, version skew can mask breaking changes. Build both images alongside caa/podvm in the nightly pipeline and wire their references through to the helm install via PEERPOD_CTRL_IMAGE and WEBHOOK_IMAGE environment variables. The subchart image override logic is centralized in Helm.ConfigureSubchartImages() to avoid duplicating code across all provider implementations. Assisted-by: Claude Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
1 parent c41cd11 commit 535ab1d

15 files changed

Lines changed: 166 additions & 7 deletions

File tree

.github/workflows/e2e_aws.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ on:
1818
description: Git ref to checkout the cloud-api-adaptor repository. Defaults to main.
1919
required: false
2020
type: string
21+
peerpod_ctrl_image:
22+
description: The peerpod-ctrl OCI image (including tag)
23+
required: false
24+
default: ''
25+
type: string
26+
webhook_image:
27+
description: The peer-pods-webhook OCI image (including tag)
28+
required: false
29+
default: ''
30+
type: string
2131
cluster_type:
2232
description: Specify the cluster type. Accepted values are "onprem" or "eks".
2333
default: onprem
@@ -70,8 +80,10 @@ jobs:
7080
CAA_IMAGE: "${{ inputs.caa_image }}"
7181
CLUSTER_TYPE: "${{ inputs.cluster_type }}"
7282
CONTAINER_RUNTIME: "${{ inputs.container_runtime }}"
83+
PEERPOD_CTRL_IMAGE: "${{ inputs.peerpod_ctrl_image }}"
7384
PODVM_IMAGE: "${{ inputs.podvm_image }}"
7485
RESOURCES_BASENAME: "ci-caa-${{ github.run_id }}-${{ github.run_attempt }}"
86+
WEBHOOK_IMAGE: "${{ inputs.webhook_image }}"
7587
permissions:
7688
id-token: write # Required by aws-actions/configure-aws-credentials
7789
contents: read # Required by aws-actions/configure-aws-credentials

.github/workflows/e2e_byom.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ on:
1313
caa_image:
1414
type: string
1515
required: true
16+
peerpod_ctrl_image:
17+
description: The peerpod-ctrl OCI image (including tag)
18+
required: false
19+
default: ''
20+
type: string
21+
webhook_image:
22+
description: The peer-pods-webhook OCI image (including tag)
23+
required: false
24+
default: ''
25+
type: string
1626
git_ref:
1727
default: 'main'
1828
description: Git ref to checkout the cloud-api-adaptor repository. Defaults to main.
@@ -36,6 +46,8 @@ jobs:
3646
env:
3747
CAA_IMAGE: "${{ inputs.caa_image }}"
3848
BYOM_PODVM_IMAGE: "${{ inputs.podvm_image }}"
49+
PEERPOD_CTRL_IMAGE: "${{ inputs.peerpod_ctrl_image }}"
50+
WEBHOOK_IMAGE: "${{ inputs.webhook_image }}"
3951
steps:
4052
- name: Checkout Code
4153
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/e2e_docker.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ on:
2323
description: Name of the container runtime. Either containerd or crio.
2424
required: false
2525
type: string
26+
peerpod_ctrl_image:
27+
description: The peerpod-ctrl OCI image (including tag)
28+
required: false
29+
default: ''
30+
type: string
31+
webhook_image:
32+
description: The peer-pods-webhook OCI image (including tag)
33+
required: false
34+
default: ''
35+
type: string
2636
secrets:
2737
QUAY_PASSWORD:
2838
required: true
@@ -44,6 +54,8 @@ jobs:
4454
runs-on: ubuntu-22.04
4555
env:
4656
CAA_IMAGE: "${{ inputs.caa_image }}"
57+
PEERPOD_CTRL_IMAGE: "${{ inputs.peerpod_ctrl_image }}"
58+
WEBHOOK_IMAGE: "${{ inputs.webhook_image }}"
4759
steps:
4860
- name: Checkout Code
4961
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

.github/workflows/e2e_libvirt.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ on:
2828
description: Name of the container runtime. Either containerd or crio.
2929
required: false
3030
type: string
31+
peerpod_ctrl_image:
32+
description: The peerpod-ctrl OCI image (including tag)
33+
required: false
34+
default: ''
35+
type: string
36+
webhook_image:
37+
description: The peer-pods-webhook OCI image (including tag)
38+
required: false
39+
default: ''
40+
type: string
3141
secrets:
3242
REGISTRY_CREDENTIAL_ENCODED:
3343
required: true
@@ -162,10 +172,12 @@ jobs:
162172
CLOUD_PROVIDER: libvirt
163173
CONTAINER_RUNTIME: ${{ inputs.container_runtime }}
164174
DEPLOY_KBS: "true"
175+
PEERPOD_CTRL_IMAGE: "${{ inputs.peerpod_ctrl_image }}"
165176
TEST_TEARDOWN: "no"
166177
TEST_PROVISION_FILE: ${{ github.workspace }}/src/cloud-api-adaptor/libvirt.properties
167178
TEST_PODVM_IMAGE: ${{ env.PODVM_QCOW2 }}
168179
TEST_E2E_TIMEOUT: "75m"
180+
WEBHOOK_IMAGE: "${{ inputs.webhook_image }}"
169181
run: |
170182
# Default: provision cluster and install CAA
171183
export TEST_PROVISION="yes"

.github/workflows/e2e_run_all.yaml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,56 @@ jobs:
185185
secrets:
186186
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
187187

188+
# Build and push the peerpod-ctrl image (per-arch)
189+
peerpod_ctrl_image_amd64:
190+
uses: ./.github/workflows/peerpod-ctrl_build_and_push.yaml
191+
with:
192+
registry: ${{ inputs.registry }}
193+
image_tags: ${{ inputs.caa_image_tag }}
194+
git_ref: ${{ inputs.git_ref }}
195+
arch: linux/amd64
196+
runner: ubuntu-24.04
197+
permissions:
198+
contents: read
199+
packages: write # Required to publish the image to ghcr
200+
secrets:
201+
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
202+
203+
peerpod_ctrl_image_s390x:
204+
uses: ./.github/workflows/peerpod-ctrl_build_and_push.yaml
205+
with:
206+
registry: ${{ inputs.registry }}
207+
image_tags: ${{ inputs.caa_image_tag }}
208+
git_ref: ${{ inputs.git_ref }}
209+
arch: linux/s390x
210+
runner: ubuntu-24.04-s390x
211+
permissions:
212+
contents: read
213+
packages: write # Required to publish the image to ghcr
214+
secrets:
215+
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
216+
217+
# Build and push the webhook image
218+
webhook_image:
219+
uses: ./.github/workflows/webhook_image.yaml
220+
with:
221+
registry: ${{ inputs.registry }}
222+
image_tags: ${{ inputs.caa_image_tag }}
223+
git_ref: ${{ inputs.git_ref }}
224+
permissions:
225+
contents: read
226+
packages: write # Required to publish the image to ghcr
227+
secrets:
228+
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
229+
188230
# Run AWS e2e tests if pull request labeled 'test_e2e_aws'
189231
aws:
190232
name: aws
191233
if: |
192234
github.event_name == 'schedule' ||
193235
github.event_name == 'workflow_dispatch' ||
194236
contains(github.event.pull_request.labels.*.name, 'test_e2e_aws')
195-
needs: [podvm_ubuntu_amd64, caa_image_amd64]
237+
needs: [podvm_ubuntu_amd64, caa_image_amd64, peerpod_ctrl_image_amd64, webhook_image]
196238
strategy:
197239
fail-fast: false
198240
matrix:
@@ -207,6 +249,8 @@ jobs:
207249
container_runtime: ${{ matrix.container_runtime }}
208250
podvm_image: ${{ needs.podvm_ubuntu_amd64.outputs.qcow2_oras_image }}
209251
git_ref: ${{ inputs.git_ref }}
252+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-amd64
253+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
210254
secrets:
211255
AWS_IAM_ROLE_ARN: ${{ secrets.AWS_IAM_ROLE_ARN }}
212256

@@ -234,13 +278,15 @@ jobs:
234278
github.event_name == 'workflow_dispatch' ||
235279
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt') ||
236280
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt_amd64')
237-
needs: [podvm_mkosi_amd64, libvirt_e2e_arch_prep, caa_image_amd64]
281+
needs: [podvm_mkosi_amd64, libvirt_e2e_arch_prep, caa_image_amd64, peerpod_ctrl_image_amd64, webhook_image]
238282
uses: ./.github/workflows/e2e_libvirt.yaml
239283
with:
240284
runner: ubuntu-24.04
241285
caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-dev-amd64
242286
podvm_image: ${{ needs.podvm_mkosi_amd64.outputs.qcow2_oras_image }}
243287
git_ref: ${{ inputs.git_ref }}
288+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-amd64
289+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
244290
secrets:
245291
REGISTRY_CREDENTIAL_ENCODED: ${{ secrets.REGISTRY_CREDENTIAL_ENCODED }}
246292

@@ -252,13 +298,15 @@ jobs:
252298
github.event_name == 'workflow_dispatch' ||
253299
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt') ||
254300
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt_s390x')
255-
needs: [podvm_mkosi_s390x, libvirt_e2e_arch_prep, caa_image_s390x]
301+
needs: [podvm_mkosi_s390x, libvirt_e2e_arch_prep, caa_image_s390x, peerpod_ctrl_image_s390x, webhook_image]
256302
uses: ./.github/workflows/e2e_libvirt.yaml
257303
with:
258304
runner: s390x-large
259305
caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-dev-s390x
260306
podvm_image: ${{ needs.podvm_mkosi_s390x.outputs.qcow2_oras_image }}
261307
git_ref: ${{ inputs.git_ref }}
308+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-s390x
309+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
262310
secrets:
263311
REGISTRY_CREDENTIAL_ENCODED: ${{ secrets.REGISTRY_CREDENTIAL_ENCODED }}
264312

@@ -270,13 +318,15 @@ jobs:
270318
github.event_name == 'workflow_dispatch' ||
271319
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt') ||
272320
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt_amd64')
273-
needs: [podvm_ubuntu_amd64, libvirt_e2e_arch_prep, caa_image_amd64]
321+
needs: [podvm_ubuntu_amd64, libvirt_e2e_arch_prep, caa_image_amd64, peerpod_ctrl_image_amd64, webhook_image]
274322
uses: ./.github/workflows/e2e_libvirt.yaml
275323
with:
276324
runner: ubuntu-24.04
277325
caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-amd64-dev
278326
podvm_image: ${{ needs.podvm_ubuntu_amd64.outputs.qcow2_oras_image }}
279327
git_ref: ${{ inputs.git_ref }}
328+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-amd64
329+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
280330
secrets:
281331
REGISTRY_CREDENTIAL_ENCODED: ${{ secrets.REGISTRY_CREDENTIAL_ENCODED }}
282332

@@ -288,13 +338,15 @@ jobs:
288338
github.event_name == 'workflow_dispatch' ||
289339
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt') ||
290340
contains(github.event.pull_request.labels.*.name, 'test_e2e_libvirt_s390x')
291-
needs: [podvm_ubuntu_s390x, libvirt_e2e_arch_prep, caa_image_s390x]
341+
needs: [podvm_ubuntu_s390x, libvirt_e2e_arch_prep, caa_image_s390x, peerpod_ctrl_image_s390x, webhook_image]
292342
uses: ./.github/workflows/e2e_libvirt.yaml
293343
with:
294344
runner: s390x-large
295345
caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-s390x-dev
296346
podvm_image: ${{ needs.podvm_ubuntu_s390x.outputs.qcow2_oras_image }}
297347
git_ref: ${{ inputs.git_ref }}
348+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-s390x
349+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
298350
secrets:
299351
REGISTRY_CREDENTIAL_ENCODED: ${{ secrets.REGISTRY_CREDENTIAL_ENCODED }}
300352

@@ -305,7 +357,7 @@ jobs:
305357
github.event_name == 'schedule' ||
306358
github.event_name == 'workflow_dispatch' ||
307359
contains(github.event.pull_request.labels.*.name, 'test_e2e_docker')
308-
needs: [podvm_mkosi_amd64, caa_image_amd64]
360+
needs: [podvm_mkosi_amd64, caa_image_amd64, peerpod_ctrl_image_amd64, webhook_image]
309361
strategy:
310362
fail-fast: false
311363
matrix:
@@ -323,6 +375,8 @@ jobs:
323375
container_runtime: ${{ matrix.container_runtime }}
324376
podvm_image: ${{ needs.podvm_mkosi_amd64.outputs.docker_oci_image }}
325377
git_ref: ${{ inputs.git_ref }}
378+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-amd64
379+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}
326380
secrets:
327381
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}
328382

@@ -333,9 +387,11 @@ jobs:
333387
github.event_name == 'schedule' ||
334388
github.event_name == 'workflow_dispatch' ||
335389
contains(github.event.pull_request.labels.*.name, 'test_e2e_byom')
336-
needs: [podvm_ubuntu_amd64, caa_image_amd64]
390+
needs: [podvm_ubuntu_amd64, caa_image_amd64, peerpod_ctrl_image_amd64, webhook_image]
337391
uses: ./.github/workflows/e2e_byom.yaml
338392
with:
339393
caa_image: ${{ inputs.registry }}/cloud-api-adaptor:${{ inputs.caa_image_tag }}-dev-amd64
340394
podvm_image: ${{ needs.podvm_ubuntu_amd64.outputs.byom_e2e_image }}
341395
git_ref: ${{ inputs.git_ref }}
396+
peerpod_ctrl_image: ${{ inputs.registry }}/peerpod-ctrl:${{ inputs.caa_image_tag }}-amd64
397+
webhook_image: ${{ inputs.registry }}/peer-pods-webhook:${{ inputs.caa_image_tag }}

src/cloud-api-adaptor/test/e2e/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ Other options are provided via environment variables if you need to further cust
8989
- `TEST_CAA_NAMESPACE` - This option is available, primarily for running the e2e tests on a downstream version
9090
of confidential containers, where the cloud-api-adaptor pod is deployed to a different namespace than the default
9191
`confidential-containers-system`.
92+
- `PEERPOD_CTRL_IMAGE` - Override the peerpod-ctrl container image used by the Helm sub-chart
93+
(e.g. `ghcr.io/confidential-containers/peerpod-ctrl:latest`). When set, the provisioner overrides
94+
the Helm values `resourceCtrl.image.repository` and `resourceCtrl.image.tag`. If unset, the sub-chart
95+
defaults are used.
96+
- `WEBHOOK_IMAGE` - Override the peer-pods-webhook container image used by the Helm sub-chart
97+
(e.g. `ghcr.io/confidential-containers/peer-pods-webhook:latest`). When set, the provisioner overrides
98+
the Helm values `webhook.image.repository` and `webhook.image.tag`. If unset, the sub-chart defaults are used.
9299

93100
# Running end-to-end tests against pre-configured cluster
94101

src/cloud-api-adaptor/test/provisioner/aws/provision_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,8 @@ func NewAwsInstallChart(installDir, provider string) (pv.InstallChart, error) {
11861186
}, nil
11871187
}
11881188

1189+
func (a *AwsInstallChart) GetHelm() *pv.Helm { return a.Helm }
1190+
11891191
func (a *AwsInstallChart) Install(ctx context.Context, cfg *envconf.Config) error {
11901192
return a.Helm.Install(ctx, cfg)
11911193
}

src/cloud-api-adaptor/test/provisioner/azure/provision_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,8 @@ func NewAzureInstallChart(installDir, provider string) (pv.InstallChart, error)
392392
}, nil
393393
}
394394

395+
func (a *AzureInstallChart) GetHelm() *pv.Helm { return a.Helm }
396+
395397
func (a *AzureInstallChart) Install(ctx context.Context, cfg *envconf.Config) error {
396398
if err := a.Helm.Install(ctx, cfg); err != nil {
397399
return err

src/cloud-api-adaptor/test/provisioner/byom/provision_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ func NewByomInstallChart(installDir, provider string) (pv.InstallChart, error) {
257257
}, nil
258258
}
259259

260+
func (b *ByomInstallChart) GetHelm() *pv.Helm { return b.Helm }
261+
260262
func (b *ByomInstallChart) Install(ctx context.Context, cfg *envconf.Config) error {
261263
// Create SSH key secret before installing Helm chart
262264
if err := b.createSSHKeySecret(ctx, cfg); err != nil {

src/cloud-api-adaptor/test/provisioner/docker/provision_common.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ func NewDockerInstallChart(installDir, provider string) (pv.InstallChart, error)
220220
}, nil
221221
}
222222

223+
func (d *DockerInstallChart) GetHelm() *pv.Helm { return d.Helm }
224+
223225
func (d *DockerInstallChart) Install(ctx context.Context, cfg *envconf.Config) error {
224226
return d.Helm.Install(ctx, cfg)
225227
}

0 commit comments

Comments
 (0)