-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Add actions to provider interface #37006
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
base: main
Are you sure you want to change the base?
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.
Approving the protocol changes
Will the version of the protocol version stay at 6.10? |
f3d5ac9
to
0b0cfdd
Compare
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 left a couple of questions and comments - I won't make a fuss about the nitpicks (like newlines) so feel free to fix or ignore those as you will. Overall this looks reasonable to me!
return resp | ||
} | ||
|
||
func (p *GRPCProvider) InvokeAction(r providers.InvokeActionRequest) (resp providers.InvokeActionResponse) { |
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 one is just a genuine question I'm curious about, not a review:
How will the action event stream get cancelled from the terraform side (ie user ctrl-c or a timeout)? Does that get handled by the provider when tf calls Stop()
?
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 would have assumed it stops when we call Stop
and the provider winds down, but it's sth we should test for sure
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.
The framework shouldbe connecting it's global context to interrupt the call when Stop
is called, but Terraform can't control that.
For managed resources we don't want to directly interrupt them from the CLI because they may have state to save, and so we wait for the provider to do the cancelation and return whatever info it can. Since list resources can't have side effects however, we might want to someday pipe through our cancellation context here, but I don't think that's required for now, and would require some new plumbing.
This PR adds actions to the provider interface and implements the basic functionality against the provider protocol.
Fixes #
Target Release
1.13.x
CHANGELOG entry