Skip to content

fix(installer): read the latest tag off the web redirect, not the API - #5

Merged
MihaiNueleanu merged 1 commit into
mainfrom
fix/installer-latest-tag
Oct 30, 2026
Merged

MihaiNueleanu merged 1 commit into
mainfrom
fix/installer-latest-tag

Conversation

@MihaiNueleanu

Copy link
Copy Markdown
Contributor

curl .../install | sh failed for everyone with could not work out the latest release tag.

Cause: the script read the tag off %{url_effective} for https://api.github.com/repos/dotmethodme/KubeTitan/releases/latest. That endpoint answers 200 with JSON and never redirects, so the effective URL is the API URL itself and the s|.*/tag/|| match came up empty. The redirect only exists on the web URL, https://github.com/<repo>/releases/latest -> /releases/tag/vX.Y.Z.

Fix:

  • Resolve latest from the web redirect: no JSON parsing, no jq, and no API rate limit.
  • Keep tag_name out of the API JSON as a fallback, for a mirror that only serves the API side.
  • The failure now names both URLs it tried and points at KT_VERSION=vX.Y.Z as the skip.

Tested against the real v0.2.0 release:

  • KT_PREFIX=/tmp/kt sh install.sh -> KubeTitan v0.2.0 for linux-x86_64, checksum ok, binary is a real ELF (177 E L F).
  • KT_DL=http://127.0.0.1:9 (web host dead) -> still resolves v0.2.0 through the JSON fallback.
  • KT_REPO=dotmethodme/definitely-not-a-repo -> the new actionable error.

Worth noting: this only goes live for the public command once it is on main, since /install serves the raw script from main. Until then KT_VERSION=v0.2.0 gets around it.

api.github.com/repos/<r>/releases/latest answers 200 with JSON and never
redirects, so following it and looking for /tag/ in the effective URL always
came up empty and every install died with 'could not work out the latest
release tag'. The web URL does 302 to /releases/tag/<tag> and is not rate
limited; the JSON tag_name is kept as a fallback for API-only mirrors.
@MihaiNueleanu
MihaiNueleanu merged commit a44b5fb into main Oct 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant