ubclaunchpad / inertia

✈️ Effortless, self-hosted continuous deployment for small teams and projects
https://inertia.ubclaunchpad.com
MIT License
153 stars 18 forks source link

inertia incorrectly reports upgrade is available #716

Closed bobheadxi closed 3 years ago

bobheadxi commented 4 years ago
❯ inertia rocket2 status

Inertia daemon on remote "rocket2" (...) is online
...
Inertia daemon v0.7.0

🚀  Inertia version v0.7.0 is now available!
Go to https://github.com/ubclaunchpad/inertia/releases/tag/v0.7.0 for more details.
Run 'inertia rocket2 upgrade --help' for tips on upgrading.
bobheadxi commented 4 years ago

Likely because https://sourcegraph.com/github.com/ubclaunchpad/inertia@39e1169426c9549a75794a3606063a112f42eb9c/-/blob/daemon/inertiad/daemon/status.go#L71-79 doesn't handle "already at latest"

chuck-sys commented 4 years ago

I can try this out I think.

chuck-sys commented 4 years ago

Also for GetLatestImageTag function ghcr.io has REST API (given you have an authorization PAT). See https://docs.docker.com/registry/spec/api/#listing-image-tags

Tried doing a curl:

curl \
-H "Authorization: Bearer $(echo $PAT | base64)" \
-H "Accept: application/vnd.docker.distribution.manifest.list.v2+json" \
https://ghcr.io/v2/ubclaunchpad/inertiad/tags/list
bobheadxi commented 4 years ago

Oh interesting! I could not find that documented anywhere on GitHub's end, didn't realize it would conform to a standardized registry API (which in hindsight makes perfect sense haha)