Browse Source

Replace docker.io with index.docker.io in ImageID

Sam Broughton 3 years ago
parent
commit
49be450e3a
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      image.go

+ 6
- 0
image.go View File

@@ -12,6 +12,8 @@ import (
12 12
 const (
13 13
 	dockerHubHost    = "index.docker.io"
14 14
 	dockerHubLibrary = "library"
15
+
16
+	oldDockerHubHost = "docker.io"
15 17
 )
16 18
 
17 19
 var (
@@ -61,6 +63,10 @@ func ParseImageID(s string) (ImageID, error) {
61 63
 		img.Namespace = parts[0]
62 64
 		img.Image = parts[1]
63 65
 	case 3:
66
+		// Replace docker.io with index.docker.io (#692)
67
+		if parts[0] == oldDockerHubHost {
68
+			parts[0] = dockerHubHost
69
+		}
64 70
 		img.Host = parts[0]
65 71
 		img.Namespace = parts[1]
66 72
 		img.Image = parts[2]

Loading…
Cancel
Save