Bug 1491589 - Image Size Limit does not work
Summary: Image Size Limit does not work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.7.0
Assignee: Oleg Bulatov
QA Contact: Dongbo Yan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-14 08:43 UTC by zhou ying
Modified: 2017-11-28 22:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: the size of an image is not available on the api side Consequence: the size is zero for schema 1 manifests Fix: send the image size from the registry side Result: bug fixed
Clone Of:
Environment:
Last Closed: 2017-11-28 22:10:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description zhou ying 2017-09-14 08:43:38 UTC
Description of problem:
After set the image size limit, still could push image larger than the limit to project. The image size limit does not work.

Version-Release number of selected component (if applicable):
openshift v3.7.0-0.126.1
kubernetes v1.7.0+80709908fd
etcd 3.2.1

How reproducible:
always

Steps to Reproduce:
1. Create limit for the project:
apiVersion: "v1"
kind: "LimitRange"
metadata:
  name: "openshift-resource-limits"
spec:
  limits:
    - type: openshift.io/Image
      max:
        storage: 65Mi
    - type: openshift.io/ImageStream
      max:
        openshift.io/image-tags: 20
        openshift.io/images: 30
2. Try to push image with size larger than the max storage size 65Mi.


Actual results:
2. Push image with size larger than the max storage succeed.


Expected results:
2. Should push failed.



Additional info:

Comment 3 Michal Minar 2017-09-29 12:19:09 UTC
PR with a fix: https://github.com/openshift/origin/pull/16325

Comment 4 Ben Parees 2017-10-05 03:59:41 UTC
PR has merged. Moving to modified.

Comment 5 Michal Minar 2017-10-12 09:20:45 UTC
The previous PR is insufficient: here's a follow-up on review: https://github.com/openshift/origin/pull/16776

Comment 6 Ben Parees 2017-10-18 20:14:29 UTC
Oleg, Looks like you are working on this here now:
https://github.com/openshift/origin/pull/16885

let me know if that's incorrect.

Comment 8 zhou ying 2017-10-27 09:23:36 UTC
Confirmed with the latest OCP, the issue has fixed:
openshift version
openshift v3.7.0-0.179.0
kubernetes v1.7.6+a08f5eeb62
etcd 3.2.8


When try to push image larger than the limits, will met error:
level=error msg="denied creating ImageStreamMapping: imagestreammappings.image.openshift.io \"singlelayer\" is forbidden: requested usage of storage exceeds the maximum limit per openshift.io/Image (159303155 > 65Mi)"

Comment 12 errata-xmlrpc 2017-11-28 22:10:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2017:3188


Note You need to log in before you can comment on or make changes to this bug.