Bug 1334866 - metadata.deletionTimestamp settable during update
Summary: metadata.deletionTimestamp settable during update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Master
Version: 3.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jordan Liggitt
QA Contact: weiwei jiang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-10 16:57 UTC by Jordan Liggitt
Modified: 2016-10-30 22:54 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, it was possible to set the metadata.deletionTimestamp parameter during the update of an object. However, deletionTimestamp and deletionGracePeriodSeconds fields should only be able to be set as a result of a delete API operation. This bug fix ensures that the parameter cannot be set during update, and any attempts now produce a "field is immutable; may only be changed via deletion" error.
Clone Of:
Environment:
Last Closed: 2016-06-27 15:07:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1343 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 3.2.1.1 bug fix and enhancement update 2016-06-27 19:04:05 UTC

Description Jordan Liggitt 2016-05-10 16:57:48 UTC
Description of problem:

During update of an object, metadata.deletionTimestamp can be set. deletionTimestamp and deletionGracePeriodSeconds fields should only be able to be set as a result of a delete API operation.


Upstream issue: https://github.com/kubernetes/kubernetes/issues/24828
Upstream fix: https://github.com/kubernetes/kubernetes/pull/24839


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Jordan Liggitt 2016-05-10 16:59:27 UTC
Fixed in https://github.com/openshift/ose/pull/193

Comment 3 weiwei jiang 2016-06-06 10:16:46 UTC
Checked with atomic-openshift-3.2.1.1-1.git.0.96f9555.el7, and the deletionTimestamp is an immutable field now.

# oc edit dc php
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
# deploymentconfigs "php" was not valid:
# * metadata.deletionTimestamp: Invalid value: "2016-06-06T09:52:05Z": field is immutable; may only be changed via deletion
# * metadata.deletionTimestamp: Invalid value: "2016-06-06T09:52:05Z": field is immutable; may only be changed via deletion
#
apiVersion: v1
kind: DeploymentConfig
metadata:
  annotations:
    openshift.io/generated-by: OpenShiftWebConsole
  creationTimestamp: 2016-06-06T09:51:05Z
  deletionTimestamp: 2016-06-06T09:52:05Z


# oc patch dc php -p '{"metadata":{"deletionTimestamp":"2016-06-06T09:52:05Z"}}' 
The DeploymentConfig "php" is invalid.

* metadata.deletionTimestamp: Invalid value: "2016-06-06T09:52:05Z": field is immutable; may only be changed via deletion
* metadata.deletionTimestamp: Invalid value: "2016-06-06T09:52:05Z": field is immutable; may only be changed via deletion

But why display the message twice?

Comment 4 Jordan Liggitt 2016-06-06 13:50:49 UTC
validation of core object metadata fields is done centrally on update of all objects. some object update validation also calls this method, which means that errors it produces could be seen twice.

this occurs if you try to change the name, uid, or other immutable fields inside metadata as well.

this isn't related to this bug, so moving back to ON_QA

Comment 5 weiwei jiang 2016-06-07 02:08:20 UTC
(In reply to Jordan Liggitt from comment #4)
> validation of core object metadata fields is done centrally on update of all
> objects. some object update validation also calls this method, which means
> that errors it produces could be seen twice.
> 
> this occurs if you try to change the name, uid, or other immutable fields
> inside metadata as well.
> 
> this isn't related to this bug, so moving back to ON_QA

Since the issue in this bug has been fixed, so move to verified.

Comment 7 errata-xmlrpc 2016-06-27 15:07:06 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:1343


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