Skip to content

Commit 17d51c3

Browse files
author
Per Goncalves da Silva
committed
move all catalogs to internal registry
Signed-off-by: Per Goncalves da Silva <[email protected]>
1 parent e20bf75 commit 17d51c3

File tree

29 files changed

+112
-345
lines changed

29 files changed

+112
-345
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ jobs:
9292
KIND_CLUSTER_NAME="kind-olmv0-${i}" \
9393
KIND_CREATE_OPTS="--kubeconfig=${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
9494
HELM_INSTALL_OPTS="--kubeconfig ${E2E_KUBECONFIG_ROOT}/kubeconfig-${i}" \
95-
UPDATE_FIXTURES="${{ needs.build.outputs.UPDATE_FIXTURES }}" \
9695
make kind-create image-registry build-and-load-e2e-fixture-images deploy;
9796
done
9897

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,10 @@ image-registry: ## Setup in-cluster image registry
220220

221221
.PHONY: build-and-load-e2e-fixture-images
222222
build-and-load-e2e-fixture-images: # Build e2e fixture images and either kind-load or push them to an on-cluster registry
223-
# build and kind-load fixture images
224-
scripts/e2e_test_fixtures.sh --kind-load
225-
226223
# push the test-catalog to an on-cluster registry
227-
./scripts/publish_e2e_catalog.sh $(E2E_REGISTRY_NAMESPACE) $(CATALOG_IMG)
224+
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v1" "indexv1" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/busybox-dependencies-index:1.0.0-with-ListBundles-method-${OPERATOR_REGISTRY_VERSION}"
225+
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v2" "indexv2" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/busybox-dependencies-index:2.0.0-with-ListBundles-method-${OPERATOR_REGISTRY_VERSION}"
226+
./scripts/publish_e2e_catalog.sh "test/images/busybox-index-v2" "test-catalog" "$(E2E_REGISTRY_NAMESPACE)" "$(REGISTRY_ROOT)/test-catalog:e2e"
228227

229228
.PHONY: deploy
230229
OLM_IMAGE := quay.io/operator-framework/olm:local

pkg/lib/image/image.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,5 @@ func InferImagePullPolicy(image string) corev1.PullPolicy {
1313
if strings.Contains(image, "@") {
1414
return corev1.PullIfNotPresent
1515
}
16-
17-
// Ensure test registry images are pulled only if needed
18-
// These will normally be loaded through kind load docker-image
19-
// This is also helps support the e2e fixture image re-build flow (see e2e GHA)
20-
if strings.HasPrefix(image, "quay.io/olmtest/test-catalog") {
21-
return corev1.PullIfNotPresent
22-
}
2316
return corev1.PullAlways
2417
}

scripts/e2e_test_fixtures.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ source .bingo/variables.env
66
# Default values
77
KIND=${KIND:-kind}
88
KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-kind-olmv0}
9-
OPM_VERSION=$(go list -m github.com/operator-framework/operator-registry | cut -d" " -f2 | sed 's/^v//')
109
PUSH=false
1110
SAVE=false
1211
CONTAINER_RUNTIME=docker
@@ -133,16 +132,6 @@ if [ "$BUILD" = "true" ]; then
133132
${CONTAINER_RUNTIME} tag "${INDEX_V2}" "${TEST_CATALOG_IMAGE}"
134133
fi
135134

