Skip to content

Commit 4f105c6

Browse files
committed
fix show method for KuberContext
fix bug in show method for KuberContext where it was not printing into the supplied `IO` instance
1 parent 758c99e commit 4f105c6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/helpers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ end
151151
kuber_obj(ctx::KuberContext, data::String) = kuber_obj(ctx, JSON.parse(data))
152152
kuber_obj(ctx::KuberContext, j::Dict{String,Any}) = convert(kind_to_type(ctx, j["kind"], get(j, "apiVersion", nothing)), j)
153153

154-
show(io::IO, ctx::KuberContext) = print("Kubernetes namespace ", ctx.namespace, " at ", ctx.client.root)
154+
show(io::IO, ctx::KuberContext) = print(io, "Kubernetes namespace ", ctx.namespace, " at ", ctx.client.root)
155155

156156
get_server(ctx::KuberContext) = ctx.client.root
157157
get_ns(ctx::KuberContext) = ctx.namespace

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,13 @@ function test_all()
331331

332332
test_versioned(ctx2, "2")
333333
end
334+
335+
@testset "Misc" begin
336+
iob = IOBuffer()
337+
show(iob, ctx)
338+
str = String(take!(iob))
339+
@test str == "Kubernetes namespace default at http://localhost:8001"
340+
end
334341
end
335342
end
336343

0 commit comments

Comments
 (0)