Bug 1783242 - oc edit scc does not work
Summary: oc edit scc does not work
Keywords:
Status: CLOSED DUPLICATE of bug 1707679
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-apiserver
Version: 4.2.z
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Stefan Schimanski
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-13 12:25 UTC by Jason Kincl
Modified: 2019-12-13 15:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-13 12:37:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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!


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