Skip to content

hosts.toml file resolution does not seem to account for default port being ommitted #3047

Closed
@apostasie

Description

@apostasie

Description

nerdctl login https://foo:443
vs.
nerdctl login https://foo

If the hosts.toml path contains the port, the second one will fail.
On the other hand, if it does not, the first one will fail.

Responsibility for walking the host dir is in dockerconfigresolver.go (NewHostOptions > HostDir()).
This does not try to be smart wrt what the host contains (port or no port).

We should patch this so:

  • if scheme is https, passing :443 or not passing it should work
  • all of this should work with hosts.toml files path containing the port or not

Steps to reproduce the issue

See description

Describe the results you received and expected

Fail / not fail.

What version of nerdctl are you using?

1.7.6

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions