You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it's loaded as an external resource, the properties returned for HasMetadata object are the following. I've assumed that for k8s Role the right class is io.fabric8.kubernetes.api.model.rbac.KubernetesRole. Afterwards the class is implying the apiGroup endpoint used for POST request. The mix of k8sandopenshift` groups is causing a problem on API server side described further.
openshift.client().load(IOUtils.toInputStream(roleJson)).get();
// getApiVersion() getKind() getClass()rbac.authorization.k8s.io/v1 :: Role :: classio.fabric8.openshift.api.model.Role
The same can be observed when such Role and other Authorization resources are part of template, for example.
Problem is that OpenShift API server is not very comfortable with mismatching apiVersion in JSON request and actual apiGroup. Server is restarted due to panic error upon reflection cast, tracked as BZ. Due to the fact, the Java exception thrown is complaining about connection problems.
Okhttp client trace log
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: <-- END HTTP (755-byte body)
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: --> POST https://api.perf1.xpaas:8443/apis/authorization.openshift.io/v1/namespaces/dsimansk/roles http/1.1
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Content-Type: application/json; charset=utf-8
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Content-Length: 372
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Authorization: Bearer 3xcBwHHKTfbdiwTl3OQniCZ9z2ZvzWLsDz2P-InK9yA
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Host: api.perf1.xpaas:8443
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Connection: Keep-Alive
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: Accept-Encoding: gzip
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: User-Agent: okhttp/3.9.1
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO:
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: {"apiVersion":"rbac.authorization.k8s.io/v1","kind":"Role","metadata":{"annotations":{},"labels":{"app":"broker"},"name":"broker-roleJson","namespace":"dsimansk"},"rules":[{"apiGroups":[""],"resources":["endpoints"],"verbs":["create","delete","deletecollection","get","list","patch","update","watch"]},{"apiGroups":[""],"resources":["namespaces"],"verbs":["get","list"]}]}
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: --> END POST (372-byte body)
Aug 29, 2018 11:04:06 AM okhttp3.internal.platform.Platform log
INFO: <-- HTTP FAILED: java.io.IOException: unexpected end of stream on Connection{api.perf1.xpaas:8443, proxy=DIRECT hostAddress=api.perf1.xpaas/10.8.47.10:8443 cipherSuite=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 protocol=http/1.1}
Versions used
Lets have a simple file with Role definition based on
rbac.authorization.k8s.io/v1
When it's loaded as an external resource, the properties returned for
HasMetadata
object are the following. I've assumed that for k8s Role the right class isio.fabric8.kubernetes.api.model.rbac.KubernetesRole. Afterwards the class is implying the apiGroup endpoint used for POST request. The mix of
k8sand
openshift` groups is causing a problem on API server side described further.The same can be observed when such
Role
and otherAuthorization
resources are part of template, for example.Problem is that OpenShift API server is not very comfortable with mismatching apiVersion in JSON request and actual apiGroup. Server is restarted due to panic error upon reflection cast, tracked as BZ. Due to the fact, the Java exception thrown is complaining about connection problems.
Okhttp client trace log
The text was updated successfully, but these errors were encountered: