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 typo in warning about existing volume #10623

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

jfly
Copy link
Contributor

@jfly jfly commented May 25, 2023

Previously, this was telling us "but was not created for project [project-it-was-created-for]", which is wrong. I opted to make the message super explicit and print both the actual project and the expected project.

What I did

Related issue
I couldn't find an existing issue for this.

(not mandatory) A picture of a cute animal, if possible in relation to what you did

This surprised koala has been my phone background ever since I got my first smartphone:

image

Previously, this was telling us "but was not created for project
[project-it-was-created-for]", which is wrong. I opted to make the
message super explicit and print both the actual project and the
expected project.

Signed-off-by: Jeremy Fleischman <jeremyfleischman@gmail.com>
@jfly jfly force-pushed the jfly/tweak-warning-message branch from 30d6443 to 3d05a1b Compare May 26, 2023 00:16
Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks for the PR!

@milas milas self-assigned this May 31, 2023
@milas milas added the kind/bug label May 31, 2023
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.07 ⚠️

Comparison is base (42cd961) 59.57% compared to head (3d05a1b) 59.51%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10623      +/-   ##
==========================================
- Coverage   59.57%   59.51%   -0.07%     
==========================================
  Files         107      107              
  Lines        9437     9437              
==========================================
- Hits         5622     5616       -6     
- Misses       3239     3243       +4     
- Partials      576      578       +2     
Impacted Files Coverage Δ
pkg/compose/create.go 61.09% <0.00%> (ø)

... and 1 file with indirect coverage changes

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

@milas milas requested review from a team, nicksieger, ndeloof, StefanScherer, ulyssessouza and glours and removed request for a team May 31, 2023 22:24
@@ -1194,7 +1194,7 @@ func (s *composeService) ensureVolume(ctx context.Context, volume types.VolumeCo
logrus.Warnf("volume %q already exists but was not created by Docker Compose. Use `external: true` to use an existing volume", volume.Name)
}
if ok && p != project {
logrus.Warnf("volume %q already exists but was not created for project %q. Use `external: true` to use an existing volume", volume.Name, p)
logrus.Warnf("volume %q already exists but was created for project %q (expected %q). Use `external: true` to use an existing volume", volume.Name, p, project)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@milas, I could use some help here with the code coverage complaint. I checked, and none of the existing tests seem to execute this ensureVolume function at all, so there isn't anything easy for me to copy paste to start writing a test to cover this code. I don't know much of anything about go or this codebase, so I could use some pretty hand-holdy pointers if you want me to try to do that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfly our code coverage configuration doesn't work correctly ATM, so don't worry, your PR won't be blocked by this check

Copy link
Contributor

@glours glours left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours glours merged commit 6530880 into docker:v2 Jun 1, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants