fix: keep abra working if recipe catalogue is offline #235
No reviewers
Labels
No Label
bug
build
ci/cd
contributing
design
documentation
duplicate
enhancement
help wanted
invalid
meta
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#235
Loading…
Reference in New Issue
No description provided.
Delete Branch "moritz/abra:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In case the recipe catalogue server is not accessible most abra commands will not work anymore.
Proposal for coop-cloud/organising#292 :
Show an error and continue with the local recipe catalogue.
This way
abra app deploy -C
andabra app upgrade -C
should still work when the server is down.I'm not sure if supressing this error could lead to any unexpected behaviour.
As I could follow the flow, the following commands will use the
ReadRecipeCatalogue
funciton:abra app list --status
abra app rollback
abra app upgrade
abra app catalogue generate
abra app version
abra app backup
abra app errors
abra app restore
abra app new
abra recipe lint
abra recipe versions
abra recipe release
abra recipe sync
abra recipe upgrade
@moritz
This is a nice approach! I had a look at the code again, perhaps we could be more specific on the kind of error return value handling from
recipeCatalogueFSIsLatest
? E.g. when it does:And fails, instead of
return false, err
we can doreturn false, CatalogueOfflineError()
or something. Then we can do anerrors.Is(...)
check on theerr != nil
check and do thelogrus.Error("unable to retrieve catalogue from internet, using local copy")
change as you suggested here? Because some of the errors thatrecipeCatalogueFSIsLatest
are valid and should result in failing to continue.One thing to check for is the "first use" case, when there is no local catalogue copy. If we do indeed fail to retrieve it from the internet we should check there is a local copy. If not, there isn't much we can do and we should fail to continue? That shouldn't happen too much ofc.
I changed it,so it catches only
CatalogueOfflineErrors
.The check if there is a local copy is already present:
4e78b060e0/pkg/recipe/recipe.go (L725)
LGTM
@moritz if you're happy with it, please merge away!
1892e068a3
to7bba18b47b