WIP: check if labels are nil before adding labels #449
Closed
ammaratef45
wants to merge 1 commits from
nil_labels into main
pull from: nil_labels
merge into: :main
:main
:renovate/golang-1.25
:fix/492
:local-integration-testing
:renovate/github.com-charmbracelet-lipgloss-2.x
:renovate/otel-weaver-0.x
:renovate/codespell-2.x
:renovate/github.com-charmbracelet-bubbletea-2.x
:renovate/tonistiigi-xx-1.x
:renovate/alpine-3.x
:renovate/github.com-charmbracelet-log-2.x
: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
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
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
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
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#449
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.
For toolshed/organising#643
I tested it by playing with a local recipe, create an app instance without labels (failed to deploy initially), tried with the changes, deploy succeeded AND labels existed when I inspected the service on the swarm box 🎊
One minor comment, see what you think about it! Otherwise, very legit, tysm! 🤘
@@ -89,0 +89,4 @@func AddLabel(service composetypes.ServiceConfig, labelKey string, value string) {if service.Deploy.Labels == nil {service.Deploy.Labels = composetypes.Labels{}We have an unwritten (🙈) convention to use
...version=unknownwhen we don't know what the version label will be. For example:bba1640913/pkg/upstream/stack/stack.go (L113)More examples here.
So, maybe it's an idea to manually set the same config to be "unknown"?
I think this might be important in the case of "set label" logic since other logic will try to read this label later on.
Or, maybe it's too complicated / too much assumption. I am not sure. This will set the label on the deployed containers but it won't be present on the compose config?
Thanks for this comment, it made me realize my change silences the error but doesn't really add the labels
Gonna dig deeper
On a second thought, this solution didn't really work
I did
docker service inspect <app_name>_appand sawLabelsand was like Wohoo all goodThe labels that exist are
com.docker.stack.imageandcom.docker.stack.namespace😥Took a pass on this one!
toolshed/organising#643 (comment)
Pull request closed