Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: skip validating unknown version names#123

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/skip-names
Oct 31, 2024

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedOct 31, 2024
edited
Loading

Same problem as seen in#115.

This fixes a problem where having multiple template version names manually set using Terraform variables would always return a duplicate name error, as Terraform would mark the attribute, although it is required and already written in the config, as Unknown before calling our custom validator. This unknown value is only ever passed to the validator, neverCreate orUpdate.

Knowing this, we see the same problem exists for all attributes we read in our custom validator. The only remaining one isactive, where we check at least one version is marked as active. In this case, we also need to skip validatingactive if any of the booleans are unknown.

We previously didn't have any tests that explicitly used Terraform variables, so this PR adds one, in case the behaviour of these variable set attributes is changed in the future.

@ethanndicksonGraphite App
Copy link
MemberAuthor

This stack of pull requests is managed by Graphite.Learn more about stacking.

Join@ethanndickson and the rest of your teammates onGraphiteGraphite

@ethanndicksonethanndickson marked this pull request as ready for reviewOctober 31, 2024 02:35
if version.Name.IsNull() {
continue
}
if _, ok := uniqueNames[version.Name.ValueString()]; ok {
Copy link
MemberAuthor

@ethanndicksonethanndicksonOct 31, 2024
edited
Loading

Choose a reason for hiding this comment

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

If two names were populated using Terraform variables, they'd beUnknown andValueString would return the empty string for both, which would then lead to a false duplicate in the map.

@ethanndicksonethanndickson merged commit9321b39 intomainOct 31, 2024
14 checks passed
@ethanndicksonethanndickson deleted the ethan/skip-names branchOctober 31, 2024 07:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ethanndickson@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp