-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
volume/local: Make host resolution backwards compatible #47185
Conversation
09b24d1
to
6387429
Compare
6387429
to
f8dd745
Compare
bddccfd
to
cb33e4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Good call from @robmry; let's look at that
799dd22
to
0157e3d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - although duplicating the code seems like a bit of a shame... could factor it out into a closure that returns a bool to say whether it did anything?
Commit 8ae94ca added a DNS resolution of the `device` part of the volume option. The previous way to resolve the passed hostname was to use `addr` option, which was handled by the same code path as the `nfs` mount type. The issue is that `addr` is also an SMB module option handled by kernel and passing a hostname as `addr` produces an invalid argument error. To fix that, restore the old behavior to handle `addr` the same way as before, and only perform the new DNS resolution of `device` if there is no `addr` passed. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
0157e3d
to
0d51cf9
Compare
Removed the duplication, not using a closure though it would make it less readable and more complex than plain duplication IMO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Seeing failures like this quite frequently in the BuildKit integration tests. Not specifically this address, but seems to be general lookup / "not found" failures (?)
Either way; it's not related to this PR, so kicked CI again. Hoping one day we have stats / metrics from CI, so that we can identify flaky tests. |
Commit 8ae94ca added a DNS resolution of the
device
part of the volume option.The previous way to resolve the passed hostname was to use
addr
option, which was handled by the same code path as thenfs
mount type.The issue is that
addr
is also an SMB module option handled by kernel and passing a hostname asaddr
produces an invalid argument error.To fix that, restore the old behavior to handle
addr
the same way as before, and only perform the new DNS resolution ofdevice
if there is noaddr
passed.NOTE: While kernel docs don't mention the
addr
option (https://www.kernel.org/doc/html/latest/admin-guide/cifs/usage.html#use-instructions), it's actually present in the source: https://github.com/torvalds/linux/blob/7ed2632ec7d72e926b9e8bcc9ad1bb0cd37274bf/fs/smb/client/fs_context.c#L166- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)