You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnnil, nil, fmt.Errorf("tag %q already exists - you must use the 'tag' command if you want to change the source to %q", tag, from)
326
-
}
327
-
iflen(from) !=0&&from!=existing.From.Name {
328
-
ifmultiple {
329
-
returnnil, nil, fmt.Errorf("the tag %q points to the tag %q which points to %q - use the 'tag' command if you want to change the source to %q", tag, finalTag, existing.From.Name, from)
330
-
}
331
-
returnnil, nil, fmt.Errorf("the tag %q points to %q - use the 'tag' command if you want to change the source to %q", tag, existing.From.Name, from)
// if the from is still empty this means there's no such tag defined
352
-
// nor we can't create any from .spec.dockerImageRepository
353
-
iflen(from) ==0 {
354
-
returnnil, nil, fmt.Errorf("the tag %q does not exist on the image stream - choose an existing tag to import or use the 'tag' command to create a new tag", tag)
355
-
}
356
-
existing=&imageapi.TagReference{
357
-
From: &kapi.ObjectReference{
358
-
Kind: "DockerImage",
359
-
Name: from,
360
-
},
361
-
}
279
+
from, err=o.importTag(stream)
280
+
iferr!=nil {
281
+
returnnil, nil, err
362
282
}
363
-
stream.Spec.Tags[tag] =*existing
364
283
}
365
284
}
366
285
@@ -369,7 +288,6 @@ func (o *ImportImageOptions) createImageImport() (*imageapi.ImageStream, *imagea
369
288
returnnil, nil, fmt.Errorf("unexpected error, from is empty")
370
289
}
371
290
372
-
// Attempt the new, direct import path
373
291
isi:=&imageapi.ImageStreamImport{
374
292
ObjectMeta: kapi.ObjectMeta{
375
293
Name: stream.Name,
@@ -405,3 +323,109 @@ func (o *ImportImageOptions) createImageImport() (*imageapi.ImageStream, *imagea
return"", fmt.Errorf("tag %q already exists - you must use the 'tag' command if you want to change the source to %q", tag, from)
391
+
}
392
+
iflen(from) !=0&&from!=existing.From.Name {
393
+
ifmultiple {
394
+
return"", fmt.Errorf("the tag %q points to the tag %q which points to %q - use the 'tag' command if you want to change the source to %q", tag, finalTag, existing.From.Name, from)
395
+
}
396
+
return"", fmt.Errorf("the tag %q points to %q - use the 'tag' command if you want to change the source to %q", tag, existing.From.Name, from)
// if the from is still empty this means there's no such tag defined
417
+
// nor we can't create any from .spec.dockerImageRepository
418
+
iflen(from) ==0 {
419
+
return"", fmt.Errorf("the tag %q does not exist on the image stream - choose an existing tag to import or use the 'tag' command to create a new tag", tag)
0 commit comments