136-
# Assumes images are already built, kind cluster is running, and kubeconfig is set
137-
if [ "$LOAD_KIND" = true ]; then
138-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${BUNDLE_V1_IMAGE}"
139-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${BUNDLE_V1_DEP_IMAGE}"
140-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${BUNDLE_V2_IMAGE}"
141-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${BUNDLE_V2_DEP_IMAGE}"
142-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${INDEX_V1}"
143-
${KIND} load docker-image --name="${KIND_CLUSTER_NAME}" "${INDEX_V2}"
144-
fi
145-
146135
# Assumes images are already built
147136
if [ "${SAVE}" = true ]; then
148137
${CONTAINER_RUNTIME} save "${BUNDLE_V1_IMAGE}" | gzip > bundlev1.tar.gz
@@ -154,16 +143,3 @@ if [ "${SAVE}" = true ]; then
154143
${CONTAINER_RUNTIME} save "${INDEX_V1}" | gzip > indexv1.tar.gz
155144
${CONTAINER_RUNTIME} save "${INDEX_V2}" | gzip > indexv2.tar.gz
156145
fi
157-
158-
# Assumes images are already built
159-
if [ "$PUSH" = true ]; then
160-
# push bundles
161-
${CONTAINER_RUNTIME} push "${BUNDLE_V1_IMAGE}"
162-
${CONTAINER_RUNTIME} push "${BUNDLE_V1_IMAGE}"
163-
${CONTAINER_RUNTIME} push "${BUNDLE_V1_IMAGE}"
164-
${CONTAINER_RUNTIME} push "${BUNDLE_V1_IMAGE}"
165-
166-
# push indexes
167-
${CONTAINER_RUNTIME} push "${INDEX_V1}"
168-
${CONTAINER_RUNTIME} push "${INDEX_V2}"
169-
fi

scripts/publish_e2e_catalog.sh

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,30 @@
11
#! /bin/bash
22

3+
set -x
34
set -o errexit
45
set -o nounset
56
set -o pipefail
67

7-
help="
8-
build-push-e2e-catalog.sh is a script to build and push the e2e catalog image using kaniko.
9-
Usage:
10-
build-push-e2e-catalog.sh [NAMESPACE] [TAG]
11-
12-
Argument Descriptions:
13-
- NAMESPACE is the namespace the kaniko Job should be created in
14-
- TAG is the full tag used to build and push the catalog image
15-
"
16-
17-
if [[ "$#" -ne 2 ]]; then
18-
echo "Illegal number of arguments passed"
19-
echo "${help}"
20-
exit 1
21-
fi
22-
23-
namespace=$1
24-
tag=$2
8+
src=$1
9+
name=$2
10+
namespace=$3
11+
dest=$4
2512

2613
OPM_VERSION=${OPM_VERSION:-"latest"}
2714

28-
echo "${namespace}" "${tag}"
29-
3015
# Delete existing configmaps
31-
kubectl delete configmap -n "${namespace}" test-catalog.dockerfile --ignore-not-found
32-
kubectl delete configmap -n "${namespace}" test-catalog.build-contents --ignore-not-found
16+
kubectl delete configmap -n "${namespace}" "${name}.dockerfile" --ignore-not-found
17+
kubectl delete configmap -n "${namespace}" "${name}.build-contents" --ignore-not-found
3318

34-
kubectl create configmap -n "${namespace}" --from-file=test/images/test-catalog/dockerfile test-catalog.dockerfile
35-
kubectl create configmap -n "${namespace}" --from-file=test/images/test-catalog/configs test-catalog.build-contents
19+
kubectl create configmap -n "${namespace}" --from-file="${src}/dockerfile" "${name}.dockerfile"
20+
kubectl create configmap -n "${namespace}" --from-file="${src}/configs" "${name}.build-contents"
3621

22+
# Create the kaniko job
3723
kubectl apply -f - << EOF
3824
apiVersion: batch/v1
3925
kind: Job
4026
metadata:
41-
name: kaniko
27+
name: "kaniko-${name}"
4228
namespace: "${namespace}"
4329
spec:
4430
template:
@@ -49,7 +35,7 @@ spec:
4935
args: [ "--build-arg=OPM_VERSION=${OPM_VERSION}",
5036
"--dockerfile=/workspace/dockerfile",
5137
"--context=/workspace",
52-
"--destination=${tag}",
38+
"--destination=${dest}",
5339
"--verbosity=trace",
5440
"--skip-tls-verify"]
5541
volumeMounts:
@@ -61,13 +47,13 @@ spec:
6147
volumes:
6248
- name: dockerfile
6349
configMap:
64-
name: test-catalog.dockerfile
50+
name: "${name}.dockerfile"
6551
items:
6652
- key: dockerfile
6753
path: dockerfile
6854
- name: build-contents
6955
configMap:
70-
name: test-catalog.build-contents
56+
name: "${name}.build-contents"
7157
EOF
7258

73-
kubectl wait --for=condition=Complete -n "${namespace}" jobs/kaniko --timeout=60s
59+
kubectl wait --for=condition=Complete -n "${namespace}" "jobs/kaniko-${name}" --timeout=60s

