Skip to content

Commit b439617

Browse files
Copilotj143
andauthored
Adjust credential host stripping to handle all @ positions
Agent-Logs-Url: https://github.com/j143/basic-docker-engine/sessions/9b259d2d-2dd2-4094-849b-5fb1f50355c2 Co-authored-by: j143 <53068787+j143@users.noreply.github.com>
1 parent 8f765d7 commit b439617

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ func resolveRegistry(imageName string) (string, string) {
617617
parts := strings.SplitN(imageName, "/", 2)
618618
if len(parts) == 2 {
619619
host := parts[0]
620-
if at := strings.LastIndex(host, "@"); at >= 0 && at < len(host)-1 {
620+
if at := strings.LastIndex(host, "@"); at >= 0 {
621621
host = host[at+1:]
622622
}
623623
if strings.Contains(host, ".") || strings.Contains(host, ":") || host == "localhost" {

0 commit comments

Comments
 (0)