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:
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)
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
> 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!
>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.
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
Verified in openshift/oc v3.5.0.31-1. Now 'oc edit istag' succeeds in comment 0 steps
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