@@ -126,7 +126,7 @@ Keyword Args:
126
126
- count: how many times to retry (default 5)
127
127
- all_apis: whether to retry even mutating APIs e.g. `put!` (default false)
128
128
"""
129
- function set_retries (ctx:: KuberContext ; count:: Int = ctx. default_retries, all_apis:: Bool = ctx. all_apis )
129
+ function set_retries (ctx:: KuberContext ; count:: Int = ctx. default_retries, all_apis:: Bool = ctx. retry_all_apis )
130
130
ctx. default_retries = count
131
131
ctx. retry_all_apis = all_apis
132
132
ctx
@@ -185,12 +185,6 @@ function header(resp::Downloads.Response, name::AbstractString, defaultval::Abst
185
185
return defaultval
186
186
end
187
187
188
- function kuber_type (ctx:: KuberContext , T, resp:: Downloads.Response )
189
- ctype = header (resp, " Content-Type" , " application/json" )
190
- ! is_json_mime (ctype) && return T
191
- kuber_type (ctx, T, String (copy (resp. body)))
192
- end
193
-
194
188
function kuber_type (ctx:: KuberContext , T, j:: Dict{String,Any} )
195
189
if haskey (j, " kind" ) && ! isempty (ctx. apis)
196
190
kind = j[" kind" ]
@@ -340,7 +334,7 @@ function fetch_all_apis_versions(ctx::KuberContext; override=nothing, verbose::B
340
334
name = apigrp. name
341
335
pref_vers_type = apigrp. preferredVersion
342
336
pref_vers_version = override_pref (name, pref_vers_type. version, override)
343
- pref_vers = name * " /" * pref_vers_version
337
+ pref_vers = string ( name, " /" , pref_vers_version)
344
338
supported = String[]
345
339
346
340
try
@@ -356,17 +350,22 @@ function fetch_all_apis_versions(ctx::KuberContext; override=nothing, verbose::B
356
350
end
357
351
358
352
for api_vers in apigrp. versions
353
+ group_version = api_vers. groupVersion
359
354
try
360
- gt = api_group_type (ctx, api_vers. groupVersion)
361
- td = api_typedefs (ctx, api_vers. groupVersion)
355
+ if ! isa (group_version, AbstractString)
356
+ @error (" unexpected missing group version, ignoring" )
357
+ continue
358
+ end
359
+ gt = api_group_type (ctx, group_version)
360
+ td = api_typedefs (ctx, group_version)
362
361
ka = KApi (gt, td)
363
362
kalist = apis[Symbol (api_group (name))]
364
363
if (ka != kalist[1 ])
365
364
push! (kalist, ka)
366
365
push! (supported, api_vers. version)
367
366
end
368
367
catch
369
- @info (" unsupported $(api_vers . groupVersion ) " )
368
+ @info (" unsupported $(group_version ) " )
370
369
end
371
370
end
372
371
@@ -392,13 +391,13 @@ function fetch_core_version(ctx::KuberContext; override=nothing, verbose::Bool=f
392
391
supported = String[]
393
392
pref_vers = override_pref (name, api_vers. versions[1 ], override)
394
393
395
- apis[:Core ] = [KApi (getfield (apimodule (ctx), Symbol (" Core" * camel (pref_vers) * " Api" )), getfield (getfield (apimodule (ctx), :Typedefs ), Symbol (" Core" * camel (pref_vers))))]
394
+ apis[:Core ] = [KApi (getfield (apimodule (ctx), Symbol (string ( " Core" , camel (pref_vers), " Api" ))) , getfield (getfield (apimodule (ctx), :Typedefs ), Symbol (string ( " Core" , camel (pref_vers) ))))]
396
395
push! (supported, pref_vers)
397
396
398
397
for api_vers in api_vers. versions
399
398
try
400
- gt = getfield (apimodule (ctx), Symbol (" Core" * camel (api_vers) * " Api" ))
401
- td = getfield (getfield (apimodule (ctx), :Typedefs ), Symbol (" Core" * camel (api_vers)))
399
+ gt = getfield (apimodule (ctx), Symbol (string ( " Core" , camel (api_vers), " Api" ) ))
400
+ td = getfield (getfield (apimodule (ctx), :Typedefs ), Symbol (string ( " Core" , camel (api_vers) )))
402
401
ka = KApi (gt, td)
403
402
kalist = apis[:Core ]
404
403
if (ka != kalist[1 ])
0 commit comments