test/e2e/catalog_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
10621062
packageName := "busybox"
10631063
channelName := "alpha"
10641064

1065-
catSrcImage := "quay.io/olmtest/busybox-dependencies-index"
1065+
catSrcImage := "docker-registry.olm-e2e.svc:5000/busybox-dependencies-index"
10661066

10671067
By("creating gRPC CatalogSource")
10681068
source := &v1alpha1.CatalogSource{

test/images/busybox-index/indexv1/busybox-dependency/catalog.json renamed to test/images/busybox-index-v1/configs/catalog.json

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,92 @@
1+
{
2+
"schema": "olm.package",
3+
"name": "busybox",
4+
"defaultChannel": "alpha"
5+
}
6+
{
7+
"schema": "olm.channel",
8+
"name": "alpha",
9+
"package": "busybox",
10+
"entries": [
11+
{
12+
"name": "busybox.v1.0.0"
13+
}
14+
]
15+
}
16+
{
17+
"schema": "olm.bundle",
18+
"name": "busybox.v1.0.0",
19+
"package": "busybox",
20+
"image": "quay.io/olmtest/busybox-bundle:1.0.0",
21+
"properties": [
22+
{
23+
"type": "olm.gvk.required",
24+
"value": {
25+
"group": "olm.test.io",
26+
"kind": "Foo",
27+
"version": "v1"
28+
}
29+
},
30+
{
31+
"type": "olm.package",
32+
"value": {
33+
"packageName": "busybox",
34+
"version": "1.0.0"
35+
}
36+
},
37+
{
38+
"type": "olm.csv.metadata",
39+
"value": {
40+
"apiServiceDefinitions": {},
41+
"crdDescriptions": {
42+
"required": [
43+
{
44+
"name": "foos.olm.test.io",
45+
"version": "v1",
46+
"kind": "Foo",
47+
"displayName": "Foo",
48+
"description": "Foo resources for testing dependencies"
49+
}
50+
]
51+
},
52+
"description": "A busybox CSV.\n",
53+
"displayName": "busybox",
54+
"installModes": [
55+
{
56+
"type": "OwnNamespace",
57+
"supported": true
58+
},
59+
{
60+
"type": "SingleNamespace",
61+
"supported": true
62+
},
63+
{
64+
"type": "MultiNamespace",
65+
"supported": true
66+
},
67+
{
68+
"type": "AllNamespaces",
69+
"supported": true
70+
}
71+
],
72+
"maturity": "alpha",
73+
"provider": {
74+
"name": "Red Hat"
75+
}
76+
}
77+
}
78+
],
79+
"relatedImages": [
80+
{
81+
"name": "",
82+
"image": "busybox"
83+
},
84+
{
85+
"name": "",
86+
"image": "quay.io/olmtest/busybox-bundle:1.0.0"
87+
}
88+
]
89+
}
190
{
291
"schema": "olm.package",
392
"name": "busybox-dependency",

test/images/test-catalog/dockerfile renamed to test/images/busybox-index-v1/dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM quay.io/operator-framework/opm:${OPM_VERSION}
88
LABEL operators.operatorframework.io.index.configs.v1=/configs
99

1010
# Copy declarative config root into image at /configs and pre-populate serve cache
11-
COPY configs /configs
11+
COPY /configs /configs
1212
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
1313

1414
# Configure the entrypoint and command
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/expected_all.json
2+
..*

test/images/test-catalog/configs/catalog.json renamed to test/images/busybox-index-v2/configs/catalog.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,3 @@
184184
}
185185
]
186186
}
187-

test/images/busybox-index/dockerfile renamed to test/images/busybox-index-v2/dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ FROM quay.io/operator-framework/opm:${OPM_VERSION}
88
LABEL operators.operatorframework.io.index.configs.v1=/configs
99

1010
# Copy declarative config root into image at /configs and pre-populate serve cache
11-
ARG CONFIGS_DIR=/configs
12-
COPY ${CONFIGS_DIR} /configs
11+
COPY /configs /configs
1312
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]
1413

1514
# Configure the entrypoint and command

test/images/busybox-index/indexv1/busybox/catalog.json

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

0 commit comments

Comments
 (0)