Skip to content

Commit 6ffe78b

Browse files
committed
fix: --update --tag dev pulls :dev-cli alias instead of guessing version
- When --tag dev/main is used and versioned image is missing locally, pull the branch alias (:dev-cli/:main-cli) which always exists - This avoids pulling non-existent 0.0.0-lpb-dev-cli tags - After first pull, subsequent --update uses versioned tags correctly
1 parent 66e11e4 commit 6ffe78b

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

scripts/lpb.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -901,14 +901,18 @@ def cmd_update():
901901
images_to_update.append(web_img)
902902
if not images_to_update:
903903
# If a specific tag was requested, pull it even if not local
904-
if cfg.image_tag and cfg.image_tag not in ("",):
905-
if c.images_exists(CLI_IMAGE):
906-
# Try to get the versioned image from remote
907-
info(f"{cli_img} not found locally, pulling from remote...")
908-
images_to_update.append(cli_img)
909-
if c.images_exists(web_img):
910-
images_to_update.append(web_img)
911-
if not images_to_update:
904+
if cfg.image_tag and cfg.image_tag in ("dev", "main"):
905+
# Use the branch alias tag (:dev-cli/:main-cli) which always exists
906+
if cfg.image_tag == "dev":
907+
alias_cli = f"{mod.CLI_IMAGE.rsplit(':', 1)[0]}:dev-cli"
908+
alias_web = f"{mod.WEB_IMAGE.rsplit(':', 1)[0]}:dev-web"
909+
else:
910+
alias_cli = f"{mod.CLI_IMAGE.rsplit(':', 1)[0]}:main-cli"
911+
alias_web = f"{mod.WEB_IMAGE.rsplit(':', 1)[0]}:main-web"
912+
info(f"{cli_img} not found locally, pulling alias {alias_cli}...")
913+
images_to_update.append(alias_cli)
914+
images_to_update.append(alias_web)
915+
elif not images_to_update:
912916
# Fall back to default images (no tag)
913917
for img in [CLI_IMAGE, WEB_IMAGE]:
914918
if c.images_exists(img):

0 commit comments

Comments
 (0)