close grpc TestListener
This commit is contained in:
parent
86e6481cc6
commit
3a0c2f1b67
|
@ -508,7 +508,17 @@ func (p *GRPCProvider) ReadDataSource(r providers.ReadDataSourceRequest) (resp p
|
||||||
|
|
||||||
// closing the grpc connection is final, and terraform will call it at the end of every phase.
|
// closing the grpc connection is final, and terraform will call it at the end of every phase.
|
||||||
func (p *GRPCProvider) Close() error {
|
func (p *GRPCProvider) Close() error {
|
||||||
// check this since it's not automatically inserted during plugin creation
|
log.Printf("[TRACE] GRPCProvider: PlanResourceChange")
|
||||||
|
|
||||||
|
// close the remote listener if we're running within a test
|
||||||
|
if p.TestListener != nil {
|
||||||
|
p.TestListener.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check this since it's not automatically inserted during plugin creation.
|
||||||
|
// It's currently only inserted by the command package, because that is
|
||||||
|
// where the factory is built and is the only point with access to the
|
||||||
|
// plugin.Client.
|
||||||
if p.PluginClient == nil {
|
if p.PluginClient == nil {
|
||||||
log.Println("[DEBUG] provider has no plugin.Client")
|
log.Println("[DEBUG] provider has no plugin.Client")
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue