Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions .devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
schemaVersion: 2.2.0
schemaVersion: 2.3.0
metadata:
name: devworkspace-operator
components:
Expand All @@ -9,31 +9,40 @@ components:
memoryLimit: 16Gi
cpuLimit: '4'
cpuRequest: '0.5'
volumeMounts:
- name: graphroot
path: /home/user/.local/share/containers/storage
- name: graphroot
volume:
ephemeral: true
commands:
- id: build-and-push-controller
exec:
label: "1. Build and push DWO controller image"
component: tools
commandLine: |
read -p "ENTER a container registry org to push the devworkspace-controller image (e.g. quay.io/janedoe): " DWO_IMG_REPO &&
read -p "ENTER the tag for the image (e.g. dev): " DWO_IMG_TAG &&
export DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG} &&
export DOCKER=podman &&
make docker
read -p "ENTER a container registry org to push the devworkspace-controller image (e.g. quay.io/janedoe): " DWO_IMG_REPO
read -p "ENTER the tag for the image (e.g. dev): " DWO_IMG_TAG
export DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG}
export DOCKER=podman
make docker-build-amd64
make docker-push-amd64
Copy link
Member

@rohanKanojia rohanKanojia Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine if the target cluster is always amd64, but it can be surprising if someone later targets an arm64 cluster.

group:
kind: build
- id: make-olm-bundle-index-catalogsource
exec:
label: "2. Build and push OLM bundle, index image and create a CatalogueSource"
component: tools
commandLine: |
[[ "$(oc whoami)" =~ ^kube:admin$ ]] || (echo "You need to login as kubeadmin" && false) &&
read -p "ENTER a container registry org to push the devworkspace images (e.g. quay.io/janedoe): " DWO_IMG_REPO &&
read -p "ENTER a tag for the image (e.g. dev): " DWO_IMG_TAG &&
export DWO_BUNDLE_IMG=${DWO_IMG_REPO}/devworkspace-operator-bundle:${DWO_IMG_TAG} &&
export DWO_INDEX_IMG=${DWO_IMG_REPO}/devworkspace-operator-index:${DWO_IMG_TAG} &&
export DEFAULT_DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG} &&
export DOCKER=podman &&
make generate_olm_bundle_yaml build_bundle_and_index register_catalogsource
read -p "ENTER a container registry org to push the devworkspace images (e.g. quay.io/janedoe): " DWO_IMG_REPO
read -p "ENTER a tag for the image (e.g. dev): " DWO_IMG_TAG
export DWO_BUNDLE_IMG=${DWO_IMG_REPO}/devworkspace-operator-bundle:${DWO_IMG_TAG}
export DWO_INDEX_IMG=${DWO_IMG_REPO}/devworkspace-operator-index:${DWO_IMG_TAG}
export DEFAULT_DWO_IMG=${DWO_IMG_REPO}/devworkspace-controller:${DWO_IMG_TAG}-amd64
export DOCKER=podman
make generate_olm_bundle_yaml build_bundle_and_index
read -p "Run register_catalogsource? (y/n) " -n 1 -r
echo
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
group:
kind: build
8 changes: 8 additions & 0 deletions build/make/olm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ register_catalogsource: _check_skopeo_installed
sed -e "s|quay.io/devfile/devworkspace-operator-index:next|$(DWO_INDEX_IMG)|g" ./catalog-source.yaml \
| oc apply -f -

### view_catalogsource: prints the catalog source to standard output
view_catalogsource:
@echo "To apply the CatalogSource, run:"
@echo ""
@echo "oc apply -f - <<EOF"
@sed -e "s|quay.io/devfile/devworkspace-operator-index:next|$(DWO_INDEX_IMG)|g" ./catalog-source.yaml
@echo "EOF"

### unregister_catalogsource: unregister the catalogsource and delete the imageContentSourcePolicy
unregister_catalogsource:
oc delete catalogsource devworkspace-operator-catalog -n openshift-marketplace --ignore-not-found
Expand Down
Loading