Skip to content

Commit 63a8dce

Browse files
authored
use KuberException instead of assertions in init (#57)
Avoiding plain `@assert` to check responses during connection initialization to the cluster. KuberException captures more details instead of plain assertions.
1 parent ef40dbb commit 63a8dce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ authors = ["Tanmay Mohapatra <[email protected]>"]
44
keywords = ["kubernetes", "client"]
55
license = "MIT"
66
desc = "Julia Kubernetes Client"
7-
version = "0.7.1"
7+
version = "0.7.2"
88

99
[deps]
1010
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/helpers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function fetch_all_apis_versions(ctx::KuberContext; override=nothing, verbose::B
334334
vers, http_resp = k8s_retry(; max_tries=max_tries) do
335335
apimodule(ctx).get_a_p_i_versions(apimodule(ctx).ApisApi(ctx.client))
336336
end
337-
@assert http_resp.status == 200
337+
vers = check_api_response(vers, http_resp)
338338
api_groups = vers.groups
339339
for apigrp in api_groups
340340
name = apigrp.name
@@ -387,7 +387,7 @@ function fetch_core_version(ctx::KuberContext; override=nothing, verbose::Bool=f
387387
api_vers, http_resp = k8s_retry(; max_tries=max_tries) do
388388
apimodule(ctx).get_core_a_p_i_versions(apimodule(ctx).CoreApi(ctx.client))
389389
end
390-
@assert http_resp.status == 200
390+
api_vers = check_api_response(api_vers, http_resp)
391391
name = "Core"
392392
supported = String[]
393393
pref_vers = override_pref(name, api_vers.versions[1], override)

0 commit comments

Comments
 (0)