Skip to content

Commit b4cc7f1

Browse files
committed
Fix DockerImageMetadata reading when dealing with versioned client
1 parent d6dc19b commit b4cc7f1

File tree

12 files changed

+155
-151
lines changed

12 files changed

+155
-151
lines changed

pkg/image/apiserver/admission/limitrange/admission.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (a *imageLimitRangerPlugin) ValidateLimit(limitRange *kapi.LimitRange, kind
140140
}
141141

142142
image := &isObj.Image
143-
if err := util.ImageWithMetadata(image); err != nil {
143+
if err := util.InternalImageWithMetadata(image); err != nil {
144144
return err
145145
}
146146

pkg/image/apiserver/registry/image/strategy.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (imageStrategy) NamespaceScoped() bool {
4545
func (s imageStrategy) PrepareForCreate(ctx context.Context, obj runtime.Object) {
4646
newImage := obj.(*imageapi.Image)
4747
// ignore errors, change in place
48-
if err := util.ImageWithMetadata(newImage); err != nil {
48+
if err := util.InternalImageWithMetadata(newImage); err != nil {
4949
utilruntime.HandleError(fmt.Errorf("Unable to update image metadata for %q: %v", newImage.Name, err))
5050
}
5151
if newImage.Annotations[imageapi.ImageManifestBlobStoredAnnotation] == "true" {
@@ -124,7 +124,7 @@ func (s imageStrategy) PrepareForUpdate(ctx context.Context, obj, old runtime.Ob
124124
}
125125
}
126126

127-
if err = util.ImageWithMetadata(newImage); err != nil {
127+
if err = util.InternalImageWithMetadata(newImage); err != nil {
128128
utilruntime.HandleError(fmt.Errorf("Unable to update image metadata for %q: %v", newImage.Name, err))
129129
}
130130

pkg/image/apiserver/registry/imagestreamimage/rest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func (r *REST) Get(ctx context.Context, id string, options *metav1.GetOptions) (
9393
if err != nil {
9494
return nil, err
9595
}
96-
if err := util.ImageWithMetadata(image); err != nil {
96+
if err := util.InternalImageWithMetadata(image); err != nil {
9797
return nil, err
9898
}
9999
image.DockerImageManifest = ""

pkg/image/apiserver/registry/imagestreamimport/rest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ func (r *REST) importSuccessful(
520520
updated, err := r.images.Create(ctx, image, rest.ValidateAllObjectFunc, false)
521521
switch {
522522
case kapierrors.IsAlreadyExists(err):
523-
if err := util.ImageWithMetadata(image); err != nil {
523+
if err := util.InternalImageWithMetadata(image); err != nil {
524524
glog.V(4).Infof("Unable to update image metadata during image import when image already exists %q: %v", image.Name, err)
525525
}
526526
updated = image

pkg/image/apiserver/registry/imagestreamtag/rest.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func newISTag(tag string, imageStream *imageapi.ImageStream, image *imageapi.Ima
444444
}
445445

446446
if image != nil {
447-
if err := util.ImageWithMetadata(image); err != nil {
447+
if err := util.InternalImageWithMetadata(image); err != nil {
448448
return nil, err
449449
}
450450
image.DockerImageManifest = ""

pkg/image/importer/importer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func (isi *ImageStreamImporter) importManifest(ctx gocontext.Context, manifest d
444444
return
445445
}
446446

447-
if err := util.ImageWithMetadata(image); err != nil {
447+
if err := util.InternalImageWithMetadata(image); err != nil {
448448
return image, err
449449
}
450450

0 commit comments

Comments
 (0)