Recipe: support digest pinning at upgrade-time #916
Open
sixsmith
wants to merge 10 commits from
sixsmith/abra:main into main
pull from: sixsmith/abra:main
merge into: :main
:main
:renovate/golang-1.27
:renovate/tonistiigi-xx-1.x
:renovate/github.com-charmbracelet-log-2.x
:renovate/alpine-3.x
:renovate/github.com-charmbracelet-bubbletea-2.x
:feat/container-labels
:renovate/github.com-charmbracelet-lipgloss-2.x
:renovate/codespell-2.x
:local-integration-testing
:fix/492
:chore-deps
:fix/deps
:fix/613
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze (Born Deleuze)
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
dannygroenewegen (Danny Groenewegen)
decentral1se (d1)
dede
devydave
fauno (fauno)
hex (Josh Dukes)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1 (p4u1)
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting (stevensting)
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#916
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This change adds a
--pindigestsflag toabra recipe upgrade. The recipe maintainer still chooses a tagged container version that is semver-like, but abra will write the tag+multiplatform digest tocompose.yml.TODO
Fixes #892
1f8b51ab40to0f7d991709Just to get it into the issue also:
Will this still work with renovate? Also how will abra recipe upgrade behave with digests regarding versioning?
@p4u1 Yes, it should work with renovate. By default it'll attempt to add pins, the user can disable if they want with
--pindigests=false.abra recipe upgrade/releaseshould use the version before@, so semver basically. There isn't a test for releasing though, I'll add one.On second thought,
recipe_release.batsshould cover the release path since those tests run an upgrade first - and--pindigestsis true by default on those upgrades.@@ -333,4 +336,3 @@var tag stringswitch img.(type) {case reference.NamedTagged:remove the empty switch case
@@ -295,2 +302,3 @@if upgradeTag != "skip" {ok, err := recipe.UpdateTag(image, upgradeTag)var resolvedDigest stringif shouldPin(service.Image, internal.PinDigests) {the logs and function calls in the file diverge, the logs use the variable image in most cases and shouldPin checks service.Image, maybe you can generalize that. If that does not work it would be nice to document why service.Image is used.
@@ -9,6 +9,8 @@ import ("github.com/containers/image/docker""github.com/containers/image/types""github.com/distribution/reference""github.com/regclient/regclient"Is there a way to have the same logic without a new dependency?
@@ -40,2 +42,4 @@}// GetTagAndDigest returns the tag and any digest for comparison and display.func GetTagAndDigest(image reference.Named) string {More of a nit pick, but I would rename it to GetTagWithDigest because it only returns only one variable
@@ -170,0 +190,4 @@// Don't confuse digests if the image isn't an exact match. E.g. if old is postgres:13, don't// match postgres:13-alpinepattern := regexp.MustCompile(`(?m)(^\s*image:\s*["']?)` + regexp.QuoteMeta(old) + `(["']?\s*(?:#.*)?$)`)Can you explain the regex in detail? Is it copied from somewhere or is there a spec to extract the pattern like that?
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.