-
Notifications
You must be signed in to change notification settings - Fork 3
Fix custom image tag handling in installer smoke #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,8 +4,6 @@ set -euo pipefail | |
| DEVA_LAUNCHER="deva.sh" | ||
| LEGACY_WRAPPER="claude.sh" | ||
| YOLO_WRAPPER="claude-yolo" | ||
| DOCKER_IMAGE="${DEVA_DOCKER_IMAGE:-ghcr.io/thevibeworks/deva:latest}" | ||
| DOCKER_IMAGE_FALLBACK="${DEVA_DOCKER_IMAGE_FALLBACK:-thevibeworks/deva:latest}" | ||
| INSTALL_BASE_URL="${DEVA_INSTALL_BASE_URL:-https://raw.githubusercontent.com/thevibeworks/deva/main}" | ||
|
|
||
| agent_files=( | ||
|
|
@@ -15,6 +13,46 @@ agent_files=( | |
| "shared_auth.sh" | ||
| ) | ||
|
|
||
| image_ref() { | ||
| local repo="$1" | ||
| local tag="${2:-}" | ||
| local default_tag="$3" | ||
| local tail="${repo##*/}" | ||
|
|
||
| if [[ "$repo" == *@* ]]; then | ||
| printf '%s' "$repo" | ||
| return | ||
| fi | ||
|
|
||
| if [ -n "$tag" ]; then | ||
| printf '%s:%s' "$repo" "$tag" | ||
| return | ||
| fi | ||
|
|
||
| if [[ "$tail" == *:* ]]; then | ||
| printf '%s' "$repo" | ||
| return | ||
| fi | ||
|
|
||
| printf '%s:%s' "$repo" "$default_tag" | ||
| } | ||
|
|
||
| if [ -n "${DEVA_DOCKER_IMAGE+x}" ]; then | ||
| DOCKER_IMAGE="$(image_ref "$DEVA_DOCKER_IMAGE" "${DEVA_DOCKER_TAG:-}" "latest")" | ||
|
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If Useful? React with 👍 / 👎. |
||
| else | ||
| DOCKER_IMAGE="$(image_ref "ghcr.io/thevibeworks/deva" "${DEVA_DOCKER_TAG:-}" "latest")" | ||
| fi | ||
|
Comment on lines
+40
to
+44
|
||
|
|
||
| if [ -n "${DEVA_DOCKER_IMAGE_FALLBACK+x}" ]; then | ||
| if [ -n "$DEVA_DOCKER_IMAGE_FALLBACK" ]; then | ||
| DOCKER_IMAGE_FALLBACK="$(image_ref "$DEVA_DOCKER_IMAGE_FALLBACK" "${DEVA_DOCKER_IMAGE_FALLBACK_TAG:-${DEVA_DOCKER_TAG:-}}" "latest")" | ||
| else | ||
| DOCKER_IMAGE_FALLBACK="" | ||
| fi | ||
| else | ||
| DOCKER_IMAGE_FALLBACK="$(image_ref "thevibeworks/deva" "${DEVA_DOCKER_IMAGE_FALLBACK_TAG:-${DEVA_DOCKER_TAG:-}}" "latest")" | ||
| fi | ||
|
|
||
| echo "deva installer" | ||
| echo "==============" | ||
| echo "" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image_refappends:$tagbefore checking whetherrepoalready contains a tag (viatailcontaining:). IfDEVA_DOCKER_IMAGEis already tagged (e.g.deva-smoke:ci) andDEVA_DOCKER_TAGis also set, this will produce an invalid ref likedeva-smoke:ci:ci. Consider detecting an existing tag first (or stripping it) when a separate tag is provided, and define clear precedence between an inline tag andDEVA_DOCKER_TAGto avoid generating invalid image refs.