Skip to content

Commit d836316

Browse files
authored
Update devfile with ephemeral graphroot directory (#1576)
* Update devfile with ephemeral graphroot directory * Add view_catalogsource target Signed-off-by: dkwon17 <dakwon@redhat.com>
1 parent 0607887 commit d836316

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

.devfile.yaml

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
schemaVersion: 2.2.0
1+
schemaVersion: 2.3.0
22
metadata:
33
name: devworkspace-operator
44
components:
@@ -9,31 +9,40 @@ components:
99
memoryLimit: 16Gi
1010
cpuLimit: '4'
1111
cpuRequest: '0.5'
12+
volumeMounts:
13+
- name: graphroot
14+
path: /home/user/.local/share/containers/storage
15+
- name: graphroot
16+
volume:
17+
ephemeral: true
1218
commands:
1319
- id: build-and-push-controller
1420
exec:
1521
label: "1. Build and push DWO controller image"
1622
component: tools
1723
commandLine: |
18-
read -p "ENTER a container registry org to push the devworkspace-controller image (e.g. quay.io/janedoe): " DWO_IMG_REPO &&
19-
read -p "ENTER the tag for the image (e.g. dev): " DWO_IMG_TAG &&
20-
export DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG} &&
21-
export DOCKER=podman &&
22-
make docker
24+
read -p "ENTER a container registry org to push the devworkspace-controller image (e.g. quay.io/janedoe): " DWO_IMG_REPO
25+
read -p "ENTER the tag for the image (e.g. dev): " DWO_IMG_TAG
26+
export DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG}
27+
export DOCKER=podman
28+
make docker-build-amd64
29+
make docker-push-amd64
2330
group:
2431
kind: build
2532
- id: make-olm-bundle-index-catalogsource
2633
exec:
2734
label: "2. Build and push OLM bundle, index image and create a CatalogueSource"
2835
component: tools
2936
commandLine: |
30-
[[ "$(oc whoami)" =~ ^kube:admin$ ]] || (echo "You need to login as kubeadmin" && false) &&
31-
read -p "ENTER a container registry org to push the devworkspace images (e.g. quay.io/janedoe): " DWO_IMG_REPO &&
32-
read -p "ENTER a tag for the image (e.g. dev): " DWO_IMG_TAG &&
33-
export DWO_BUNDLE_IMG=${DWO_IMG_REPO}/devworkspace-operator-bundle:${DWO_IMG_TAG} &&
34-
export DWO_INDEX_IMG=${DWO_IMG_REPO}/devworkspace-operator-index:${DWO_IMG_TAG} &&
35-
export DEFAULT_DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG} &&
36-
export DOCKER=podman &&
37-
make generate_olm_bundle_yaml build_bundle_and_index register_catalogsource
37+
read -p "ENTER a container registry org to push the devworkspace images (e.g. quay.io/janedoe): " DWO_IMG_REPO
38+
read -p "ENTER a tag for the image (e.g. dev): " DWO_IMG_TAG
39+
export DWO_BUNDLE_IMG=${DWO_IMG_REPO}/devworkspace-operator-bundle:${DWO_IMG_TAG}
40+
export DWO_INDEX_IMG=${DWO_IMG_REPO}/devworkspace-operator-index:${DWO_IMG_TAG}
41+
export DEFAULT_DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG}-amd64
42+
export DOCKER=podman
43+
make generate_olm_bundle_yaml build_bundle_and_index
44+
read -p "Run register_catalogsource? (y/n) " -n 1 -r
45+
echo
46+
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ ! "$(oc whoami)" =~ ^kube:admin$ ]]; then echo "You need to login as kubeadmin" && exit 1; fi && make register_catalogsource; else make view_catalogsource; fi
3847
group:
3948
kind: build

build/make/olm.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ register_catalogsource: _check_skopeo_installed
5454
sed -e "s|quay.io/devfile/devworkspace-operator-index:next|$(DWO_INDEX_IMG)|g" ./catalog-source.yaml \
5555
| oc apply -f -
5656

57+
### view_catalogsource: prints the catalog source to standard output
58+
view_catalogsource:
59+
@echo "To apply the CatalogSource, run:"
60+
@echo ""
61+
@echo "oc apply -f - <<EOF"
62+
@sed -e "s|quay.io/devfile/devworkspace-operator-index:next|$(DWO_INDEX_IMG)|g" ./catalog-source.yaml
63+
@echo "EOF"
64+
5765
### unregister_catalogsource: unregister the catalogsource and delete the imageContentSourcePolicy
5866
unregister_catalogsource:
5967
oc delete catalogsource devworkspace-operator-catalog -n openshift-marketplace --ignore-not-found

0 commit comments

Comments
 (0)