Bug 1783242

Summary: oc edit scc does not work
Product: OpenShift Container Platform Reporter: Jason Kincl <kincljc>
Component: openshift-apiserverAssignee: Stefan Schimanski <sttts>
Status: CLOSED DUPLICATE QA Contact: Xingxing Xia <xxia>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.2.zCC: aos-bugs, mfojtik, slaznick
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-13 12:37:49 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 Jason Kincl 2019-12-13 12:25:31 UTC
Description of problem:

Unable to edit securitycontextconstraint objects


How reproducible:

always


Steps to Reproduce:

oc edit scc central

Actual results:

error: securitycontextconstraints.security.openshift.io "central" could not be patched: the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json
You can run `oc replace -f /tmp/oc-edit-geyts.yaml` to try this update again.

Comment 1 Jason Kincl 2019-12-13 12:29:13 UTC
I am trying to edit the priority of a SCC

oc patch scc central -p '{"priority": 0}'
Error from server (UnsupportedMediaType): the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json

Comment 2 Jason Kincl 2019-12-13 12:31:36 UTC
It seems that a strategic-merge-patch is not accepted but a json-patch is:

oc patch scc central --type=json -p '[{"op": "replace", "path": "/priority", "value":0}]'
securitycontextconstraints.security.openshift.io/central patched

Comment 3 Standa Laznicka 2019-12-13 12:37:49 UTC
Hi,

You did not specify version, so I am going to closed this as fixed in https://bugzilla.redhat.com/show_bug.cgi?id=1707679.

*** This bug has been marked as a duplicate of bug 1707679 ***

Comment 4 Jason Kincl 2019-12-13 12:42:57 UTC
(In reply to Standa Laznicka from comment #3)
> Hi,
> 
> You did not specify version, so I am going to closed this as fixed in
> https://bugzilla.redhat.com/show_bug.cgi?id=1707679.
> 
> *** This bug has been marked as a duplicate of bug 1707679 ***

Hi,

This is for 4.2, I used the Version field on the bug was that not the right way to do it?

Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.18-201909201915+72d1bea-dirty", GitCommit:"72d1bea", GitTreeState:"dirty", BuildDate:"2019-09-21T02:11:40Z", GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14+", GitVersion:"v1.14.6+20e2756", GitCommit:"20e2756", GitTreeState:"clean", BuildDate:"2019-11-26T19:36:44Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}

Comment 5 Jason Kincl 2019-12-13 12:44:05 UTC
(In reply to Jason Kincl from comment #4)
> Client Version: version.Info{Major:"4", Minor:"1+",
> GitVersion:"v4.1.18-201909201915+72d1bea-dirty", GitCommit:"72d1bea",
> GitTreeState:"dirty", BuildDate:"2019-09-21T02:11:40Z",
> GoVersion:"go1.11.13", Compiler:"gc", Platform:"linux/amd64"}
> Server Version: version.Info{Major:"1", Minor:"14+",
> GitVersion:"v1.14.6+20e2756", GitCommit:"20e2756", GitTreeState:"clean",
> BuildDate:"2019-11-26T19:36:44Z", GoVersion:"go1.12.12", Compiler:"gc",
> Platform:"linux/amd64"}

Ah, I see the error of my ways...

Comment 6 Standa Laznicka 2019-12-13 15:06:15 UTC
:)

As you can see, we've got a whole .z stream which gets bug fixes, and I'm quite sure this issue was fixed. If you're still experiencing issues with the latest updates though, you're always free to reopen the bug!