Selaa lähdekoodia

Merge pull request #9754 from tiborvass/remove-insecure-registry-all-ports

registry: remove accidentally added --insecure-registry feature
Jessie Frazelle 10 vuotta sitten
vanhempi
commit
ed49db8984
2 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 1 1
      registry/endpoint.go
  2. 2 1
      registry/registry_test.go

+ 1 - 1
registry/endpoint.go

@@ -190,7 +190,7 @@ func isSecure(hostname string, insecureRegistries []string) (bool, error) {
 	}
 	}
 
 
 	for _, r := range insecureRegistries {
 	for _, r := range insecureRegistries {
-		if hostname == r || host == r {
+		if hostname == r {
 			// hostname matches insecure registry
 			// hostname matches insecure registry
 			return false, nil
 			return false, nil
 		}
 		}

+ 2 - 1
registry/registry_test.go

@@ -350,7 +350,8 @@ func TestIsSecure(t *testing.T) {
 		{"42.42.42.42:5000", []string{"42.1.1.1/8"}, false},
 		{"42.42.42.42:5000", []string{"42.1.1.1/8"}, false},
 		{"invalid.domain.com", []string{"42.42.0.0/16"}, true},
 		{"invalid.domain.com", []string{"42.42.0.0/16"}, true},
 		{"invalid.domain.com", []string{"invalid.domain.com"}, false},
 		{"invalid.domain.com", []string{"invalid.domain.com"}, false},
-		{"invalid.domain.com:5000", []string{"invalid.domain.com"}, false},
+		{"invalid.domain.com:5000", []string{"invalid.domain.com"}, true},
+		{"invalid.domain.com:5000", []string{"invalid.domain.com:5000"}, false},
 	}
 	}
 	for _, tt := range tests {
 	for _, tt := range tests {
 		// TODO: remove this once we remove localhost insecure by default
 		// TODO: remove this once we remove localhost insecure by default