@@ -24,7 +24,7 @@ _api_function(name::Symbol) = isdefined(@__MODULE__, name) ? eval(name) : nothin
24
24
_api_function (name) = _api_function (Symbol (name))
25
25
26
26
function list (ctx:: KuberContext , O:: Symbol , name:: String ; apiversion:: Union{String,Nothing} = nothing , namespace:: Union{String,Nothing} = ctx. namespace, kwargs... )
27
- isempty ( ctx. apis) && set_api_versions! (ctx)
27
+ ctx. initialized || set_api_versions! (ctx)
28
28
29
29
apictx = _get_apictx (ctx, O, apiversion)
30
30
namespaced = (namespace != = nothing ) && ! isempty (namespace)
@@ -43,7 +43,7 @@ function list(ctx::KuberContext, O::Symbol, name::String; apiversion::Union{Stri
43
43
end
44
44
45
45
function list (ctx:: KuberContext , O:: Symbol ; apiversion:: Union{String,Nothing} = nothing , namespace:: Union{String,Nothing} = ctx. namespace, kwargs... )
46
- isempty ( ctx. apis) && set_api_versions! (ctx)
46
+ ctx. initialized || set_api_versions! (ctx)
47
47
48
48
apictx = _get_apictx (ctx, O, apiversion)
49
49
namespaced = (namespace != = nothing ) && ! isempty (namespace)
@@ -62,7 +62,7 @@ function list(ctx::KuberContext, O::Symbol; apiversion::Union{String,Nothing}=no
62
62
end
63
63
64
64
function get (ctx:: KuberContext , O:: Symbol , name:: String ; apiversion:: Union{String,Nothing} = nothing , max_tries:: Integer = 1 , kwargs... )
65
- isempty ( ctx. apis) && set_api_versions! (ctx; max_tries= max_tries)
65
+ ctx. initialized || set_api_versions! (ctx; max_tries= max_tries)
66
66
67
67
apictx = _get_apictx (ctx, O, apiversion)
68
68
if (apicall = _api_function (" read$O " )) != = nothing
@@ -89,7 +89,7 @@ function get(ctx::KuberContext, O::Symbol, name::String; apiversion::Union{Strin
89
89
end
90
90
91
91
function get (ctx:: KuberContext , O:: Symbol ; apiversion:: Union{String,Nothing} = nothing , label_selector= nothing , namespace:: Union{String,Nothing} = ctx. namespace, max_tries:: Integer = 1 )
92
- isempty ( ctx. apis) && set_api_versions! (ctx; max_tries= max_tries)
92
+ ctx. initialized || set_api_versions! (ctx; max_tries= max_tries)
93
93
94
94
apictx = _get_apictx (ctx, O, apiversion)
95
95
apiname = " list$O "
@@ -123,7 +123,7 @@ function put!(ctx::KuberContext, v::T) where {T<:SwaggerModel}
123
123
end
124
124
125
125
function put! (ctx:: KuberContext , O:: Symbol , d:: Dict{String,Any} )
126
- isempty ( ctx. apis) && set_api_versions! (ctx)
126
+ ctx. initialized || set_api_versions! (ctx)
127
127
128
128
apictx = _get_apictx (ctx, O, get (d, " apiVersion" , nothing ))
129
129
if (apicall = _api_function (" create$O " )) != = nothing
@@ -143,7 +143,7 @@ function delete!(ctx::KuberContext, v::T; kwargs...) where {T<:SwaggerModel}
143
143
end
144
144
145
145
function delete! (ctx:: KuberContext , O:: Symbol , name:: String ; apiversion:: Union{String,Nothing} = nothing , kwargs... )
146
- isempty ( ctx. apis) && set_api_versions! (ctx)
146
+ ctx. initialized || set_api_versions! (ctx)
147
147
apictx = _get_apictx (ctx, O, apiversion)
148
148
149
149
params = [apictx, name]
@@ -166,7 +166,7 @@ function update!(ctx::KuberContext, v::T, patch, patch_type) where {T<:SwaggerMo
166
166
end
167
167
168
168
function update! (ctx:: KuberContext , O:: Symbol , name:: String , patch, patch_type; apiversion:: Union{String,Nothing} = nothing )
169
- isempty ( ctx. apis) && set_api_versions! (ctx)
169
+ ctx. initialized || set_api_versions! (ctx)
170
170
171
171
apictx = _get_apictx (ctx, O, apiversion)
172
172
0 commit comments