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

Redirect both the hostname and port for TCP connections #790

Closed
1 task
shizhMSFT opened this issue Feb 8, 2023 · 3 comments · Fixed by #801
Closed
1 task

Redirect both the hostname and port for TCP connections #790

shizhMSFT opened this issue Feb 8, 2023 · 3 comments · Fixed by #801
Labels
enhancement New feature or request
Milestone

Comments

@shizhMSFT
Copy link
Contributor

What is the version of your ORAS CLI

v1.0.0-rc.1

What would you like to be added?

The oras allows the flag --resolve host:port:address to dial to an another host, which works like /etc/hosts. However, it does not redirect the ports.

Therefore, it would be nice to have

--resolve host:port:address[:port]

Why is this needed for ORAS?

It is useful to do local development by using a local registry as a remote registry.

For example:

oras push --resolve registry.contoso.com:443:localhost:5000 registry.contoso.com/hello hello.txt

Are you willing to submit PRs to contribute to this feature?

  • Yes, I am willing to implement it.
@shizhMSFT shizhMSFT added the enhancement New feature or request label Feb 8, 2023
@shizhMSFT shizhMSFT added this to the v1.0.0-rc.2 milestone Feb 8, 2023
@qweeah
Copy link
Contributor

qweeah commented Feb 8, 2023

I think the example is wrong? In rc1, the push command looks like below

oras push --resolve registry.contoso.com:5000:localhost registry.contoso.com:5000/hello hello.txt

Since the default port of non-plain-http is 443, the destination port should be 443 and oras will map it to 5000. The command looks like below

oras push --resolve registry.contoso.com:443:localhost:5000 registry.contoso.com/hello hello.txt

@shizhMSFT
Copy link
Contributor Author

The example in the description is exactly the same as you've provided.

@qweeah
Copy link
Contributor

qweeah commented Feb 8, 2023

The example in the description is exactly the same as you've provided.

Oh Indeed.

shizhMSFT pushed a commit that referenced this issue Feb 22, 2023
This PR enhances `--resolve` flag by allowing users to specify
destination port during DNS lookup.

Resolves #790.

Signed-off-by: Billy Zha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants