use of io.kubernetes.client.proto.Runtime.Unknown in project java by kubernetes-client.
the class ProtoClient method getObjectOrStatusFromServer.
private <T extends Message> ObjectOrStatus<T> getObjectOrStatusFromServer(Builder builder, Request request) throws IOException, ApiException {
Response resp = apiClient.getHttpClient().newCall(request).execute();
Unknown u = parse(resp.body().byteStream());
resp.body().close();
if (u.getTypeMeta().getApiVersion().equals("v1") && u.getTypeMeta().getKind().equals("Status")) {
Status status = Status.newBuilder().mergeFrom(u.getRaw()).build();
return new ObjectOrStatus(null, status);
}
return new ObjectOrStatus((T) builder.mergeFrom(u.getRaw()).build(), null);
}