Conversation
Signed-off-by: Paul Mars <paul.mars@canonical.com>
niemeyer
left a comment
There was a problem hiding this comment.
Needs some work so it's a bit more polished as well.
| } | ||
|
|
||
| func archiveURL(pro, arch string, oldRelease bool) (string, *credentials, error) { | ||
| func archiveURL(pro, arch string, oldRelease bool) (string, string, *credentials, error) { |
There was a problem hiding this comment.
Let's please make this a []string, and implement the feature in terms of it being fallback URLs, first one wins.
The function also needs a comment explaining this, in either new implementation. It's not just an archiveURL anymore, which is what it says on the tin.
Also, as a hint for the future: when results are naked like this (string, string), they need names so that we can tell what they are at a glimpse.
There was a problem hiding this comment.
I renamed, documented and changed the signature of the function. I think the candidateArchiveURLs better convey to the caller that they must then pick one from the list and not use all of the entries.
Thanks for the hint.
| } | ||
| _, err := probe.fetch(probe.distPath("InRelease"), "", fetchDefault) | ||
| if err == errNotFound { | ||
| archive.baseURL = fallbackURL |
There was a problem hiding this comment.
This seems quite hackish. Look at the logic below.. where is "InRelease"?
Let's please implement an elegant fallback mechanism using the abstractions and respecting the encapsulations we already have.
Signed-off-by: Paul Mars <paul.mars@canonical.com>
When an Ubuntu release passes its end-of-life date, Chisel routes to
old-releases.ubuntu.com. However, the physical migration of the suite to that mirror is a manual admin operation that can lag the scheduled EOL — so for recently-EOL releases (e.g. 25.04, 25.10),old-releasesreturns 404 andarchive.Openfails, blocking rootfs cuts.archiveURLbecamecandidateArchiveURLs, returning the base URLs to try in order of preference (old-releases first, current archive as fallback for old releases).openUbuntunow attempts a full open against each candidate, falling back only on a missing release (404) — auth, network or signature errors still fail immediately, so a broken archive is never masked. The index-opening flow was extracted intoubuntuArchive.setupIndexesso it can be retried per candidate without duplicate downloads: the winning candidate's InRelease fetch is the one used going forward.Fix #312