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

Add support for ObjectExpr expression type #23

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Mar 10, 2021

This is to support recent changes in core schema introduced in Terraform 0.15 where an object can contain traversals - i.e. not literals.

@radeksimko radeksimko force-pushed the f-object-expr branch 4 times, most recently from 4315086 to df95a1d Compare March 10, 2021 13:28
@radeksimko radeksimko marked this pull request as ready for review March 10, 2021 14:04
@@ -30,15 +30,17 @@ func detailForAttribute(attr *schema.AttributeSchema) string {
var detail string
if attr.IsRequired {
detail = "Required"
} else {
} else if attr.IsOptional {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was actually never correct, it just came up now because AnyAttribute (where none of Required or Optional is typically set) is used in the required_providers block which was changed in 0.15.

Kind: lang.TupleCandidateKind,
Label: fmt.Sprintf(`[%s]`, labelForConstraints(c.AnyElem)),
Detail: c.Name,
Description: c.Description,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small (unrelated) fix I made as I was reading through the code, probably doesn't affect much in practice though as we don't have too many tuple expressions with description.

Kind: lang.MapCandidateKind,
Label: fmt.Sprintf(`{ key =%s}`, labelForConstraints(c.Elem)),
Detail: c.FriendlyName(),
Description: c.Description,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small (unrelated) fix I made as I was reading through the code, probably doesn't affect much in practice though as we don't have too many map expressions with description.

@radeksimko radeksimko requested a review from a team March 10, 2021 14:08
@radeksimko radeksimko merged commit da05370 into main Mar 11, 2021
@radeksimko radeksimko deleted the f-object-expr branch March 11, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants