Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1403134 - 'oc edit istag' failed with 'unable to find api field in struct RawExtension'
'oc edit istag' failed with 'unable to find api field in struct RawExtension'
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.4.0
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Maciej Szulik
Xingxing Xia
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-12-09 02:34 EST by Xingxing Xia
Modified: 2017-07-24 10 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: .spec.dockerImageMetadata was unnecessarily used when patching ImageStreamTag. Consequence: As a consequence oc edit couldn't succeed. Fix: Patch mechanism used in oc edit was modified in such a way to always replace the contents of .spec.dockerImageMetadata field. Result: User should be able to invoke oc edit on any ImageStreamTag.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-04-12 15:18:12 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0884 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 18:50:07 EDT

  None (edit)
Description Xingxing Xia 2016-12-09 02:34:33 EST
Description of problem:
'oc edit istag' failed with:
error: unable to find api field in struct RawExtension for the json field "Config"

Version-Release number of selected component (if applicable):
oc v3.4.0.33

How reproducible:
Always

Steps to Reproduce:
1. Create project. Create imagestream
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/image-streams/image-streams-centos7.json

2. Edit imagestreamtag ruby:2.2 to add "hidden" tag in .metadata.annotations.tags
$ oc edit istag ruby:2.2

3. As comparison, use 'oc patch' to add "hidden" tag
$ oc patch istag ruby:2.2 -p '{ "metadata": { "annotations": { "tags": "hidden,builder,ruby" } } }'

Actual results:
2. Failed with:
A copy of your changes has been stored to "/tmp/oc-edit-zxxo2.yaml"
error: unable to find api field in struct RawExtension for the json field "Config"

3. 'oc patch' can successfully update istag.

Expected results:
2. 'oc edit' should succeed updating istag.

Additional info:
Comment 2 Juan Vallejo 2017-01-30 16:11:37 EST
Looks like this might be fixed in a future update to strategic merge patch that allows it to deal with fields without a schema (RawExtension in this case)
Comment 3 Maciej Szulik 2017-01-31 07:43:16 EST
Juan, it doesn't look like it's fixed in newer versions. The logic is still pretty much the same and it'll trip over in the same place when comparing two different dockerImageMetadata part of an Image. My proposed solution [1] allows setting patchStrategy for struct objects. Looking for input on the PR.


[1] https://github.com/openshift/origin/pull/12731
Comment 4 Juan Vallejo 2017-01-31 10:09:51 EST
> Juan, it doesn't look like it's fixed in newer versions. The logic is still pretty much the same and it'll trip over in the same place when comparing two different dockerImageMetadata part of an Image.

Apologies for the confusion in #c2. I meant that this was part of a list of proposed changes to make generic kubectl cmds work with unstructured objects. See https://github.com/kubernetes/kubernetes/pull/40260

> My proposed solution [1] allows setting patchStrategy for struct objects. Looking for input on the PR.

Sounds good, will take a look. Thanks!
Comment 5 Maciej Szulik 2017-01-31 10:49:39 EST
>Apologies for the confusion in #c2. I meant that this was part of a list of proposed changes to make generic kubectl cmds work with unstructured objects. See https://github.com/kubernetes/kubernetes/pull/40260

I've looked into k8s master which already had that changes and it didn't occur to me that this addresses the problem in any way, thus my proposed fix.
Comment 6 openshift-github-bot 2017-02-15 18:24:18 EST
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/2a248fb46d6153d2b359d8bf5234a48a7e492b42
Merge pull request #12731 from soltysh/bug1403134

Merged by openshift-bot
Comment 7 Xingxing Xia 2017-02-19 20:57:51 EST
Verified in openshift/oc v3.5.0.31-1. Now 'oc edit istag' succeeds in comment 0 steps
Comment 9 errata-xmlrpc 2017-04-12 15:18:12 EDT
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-2017:0884

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