Skip to content
Snippets Groups Projects

WIP: Accept hostname/port combinations in image names

Closed Stan Hu requested to merge accept-hostname-ports-in-images into master
1 unresolved thread

Specifying a custom hostname and port causes name collisions to occur, preventing clones from occurring due to DNS failures. This happens if the hostname of the registry and the GitLab server are same but on different ports. For example:

  1. gitlab.example.com is the GitLab server
  2. gitlab.example.com:4567 is the Registry

Previously an image named gitlab.example.com:4567/namespace/project would be aliased to gitlab.example.com, since everything after the colon would be stripped.

Closes #1434 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
468 afterSlash := name[i+1:]
469
470 if i >= 0 && strings.IndexRune(afterSlash, '/') >= 0 {
471 hostname, remoteName = name[:i], afterSlash
472 } else {
473 hostname, remoteName = "", name
474 }
475
476 return
477 }
478
465 479 func (s *executor) splitServiceAndVersion(serviceDescription string) (service string, version string, linkNames []string) {
466 splits := strings.SplitN(serviceDescription, ":", 2)
480 hostname, remoteName := splitHostname(serviceDescription)
481
482 splits := strings.SplitN(remoteName, ":", 2)
  • Mentioned in issue #1868 (closed)

  • Author Maintainer

    I'll close this in favor of !376 (merged).

  • Stan Hu Status changed to closed

    Status changed to closed

  • Stan Hu Mentioned in merge request !376 (merged)

    Mentioned in merge request !376 (merged)

  • Please register or sign in to reply
    Loading