Skip to content
This repository was archived by the owner on Aug 21, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions runner-manager/cfd/cmd/drive/get_job_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ type CIVar struct {
Value string
}

// match images w/ docker domain, or no domain (i.e. docker by default)
var domainRegex = regexp.MustCompile(`^((registry-\d+|index)?\.?docker\.io\/|[^.]*(:|$))`)

type VcapAppData struct {
CFApi string `json:"cf_api"`
OrgID string `json:"org_id"`
Expand Down Expand Up @@ -197,14 +200,11 @@ func (cfg *JobConfig) processImage(img Image, m *cloudgov.AppManifest) {
if img.Name != "" {
m.Docker.Image = img.Name

// match images w/ docker domain, or no domain (i.e. docker by default)
re := regexp.MustCompile(`^((registry-\d+|index)?\.?docker\.io\/|[^.]*(:|$))`)

// TODO: #95
if strings.Contains(img.Name, "registry.gitlab.com") {
m.Docker.Username = cfg.CIRegistryUser
m.Docker.Password = cfg.CIRegistryPass
} else if re.FindString(img.Name) != "" {
} else if domainRegex.FindString(img.Name) != "" {
m.Docker.Username = cfg.DockerHubUser
m.Docker.Password = cfg.DockerHubToken
}
Expand Down