diff --git a/pkg/iac/rego/convert/slice_test.go b/pkg/iac/rego/convert/slice_test.go index e30c200142b2..ff318e2b1a03 100644 --- a/pkg/iac/rego/convert/slice_test.go +++ b/pkg/iac/rego/convert/slice_test.go @@ -38,6 +38,7 @@ func Test_SliceTypesConversion(t *testing.T) { "endline": 123, "sourceprefix": "", "managed": true, + "unresolvable": false, "explicit": false, "fskey": "", "resource": "", @@ -49,6 +50,7 @@ func Test_SliceTypesConversion(t *testing.T) { "endline": 123, "sourceprefix": "", "managed": true, + "unresolvable": false, "explicit": false, "fskey": "", "resource": "", 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/state/state_test.go b/pkg/iac/state/state_test.go index 60b4b061a2d3..46de9b506d4b 100644 --- a/pkg/iac/state/state_test.go +++ b/pkg/iac/state/state_test.go @@ -44,6 +44,7 @@ func Test_RegoConversion(t *testing.T) { "startline": 2, "endline": 4, "managed": true, + "unresolvable": false, "explicit": false, "fskey": "", }, @@ -55,6 +56,7 @@ func Test_RegoConversion(t *testing.T) { "endline": 3, "value": "my-bucket", "managed": true, + "unresolvable": false, "explicit": false, "fskey": "", }, 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(), } diff --git a/pkg/iac/types/metadata_test.go b/pkg/iac/types/metadata_test.go index f447c6d85ca2..f7d46bbf9dbd 100644 --- a/pkg/iac/types/metadata_test.go +++ b/pkg/iac/types/metadata_test.go @@ -8,12 +8,14 @@ import ( func Test_MetadataToRego(t *testing.T) { m1 := NewTestMetadata() + m1.isUnresolvable = true expected := map[string]any{ "endline": 123, "explicit": false, "filepath": "test.test", "fskey": "", "managed": true, + "unresolvable": true, "resource": "", "sourceprefix": "", "startline": 123, @@ -27,6 +29,7 @@ func Test_MetadataToRego(t *testing.T) { "filepath": "test.test", "fskey": "", "managed": true, + "unresolvable": false, "resource": "", "sourceprefix": "", "startline": 123,