Skip to content

Commit 6e398b1

Browse files
committed
ext-dev-e2e passes
Signed-off-by: Todd Short <[email protected]>
1 parent 9a10bb3 commit 6e398b1

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ DNS_NAME := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc.cluster
126126

127127
export REG_PKG_NAME := registry-operator
128128
export CATALOG_IMG := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000/test-catalog:e2e
129+
export REGISTRY_ROOT := $(E2E_REGISTRY_NAME).$(E2E_REGISTRY_NAMESPACE).svc:5000
129130
.PHONY: test-ext-dev-e2e
130131
test-ext-dev-e2e: $(OPERATOR_SDK) $(KUSTOMIZE) $(KIND) #HELP Run extension create, upgrade and delete tests.
131132
test/extension-developer-e2e/setup.sh $(OPERATOR_SDK) $(CONTAINER_RUNTIME) $(KUSTOMIZE) $(KIND) $(KIND_CLUSTER_NAME) $(E2E_REGISTRY_NAMESPACE)

test/extension-developer-e2e/setup.sh

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ a KinD cluster with the name specified in the arguments.
1313
The following environment variables are required for configuring this script:
1414
- \$CATALOG_IMG - the tag for the catalog image that contains the registry+v1 bundle.
1515
- \$REG_PKG_NAME - the name of the package for the extension that uses the registry+v1 bundle format.
16+
- \$REGISTRY_ROOT - hostname:port of the local docker-registry
1617
setup.sh also takes 5 arguments.
1718
1819
Usage:
@@ -41,6 +42,12 @@ if [[ -z "${REG_PKG_NAME}" ]]; then
4142
exit 1
4243
fi
4344

45+
if [[ -z "${REGISTRY_ROOT}" ]]; then
46+
echo "\$REGISTRY_ROOT is required to be set"
47+
echo "${help}"
48+
exit 1
49+
fi
50+
4451
########################################
4552
# Setup temp dir and local variables
4653
########################################
@@ -62,7 +69,7 @@ kcluster_name=$5
6269
namespace=$6
6370

6471
reg_img="${DOMAIN}/registry:v0.0.1"
65-
reg_bundle_img="${DOMAIN}/registry-bundle:v0.0.1"
72+
reg_bundle_img="${REGISTRY_ROOT}/bundles/registry-v1/registry-bundle:v0.0.1"
6673

6774
catalog_img="${CATALOG_IMG}"
6875
reg_pkg_name="${REG_PKG_NAME}"
@@ -98,9 +105,6 @@ reg_pkg_name="${REG_PKG_NAME}"
98105
make bundle-build BUNDLE_IMG="${reg_bundle_img}"
99106
)
100107

101-
$kind load docker-image "${reg_img}" --name "${kcluster_name}"
102-
$kind load docker-image "${reg_bundle_img}" --name "${kcluster_name}"
103-
104108
###############################
105109
# Create the FBC that contains
106110
# the registry+v1 extensions
@@ -197,3 +201,55 @@ kubectl wait --for=condition=Complete -n "${namespace}" jobs/kaniko --timeout=60
197201
# don't have write permissions so they can't be removed unless
198202
# we ensure they have the write permissions
199203
chmod -R +w "${REG_DIR}/bin"
204+
205+
# Load the bundle image into the docker-registry
206+
207+
kubectl create configmap -n "${namespace}" --from-file="${REG_DIR}/bundle.Dockerfile" operator-controller-e2e-${reg_pkg_name}.root
208+
209+
tgz="${REG_DIR}/manifests.tgz"
210+
tar czf "${tgz}" -C "${REG_DIR}" bundle
211+
kubectl create configmap -n "${namespace}" --from-file="${tgz}" operator-controller-${reg_pkg_name}.manifests
212+
213+
kubectl apply -f - << EOF
214+
apiVersion: batch/v1
215+
kind: Job
216+
metadata:
217+
name: "kaniko-${reg_pkg_name}"
218+
namespace: "${namespace}"
219+
spec:
220+
template:
221+
spec:
222+
initContainers:
223+
- name: copy-manifests
224+
image: busybox
225+
command: ['sh', '-c', 'cp /manifests-data/* /manifests']
226+
volumeMounts:
227+
- name: manifests
228+
mountPath: /manifests
229+
- name: manifests-data
230+
mountPath: /manifests-data
231+
containers:
232+
- name: kaniko
233+
image: gcr.io/kaniko-project/executor:latest
234+
args: ["--dockerfile=/workspace/bundle.Dockerfile",
235+
"--context=tar:///workspace/manifests/manifests.tgz",
236+
"--destination=${reg_bundle_img}",
237+
"--skip-tls-verify"]
238+
volumeMounts:
239+
- name: dockerfile
240+
mountPath: /workspace/
241+
- name: manifests
242+
mountPath: /workspace/manifests/
243+
restartPolicy: Never
244+
volumes:
245+
- name: dockerfile
246+
configMap:
247+
name: operator-controller-e2e-${reg_pkg_name}.root
248+
- name: manifests
249+
emptyDir: {}
250+
- name: manifests-data
251+
configMap:
252+
name: operator-controller-${reg_pkg_name}.manifests
253+
EOF
254+
255+
kubectl wait --for=condition=Complete -n "${namespace}" jobs/kaniko-${reg_pkg_name} --timeout=60s

0 commit comments

Comments
 (0)