Fix to allow repo replication when using non-standard port for core
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.
How do you specify another port other than 8080? How do you deploy the Harbor? docker-compose or kubernetes?
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.
not stale. @nickhyoti fix DCO.
not stale. @nickhyoti fix DCO. tried following the instructions to fix this but get a permissions error.