Bug 1332944

Summary: Different errors when trying to modify pod's .spec.container.resources
Product: OpenShift Container Platform Reporter: Maciej Szulik <maszulik>
Component: MasterAssignee: Derek Carr <decarr>
Status: CLOSED ERRATA QA Contact: weiwei jiang <wjiang>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.0CC: aos-bugs, decarr, jokerman, mmccomas, tdawson, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-27 09:31:52 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maciej Szulik 2016-05-04 12:02:18 UTC
Description of problem:
Different errors when trying to modify pod's .spec.container.resources.

Version-Release number of selected component (if applicable):
OpenShift Master:
    v3.2.0.40
Kubernetes Master:
    v1.2.0-36-g4a3f9c5 


How reproducible:
Always


Steps to Reproduce:
1. Go to pods list
2. Choose one pod (eg. current deployment)
3. Click edit yaml
4. Try to modify container.resources.limits or container.resources.requests

Actual results:
Failed to update django-10-30bqb.
pods "django-10-30bqb" is forbidden: Unable to update quota status: compute-resources ResourceQuota "compute-resources" is invalid: [status.used[limits.cpu]: Invalid value: "-800m": must be greater than or equal to 0, status.used[limits.memory]: Invalid value: "-212Mi": must be greater than or equal to 0]

Expected results:
The same as from invoking oc edit pod/jango-10-30bqb:

# pods "django-10-30bqb" was not valid:
# * spec: Forbidden: pod updates may not change fields other than `containers[*].image` or `spec.activeDeadlineSeconds`

Comment 1 Jordan Liggitt 2016-05-06 14:03:28 UTC
Derek, should the resourcequota admission plugin even be processing the pod spec on update, since the spec isn't mutable?

Comment 2 Derek Carr 2016-05-06 14:21:56 UTC
ResourceQuota will ignore pod updates in kube 1.3+ with this PR:

https://github.com/kubernetes/kubernetes/pull/24514

Updating a pod container's resources will still cause a validation error.

Comment 3 Jordan Liggitt 2016-05-06 17:18:33 UTC
thanks, can you move to ON_QA once we pull in a level with this fix?

Comment 4 Derek Carr 2016-05-06 17:19:16 UTC
sure thing

Comment 6 weiwei jiang 2016-08-09 09:36:34 UTC
Checked with 
# openshift version 
openshift v3.3.0.17
kubernetes v1.3.0+507d3a7
etcd 2.3.0+git
and console got the same error message 
Pod "pod-request-limit-valid-3" is invalid: spec: Forbidden: pod updates may not change fields other than `containers[*].image` or `spec.activeDeadlineSeconds`
with oc edit

Comment 8 errata-xmlrpc 2016-09-27 09:31:52 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/RHBA-2016:1933