From 6d02645f48806478523db0cccf189f78c19e5dd5 Mon Sep 17 00:00:00 2001 From: nikpivkin Date: Fri, 18 Oct 2024 15:40:41 +0600 Subject: [PATCH] feat(misconf): export unresolvable field of IaC types to Rego Signed-off-by: nikpivkin --- pkg/iac/rego/schemas/cloud.json | 21 +++++++++++++++++++++ pkg/iac/types/metadata.go | 1 + 2 files changed, 22 insertions(+) diff --git a/pkg/iac/rego/schemas/cloud.json b/pkg/iac/rego/schemas/cloud.json index 3cc6301429be..bdaad1330898 100644 --- a/pkg/iac/rego/schemas/cloud.json +++ b/pkg/iac/rego/schemas/cloud.json @@ -7884,6 +7884,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "boolean" } @@ -7916,6 +7919,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "string" } @@ -7948,6 +7954,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "integer" } @@ -7980,6 +7989,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "object" } @@ -8011,6 +8023,9 @@ }, "startline": { "type": "integer" + }, + "unresolvable": { + "type": "boolean" } } }, @@ -8041,6 +8056,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "string" } @@ -8073,6 +8091,9 @@ "startline": { "type": "integer" }, + "unresolvable": { + "type": "boolean" + }, "value": { "type": "string" } diff --git a/pkg/iac/types/metadata.go b/pkg/iac/types/metadata.go index 359654bdc43b..c71460441622 100755 --- a/pkg/iac/types/metadata.go +++ b/pkg/iac/types/metadata.go @@ -84,6 +84,7 @@ func (m *Metadata) ToRego() any { "sourceprefix": m.Range().GetSourcePrefix(), "managed": m.isManaged, "explicit": m.isExplicit, + "unresolvable": m.isUnresolvable, "fskey": CreateFSKey(m.Range().GetFS()), "resource": m.Reference(), }