{"action":"opened","issue":{"url":"https://api.github.com/repos/openshift/openshift-restclient-python/issues/205","repository_url":"https://api.github.com/repos/openshift/openshift-restclient-python","labels_url":"https://api.github.com/repos/openshift/openshift-restclient-python/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/openshift/openshift-restclient-python/issues/205/comments","events_url":"https://api.github.com/repos/openshift/openshift-restclient-python/issues/205/events","html_url":"https://github.com/openshift/openshift-restclient-python/issues/205","id":357627723,"node_id":"MDU6SXNzdWUzNTc2Mjc3MjM=","number":205,"title":"Unsupported Media Type: application/json-patch+json, application/merge-patch+json","user":{"login":"robsonpeixoto","id":124390,"node_id":"MDQ6VXNlcjEyNDM5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/124390?v=4","gravatar_id":"","url":"https://api.github.com/users/robsonpeixoto","html_url":"https://github.com/robsonpeixoto","followers_url":"https://api.github.com/users/robsonpeixoto/followers","following_url":"https://api.github.com/users/robsonpeixoto/following{/other_user}","gists_url":"https://api.github.com/users/robsonpeixoto/gists{/gist_id}","starred_url":"https://api.github.com/users/robsonpeixoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robsonpeixoto/subscriptions","organizations_url":"https://api.github.com/users/robsonpeixoto/orgs","repos_url":"https://api.github.com/users/robsonpeixoto/repos","events_url":"https://api.github.com/users/robsonpeixoto/events{/privacy}","received_events_url":"https://api.github.com/users/robsonpeixoto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-06T12:15:27Z","updated_at":"2018-09-06T12:15:27Z","closed_at":null,"author_association":"NONE","body":"When I try to create a custom resource, in my case a `ServiceMonitor` from `monitoring.coreos.com/v1` I got the error: `Failed to patch object: b'{\\\"kind\\\":\\\"Status\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"metadata\\\":{},\\\"status\\\":\\\"Failure\\\",\\\"message\\\":\\\"the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json\\\",\\\"reason\\\":\\\"UnsupportedMediaType\\\",\\\"code\\\":415}\\\\n'`\r\n\r\nA ansible code example, but you need to run twice:\r\n```yaml\r\n-  k8s:\r\n    context: \"your k8s context name\"\r\n    namespace: \"monitoring\"\r\n    resource_definition:\r\n      apiVersion: monitoring.coreos.com/v1\r\n      kind: ServiceMonitor\r\n      metadata:\r\n        name: prometheus-operator\r\n        labels:\r\n          app: prometheus-operator\r\n      spec:\r\n        endpoints:\r\n        - port: http\r\n        selector:\r\n          matchLabels:\r\n            app: prometheus-operator\r\n        namespaceSelector:\r\n          matchNames:\r\n          - monitoring\r\n          state: present\r\n\r\n```\r\nThe openshift version it `0.7.1`. Below has the output from `pipenv graph`:\r\n```\r\nopenshift==0.7.1\r\n  - dictdiffer [required: Any, installed: 0.7.1]\r\n  - jinja2 [required: Any, installed: 2.10]\r\n    - MarkupSafe [required: >=0.23, installed: 1.0]\r\n  - kubernetes [required: ==7.0.0, installed: 7.0.0]\r\n    - adal [required: >=1.0.2, installed: 1.1.0]\r\n      - cryptography [required: >=1.1.0, installed: 2.3.1]\r\n        - asn1crypto [required: >=0.21.0, installed: 0.24.0]\r\n        - cffi [required: >=1.7,!=1.11.3, installed: 1.11.5]\r\n          - pycparser [required: Any, installed: 2.18]\r\n        - idna [required: >=2.1, installed: 2.7]\r\n        - six [required: >=1.4.1, installed: 1.11.0]\r\n      - PyJWT [required: >=1.0.0, installed: 1.6.4]\r\n      - python-dateutil [required: >=2.1.0, installed: 2.7.3]\r\n        - six [required: >=1.5, installed: 1.11.0]\r\n      - requests [required: >=2.0.0, installed: 2.19.1]\r\n        - certifi [required: >=2017.4.17, installed: 2018.8.24]\r\n        - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]\r\n        - idna [required: >=2.5,<2.8, installed: 2.7]\r\n        - urllib3 [required: >=1.21.1,<1.24, installed: 1.23]\r\n    - certifi [required: >=14.05.14, installed: 2018.8.24]\r\n    - google-auth [required: >=1.0.1, installed: 1.5.1]\r\n      - cachetools [required: >=2.0.0, installed: 2.1.0]\r\n      - pyasn1-modules [required: >=0.2.1, installed: 0.2.2]\r\n        - pyasn1 [required: >=0.4.1,<0.5.0, installed: 0.4.4]\r\n      - rsa [required: >=3.1.4, installed: 3.4.2]\r\n        - pyasn1 [required: >=0.1.3, installed: 0.4.4]\r\n      - six [required: >=1.9.0, installed: 1.11.0]\r\n    - python-dateutil [required: >=2.5.3, installed: 2.7.3]\r\n      - six [required: >=1.5, installed: 1.11.0]\r\n    - pyyaml [required: >=3.12, installed: 3.13]\r\n    - requests [required: Any, installed: 2.19.1]\r\n      - certifi [required: >=2017.4.17, installed: 2018.8.24]\r\n      - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]\r\n      - idna [required: >=2.5,<2.8, installed: 2.7]\r\n      - urllib3 [required: >=1.21.1,<1.24, installed: 1.23]\r\n    - requests-oauthlib [required: Any, installed: 1.0.0]\r\n      - oauthlib [required: >=0.6.2, installed: 2.1.0]\r\n      - requests [required: >=2.0.0, installed: 2.19.1]\r\n        - certifi [required: >=2017.4.17, installed: 2018.8.24]\r\n        - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4]\r\n        - idna [required: >=2.5,<2.8, installed: 2.7]\r\n        - urllib3 [required: >=1.21.1,<1.24, installed: 1.23]\r\n    - setuptools [required: >=21.0.0, installed: 40.2.0]\r\n    - six [required: >=1.9.0, installed: 1.11.0]\r\n    - urllib3 [required: >=1.19.1,!=1.21, installed: 1.23]\r\n    - websocket-client [required: >=0.32.0,!=0.42.*,!=0.41.*,!=0.40.0, installed: 0.52.0]\r\n      - six [required: Any, installed: 1.11.0]\r\n  - python-string-utils [required: Any, installed: 0.6.0]\r\n  - ruamel.yaml [required: >=0.15, installed: 0.15.64]\r\n  - six [required: Any, installed: 1.11.0]\r\n```"}}
{"actor":{"display_login":"robsonpeixoto"}}