Skip to content

Commit

Permalink
Merge pull request #2 from emeraldarcher/support-string-type-response…
Browse files Browse the repository at this point in the history
…-from-jira

Fixes the typecast error when attempting to call get(name, namespace)…
  • Loading branch information
kalinon authored Apr 11, 2022
2 parents fc66550 + f19a06b commit e6242af
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/kube/resource_client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ module Kube
).as(T)
end

# returns response body as a String instead of T
def get_as_string(name, namespace = @namespace)
@transport.request(
method: "GET",
path: path(name, namespace: namespace),
response_class: @resource_class
).as(String)
end

# raises [`Kube::Error::NotFound`] if resource is not found
def get(resource : T) : T
@transport.request(
Expand Down

0 comments on commit e6242af

Please sign in to comment.