Skip to content

ServiceContextConstraints edit privileged error: apiVersion should not be changed #7147

Closed

Description

@gemoya

Hi,
I am using the docker based installation and I want to add a router.
1- I created he router Service Account
echo '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"router"}}' | oc remove -f -
2- When I tried to add system:serviceaccount:default:router to scc privileged i got
error: apiVersion should not be changed A copy of your changes has been stored to "/tmp/kubectl-edit-0m498.yaml"

this is the yml, the last line is what I want to add.

oc edit scc privileged
allowHostDirVolumePlugin: true
allowHostIPC: true
allowHostNetwork: true
allowHostPID: true
allowHostPorts: true
allowPrivilegedContainer: true
allowedCapabilities: null
apiVersion: v1
defaultAddCapabilities: null
fsGroup:
  type: RunAsAny
groups:
- system:cluster-admins
- system:nodes
kind: SecurityContextConstraints
metadata:
  annotations:
    kubernetes.io/description: 'privileged allows access to all privileged and host
      features and the ability to run as any user, any group, any fsGroup, and with
      any SELinux context.  WARNING: this is the most relaxed SCC and should be used
      only for cluster administration. Grant with caution.'
  creationTimestamp: 2016-02-08T17:38:05Z
  name: privileged
  resourceVersion: "67"
  selfLink: /api/v1/securitycontextconstraints/privileged
  uid: b5c7d909-ce8a-11e5-8abe-0026b9a5e3a0
priority: null
requiredDropCapabilities: null
runAsUser:
  type: RunAsAny
seLinuxContext:
  type: RunAsAny
supplementalGroups:
  type: RunAsAny
users:
- system:serviceaccount:openshift-infra:build-controller
- system:serviceaccount:default:router

also I tried removing/adding router service account again, and watching endlines or
spaces of the editor.(Default editor is vi)
Some ideas?
Thanks

Activity

  1. deads2k commented on Feb 9, 2016

    @deads2k
    Contributor

    upstream kube broke edit serialization and mutation. We're fixing them now. #7135 will resolve your immediate problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions