harbor icon indicating copy to clipboard operation
harbor copied to clipboard

Fix to allow repo replication when using non-standard port for core

Open nickhyoti opened this issue 4 months ago • 4 comments

Use CORE_LOCAL_URL instead of hardcoded setting

Thank you for contributing to Harbor!

Comprehensive Summary of your change

In our environment we are using a non-standard port setting for Core.
Instead of 8080, we are using 8000. When we try and setup repository replication we get a message

Failed to create adapter for destination registry http://core: Get "http://127.0.0.1:8080/api/version": dial tcp http://127.0.0.1:8080:connect: connection refused

This is because there is a hardcoded port in the function GetURL. There is already an environment variable defined which has the correct URL for core, so use that instead

Issue being fixed

Fixes unable to setup repo replication when using non-standard port on core

Please indicate you've done the following:

  • [X] Well Written Title and Summary of the PR
  • [X] Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • [X] Accepted the DCO. Commits without the DCO will delay acceptance.
  • [X] Made sure tests are passing and test coverage is added if needed.
  • [X] Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

nickhyoti avatar Aug 21 '25 12:08 nickhyoti

How do you specify another port other than 8080? How do you deploy the Harbor? docker-compose or kubernetes?

stonezdj avatar Aug 25 '25 08:08 stonezdj

This PR is being marked stale due to a period of inactivty. If this PR is still relevant, please comment or remove the stale label. Otherwise, this PR will close in 30 days.

github-actions[bot] avatar Dec 01 '25 09:12 github-actions[bot]

not stale. @nickhyoti fix DCO.

bupd avatar Dec 02 '25 13:12 bupd

not stale. @nickhyoti fix DCO. tried following the instructions to fix this but get a permissions error.

nickhyoti avatar Dec 02 '25 15:12 nickhyoti