From 3c3a7006b22fe778b7c061fd3b0b8828ac8e481c Mon Sep 17 00:00:00 2001 From: Julien Poissonnier Date: Wed, 21 Aug 2024 16:39:05 +0200 Subject: [PATCH] Parse the items property on config type declarations When parsing a template, parse the `items` property on configuration type declarations. Fixes https://github.com/pulumi/pulumi-yaml/issues/606 --- CHANGELOG_PENDING.md | 3 +++ pkg/pulumiyaml/ast/template.go | 1 + pkg/pulumiyaml/ast/template_test.go | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 80b326a9..db5b3070 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -3,3 +3,6 @@ - [features] add "pulumi.organiztion" to the built-in "pulumi" variable to obtain the current organization. ### Bug Fixes + +- Parse the items property on config type declarations to prevent diagnostic messages about + unknown fields [#615](https://github.com/pulumi/pulumi-yaml/pull/615) diff --git a/pkg/pulumiyaml/ast/template.go b/pkg/pulumiyaml/ast/template.go index 20f98884..3357e237 100644 --- a/pkg/pulumiyaml/ast/template.go +++ b/pkg/pulumiyaml/ast/template.go @@ -276,6 +276,7 @@ type ConfigParamDecl struct { Secret *BooleanExpr Default Expr Value Expr + Items *ConfigParamDecl } func (d *ConfigParamDecl) recordSyntax() *syntax.Node { diff --git a/pkg/pulumiyaml/ast/template_test.go b/pkg/pulumiyaml/ast/template_test.go index 8f64edd3..b8966c2d 100644 --- a/pkg/pulumiyaml/ast/template_test.go +++ b/pkg/pulumiyaml/ast/template_test.go @@ -16,6 +16,23 @@ import ( const example = ` name: simple-yaml runtime: yaml +config: + some-string-array: + type: array + value: + - subnet1 + - subnet2 + - subnet3 + items: + type: string + some-nested-array: + type: array + items: + type: array + items: + type: string + some-boolean: + type: boolean resources: my-bucket: type: aws:s3/bucket:Bucket