Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always add missing slashes to link names #1588

Merged
merged 1 commit into from
Mar 12, 2023
Merged

Conversation

piksel
Copy link
Member

@piksel piksel commented Mar 12, 2023

This PR changes so that container links (which are most of the time actually sourced from depends-on labels) are always prefixed with /. Previously, this was only done when marking dependant containers for restart, but since the names should ALWAYS start with a slash, this fix should be performed every time the container links are iterated.
The only downside to this is that it's less performant (as it needs to copy the strings instead of just having the slices point to the same source string), but it should not be noticeable.

Since the links are used to match against container names, only fixing the slashes in one place caused some strange behaviour which should now be fixed:

previously, this was only done when marking  dependant containers
for restart. but since the names should ALWAYS start with a slash,
this check could be performed every time the container is iterated.
the only downside to this is that it's less performant (as it needs to
copy the strings instead of just having the slices point to the same
source string), but it should not be noticable.
@piksel piksel requested a review from simskij as a code owner March 12, 2023 09:50
@codecov
Copy link

codecov bot commented Mar 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (bbbe041) 66.91% compared to head (533bfc0) 66.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1588   +/-   ##
=======================================
  Coverage   66.91%   66.91%           
=======================================
  Files          25       25           
  Lines        2376     2376           
=======================================
  Hits         1590     1590           
  Misses        685      685           
  Partials      101      101           
Impacted Files Coverage Δ
internal/actions/update.go 70.37% <ø> (-0.62%) ⬇️
pkg/container/container.go 55.43% <100.00%> (+0.99%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@piksel piksel merged commit 9470bf8 into main Mar 12, 2023
@piksel piksel deleted the fix/linked-sorting branch March 12, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Link detection/depends-on label not working as documented depends-on / linked containers not working
1 participant