File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -1286,13 +1286,12 @@ func validateImageRepository(imageRepo string) (validImageRepo string) {
1286
1286
klog .Errorln ("Error Parsing URL: " , err )
1287
1287
}
1288
1288
1289
- var hasPorts = false
1290
1289
var imageRepoPort string
1291
1290
1292
1291
if URL .Port () != "" && strings .Contains (imageRepo , ":" + URL .Port ()) {
1293
- hasPorts = true
1294
1292
imageRepoPort = ":" + URL .Port ()
1295
1293
}
1294
+
1296
1295
// tips when imageRepo ended with a trailing /.
1297
1296
if strings .HasSuffix (imageRepo , "/" ) {
1298
1297
out .Infof ("The --image-repository flag your provided ended with a trailing / that could cause conflict in kuberentes, removed automatically" )
@@ -1301,12 +1300,8 @@ func validateImageRepository(imageRepo string) (validImageRepo string) {
1301
1300
if URL .Scheme != "" {
1302
1301
out .Infof ("The --image-repository flag your provided contains Scheme: {{.scheme}}, which will be removed automatically" , out.V {"scheme" : URL .Scheme })
1303
1302
}
1304
-
1305
- if hasPorts {
1306
- validImageRepo = URL .Hostname () + imageRepoPort + strings .TrimSuffix (URL .Path , "/" )
1307
- } else {
1308
- validImageRepo = URL .Hostname () + strings .TrimSuffix (URL .Path , "/" )
1309
- }
1303
+
1304
+ validImageRepo = URL .Hostname () + imageRepoPort + strings .TrimSuffix (URL .Path , "/" )
1310
1305
1311
1306
return validImageRepo
1312
1307
}
You can’t perform that action at this time.
0 commit comments