don't require apiMappings for resources that has apiVersion set
This commit is contained in:
parent
31d4df88af
commit
f6ac33b8e0
1 changed files with 4 additions and 2 deletions
|
|
@ -132,11 +132,13 @@ in
|
|||
lib.recursiveUpdate (
|
||||
{
|
||||
apiVersion =
|
||||
if lib.hasAttr kind cfg.apiMappings then
|
||||
if lib.hasAttr "apiVersion" resourceAttrs then
|
||||
resourceAttrs.apiVersion
|
||||
else if lib.hasAttr kind cfg.apiMappings then
|
||||
cfg.apiMappings.${kind}
|
||||
else
|
||||
builtins.throw ''
|
||||
Resource kind: ${kind} name: ${name} has no apiMappings
|
||||
Resource kind: ${kind} name: ${name} has no apiVersion set and not apiMappings
|
||||
${builtins.toJSON resourceAttrs}
|
||||
'';
|
||||
kind = kind;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue