@@ -13,6 +13,7 @@ a KinD cluster with the name specified in the arguments.
1313The 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
1617setup.sh also takes 5 arguments.
1718
1819Usage:
@@ -41,6 +42,12 @@ if [[ -z "${REG_PKG_NAME}" ]]; then
4142 exit 1
4243fi
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
6269namespace=$6
6370
6471reg_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
6774catalog_img=" ${CATALOG_IMG} "
6875reg_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
199203chmod -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