Skip to content

Commit 1f58710

Browse files
committed
Add single-bundle-index build script
Adds script for building the 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 scripts for updating the images used in unit and e2e tests. Signed-off-by: Tayler Geiger <[email protected]>
1 parent 59be86a commit 1f58710

File tree

10 files changed

+49
-1
lines changed

10 files changed

+49
-1
lines changed

DEVELOPMENT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ 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 can use the following 2 scripts in the ./scripts/ directory:
52+
53+
```sh
54+
./scripts/build_test_images.sh
55+
./scripts/build_e2e_test_images.sh
56+
```
57+
58+
Please be aware that these scripts push directly to the image tags used by the actual unit and e2e tests.
59+
60+
The contents and Containerfiles of these bundles can be found in `./test/images/`.
61+
4962
[controller-runtime instructions]: https://pkg.go.dev/sigs.k8s.io/controller-runtime/tools/setup-envtest#section-readme
5063

5164
#### Building

scripts/build_e2e_test_images.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
# Configuration variables (can be overridden via environment)
4+
QUAY_REPO="${QUAY_REPO:-tayler}"
5+
BUNDLE_NAME="${BUNDLE_NAME:-bundle}"
6+
BUNDLE_TAG="${BUNDLE_TAG:-objects-pdb-v1}"
7+
INDEX_NAME="${INDEX_NAME:-single-bundle-index}"
8+
INDEX_TAG="${INDEX_TAG:-pdb-v1}"
9+
10+
# Single Bundle E2E Test Image
11+
docker build -t quay.io/${QUAY_REPO}/${BUNDLE_NAME}:${BUNDLE_TAG} ./test/images/single-bundle-index
12+
docker push quay.io/${QUAY_REPO}/${BUNDLE_NAME}:${BUNDLE_TAG}
13+
14+
opm index add --bundles quay.io/${QUAY_REPO}/${BUNDLE_NAME}:${BUNDLE_TAG} --tag quay.io/${QUAY_REPO}/${INDEX_NAME}:${INDEX_TAG} -c docker
15+
docker push quay.io/${QUAY_REPO}/${INDEX_NAME}:${INDEX_TAG}

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/tayler/single-bundle-index:pdb-v1"
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
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
annotations:
2+
operators.operatorframework.io.bundle.mediatype.v1: "registry+v1"
3+
operators.operatorframework.io.bundle.manifests.v1: "manifests/"
4+
operators.operatorframework.io.bundle.metadata.v1: "metadata/"
5+
operators.operatorframework.io.bundle.package.v1: "busybox"
6+
operators.operatorframework.io.bundle.channels.v1: "alpha"
7+
operators.operatorframework.io.bundle.channel.default.v1: "alpha"

0 commit comments

Comments
 (0)