-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 a --generate-code flag to import #9141
Conversation
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.
Two nits, LGTM otherwise. Thanks for turning this around so fast!
if err != nil { | ||
return result.FromError(err) | ||
} | ||
if generateCode { |
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.
Minor nit: maybe pull the body of this if
out into its own function? Normally I'd suggest using an early return here to be more idiomatic and avoid the rightward movement, but that isn't convenient with the res != nil
bits later.
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'd generally lean towards keeping the code inline here, we're just hitting 120 cols which doesn't seem unreasonable.
Description
Adds a flag
--generate-code
to pulumi import. By default this is true, but users can pass--generate-code=false
to skip the code generation step of import.Fixes #9134
Checklist