-
Notifications
You must be signed in to change notification settings - Fork 885
feat: include coder_parameters from external modules #8195
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
Conversation
provisioner/terraform/resources.go
Outdated
for _, o := range ordered { | ||
if resource.Name == o.Name { | ||
goto next | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have anything in particular against the goto
here, but continue outerLoop
is likely to raise fewer eyebrows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hear you. I replaced goto
with a simple boolean check.
provisioner/terraform/resources.go
Outdated
withExternal := make([]*tfjson.StateResource, 0, len(ordered)+len(external)) | ||
withExternal = append(withExternal, external...) | ||
withExternal = append(withExternal, ordered...) | ||
ordered = withExternal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be simplified:
withExternal := make([]*tfjson.StateResource, 0, len(ordered)+len(external)) | |
withExternal = append(withExternal, external...) | |
withExternal = append(withExternal, ordered...) | |
ordered = withExternal | |
ordered = append(external, ordered...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Fixes: #8090
This PR modifies the
ConvertResources
logic to includecoder_parameter
s from external modules. It also refactors the routine to preventnil
resources.