Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update complex constraints in core schema to allow any expressions #214

Open
radeksimko opened this issue May 11, 2023 · 0 comments · May be fixed by #216
Open

Update complex constraints in core schema to allow any expressions #214

radeksimko opened this issue May 11, 2023 · 0 comments · May be fixed by #216
Assignees

Comments

@radeksimko
Copy link
Member

Context

After introducing AnyExpression as part of #174 we forgot to also update certain parts of the core schema which involve complex type constraints, such as provisioner blocks:

"inline": {
IsOptional: true,
Constraint: schema.List{
Elem: schema.AnyExpression{OfType: cty.String},
},
Description: lang.Markdown("A list of command strings. They are executed in the order they are provided." +
" This cannot be provided with `script` or `scripts`."),
},

This means that currently we don't allow interpolation in various places, e.g.

Screenshot 2023-05-11 at 16 49 19

Proposal

Go through all places where we use schema.List, schema.Set, schema.Tuple, schema.Map and schema.Object and check if they need updating to schema.OneOf{} variation, such as

Constraint: schema.OneOf{
schema.AnyExpression{OfType: cty.List(cty.String), SkipLiteralComplexTypes: true},
schema.List{
Elem: schema.AnyExpression{OfType: cty.String},
},
},

@radeksimko radeksimko linked a pull request May 14, 2023 that will close this issue
1 task
@radeksimko radeksimko self-assigned this May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant