diff options
Diffstat (limited to 'vendor/github.com/hashicorp/terraform/plugin/ui_input.go')
-rw-r--r-- | vendor/github.com/hashicorp/terraform/plugin/ui_input.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/hashicorp/terraform/plugin/ui_input.go b/vendor/github.com/hashicorp/terraform/plugin/ui_input.go index 493efc0..3469e6a 100644 --- a/vendor/github.com/hashicorp/terraform/plugin/ui_input.go +++ b/vendor/github.com/hashicorp/terraform/plugin/ui_input.go | |||
@@ -1,19 +1,20 @@ | |||
1 | package plugin | 1 | package plugin |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "context" | ||
4 | "net/rpc" | 5 | "net/rpc" |
5 | 6 | ||
6 | "github.com/hashicorp/go-plugin" | 7 | "github.com/hashicorp/go-plugin" |
7 | "github.com/hashicorp/terraform/terraform" | 8 | "github.com/hashicorp/terraform/terraform" |
8 | ) | 9 | ) |
9 | 10 | ||
10 | // UIInput is an implementatin of terraform.UIInput that communicates | 11 | // UIInput is an implementation of terraform.UIInput that communicates |
11 | // over RPC. | 12 | // over RPC. |
12 | type UIInput struct { | 13 | type UIInput struct { |
13 | Client *rpc.Client | 14 | Client *rpc.Client |
14 | } | 15 | } |
15 | 16 | ||
16 | func (i *UIInput) Input(opts *terraform.InputOpts) (string, error) { | 17 | func (i *UIInput) Input(ctx context.Context, opts *terraform.InputOpts) (string, error) { |
17 | var resp UIInputInputResponse | 18 | var resp UIInputInputResponse |
18 | err := i.Client.Call("Plugin.Input", opts, &resp) | 19 | err := i.Client.Call("Plugin.Input", opts, &resp) |
19 | if err != nil { | 20 | if err != nil { |
@@ -41,7 +42,7 @@ type UIInputServer struct { | |||
41 | func (s *UIInputServer) Input( | 42 | func (s *UIInputServer) Input( |
42 | opts *terraform.InputOpts, | 43 | opts *terraform.InputOpts, |
43 | reply *UIInputInputResponse) error { | 44 | reply *UIInputInputResponse) error { |
44 | value, err := s.UIInput.Input(opts) | 45 | value, err := s.UIInput.Input(context.Background(), opts) |
45 | *reply = UIInputInputResponse{ | 46 | *reply = UIInputInputResponse{ |
46 | Value: value, | 47 | Value: value, |
47 | Error: plugin.NewBasicError(err), | 48 | Error: plugin.NewBasicError(err), |