Skip to content

Commit 2ecae11

Browse files
committed
Add single-bundle-index build script
Adds to script for building the single-bundle-index image used in the e2e tests. Also adds the necessary manifests and Containerfile for the bundle in that index, and adds a note in DEVELOPMENT.md about using the script for updating the images used in e2e tests. Signed-off-by: Tayler Geiger <[email protected]>
1 parent f0ece0d commit 2ecae11

File tree

11 files changed

+59
-20
lines changed

11 files changed

+59
-20
lines changed

DEVELOPMENT.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ To run a specific e2e test locally:
4646
$ make e2e-local TEST=TestCreateInstallPlanManualApproval
4747
```
4848

49+
##### Updating test images
50+
51+
Sometimes you will need to update the index or bundle images used in the unit or e2e tests. To update those images, you will need to be logged into quay.io with membership in the `olmtest` organization. Then simply run `./scripts/build_e2e_test_images.sh` which will build all the required bundle images, push those to quay.io, build all the index images, and push those to quay.io as well.
52+
53+
Please be aware that these scripts push directly to the image tags used by the actual e2e tests.
54+
55+
The contents and Containerfiles of these bundles can be found in `./test/images/`.
56+
4957
[controller-runtime instructions]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest#section-readme
5058

5159
#### Building

scripts/build_e2e_test_images.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
QUAY_REPO="${QUAY_REPO:-olmtest}"
4+
SINGLE_BUNDLE_TAG="${BUNDLE_TAG:-objects-pdb-v2}"
5+
SINGLE_BUNDLE_INDEX_TAG="${INDEX_TAG:-pdb-v2}"
6+
7+
# Busybox Operator Index Image
8+
docker build -t quay.io/${QUAY_REPO}/busybox-bundle:1.0.0 ./test/images/busybox-index/busybox/1.0.0
9+
docker build -t quay.io/${QUAY_REPO}/busybox-bundle:2.0.0 ./test/images/busybox-index/busybox/2.0.0
10+
11+
docker build -t quay.io/${QUAY_REPO}/busybox-dependency-bundle:1.0.0 ./test/images/busybox-index/busybox-dependency/1.0.0
12+
docker build -t quay.io/${QUAY_REPO}/busybox-dependency-bundle:2.0.0 ./test/images/busybox-index/busybox-dependency/2.0.0
13+
14+
docker push quay.io/${QUAY_REPO}/busybox-bundle:1.0.0
15+
docker push quay.io/${QUAY_REPO}/busybox-bundle:2.0.0
16+
docker push quay.io/${QUAY_REPO}/busybox-dependency-bundle:1.0.0
17+
docker push quay.io/${QUAY_REPO}/busybox-dependency-bundle:2.0.0
18+
19+
opm index add --bundles quay.io/${QUAY_REPO}/busybox-dependency-bundle:1.0.0,quay.io/olmtest/busybox-bundle:1.0.0 --tag quay.io/olmtest/busybox-dependencies-index:1.0.0-with-ListBundles-method -c docker
20+
docker push quay.io/${QUAY_REPO}/busybox-dependencies-index:1.0.0-with-ListBundles-method
21+
22+
opm index add --bundles quay.io/${QUAY_REPO}/busybox-dependency-bundle:2.0.0,quay.io/olmtest/busybox-bundle:2.0.0 --tag quay.io/olmtest/busybox-dependencies-index:2.0.0-with-ListBundles-method --from-index quay.io/olmtest/busybox-dependencies-index:1.0.0-with-ListBundles-method -c docker
23+
docker push quay.io/${QUAY_REPO}/busybox-dependencies-index:2.0.0-with-ListBundles-method
24+
25+
# Single Bundle E2E Test Image
26+
docker build -t quay.io/${QUAY_REPO}/bundle:${BUNDLE_TAG} ./test/images/single-bundle-index
27+
docker push quay.io/${QUAY_REPO}/bundle:${BUNDLE_TAG}
28+
29+
opm index add --bundles quay.io/${QUAY_REPO}/bundle:${BUNDLE_TAG} --tag quay.io/${QUAY_REPO}/single-bundle-index:${INDEX_TAG} -c docker
30+
docker push quay.io/${QUAY_REPO}/single-bundle-index:${INDEX_TAG}

scripts/build_test_images.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/e2e/bundle_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var _ = Describe("Installing bundles with new object types", Label("ObjectTypes"
6060
By("first installing the VPA CRD on cluster")
6161
const (
6262
sourceName = "test-catalog"
63-
imageName = "quay.io/olmtest/single-bundle-index:pdb-v1"
63+
imageName = "quay.io/olmtest/single-bundle-index:pdb-v2"
6464
)
6565

6666
By("create VPA CRD on cluster")
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM scratch
2+
3+
# We are pushing an operator-registry bundle
4+
# that has both metadata and manifests.
5+
LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
6+
LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
7+
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
8+
LABEL operators.operatorframework.io.bundle.package.v1=busybox
9+
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
10+
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
11+
12+
COPY ./manifests/*.yaml /manifests/
13+
COPY ./metadata/annotations.yaml /metadata/annotations.yaml
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)