mirror of https://github.com/hashicorp/consul
refactor context
parent
1b3600dcb9
commit
9abb1c2430
|
@ -44,7 +44,7 @@ func (client *GRPCClient) Apply(parsedResource *pbresource.Resource) (*pbresourc
|
||||||
}
|
}
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if token != "" {
|
if token != "" {
|
||||||
ctx = metadata.AppendToOutgoingContext(context.Background(), HeaderConsulToken, token)
|
ctx = metadata.AppendToOutgoingContext(ctx, HeaderConsulToken, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer client.Conn.Close()
|
defer client.Conn.Close()
|
||||||
|
@ -66,7 +66,7 @@ func (client *GRPCClient) Read(resourceType *pbresource.Type, resourceTenancy *p
|
||||||
ctx = metadata.AppendToOutgoingContext(ctx, "x-consul-consistency-mode", "consistent")
|
ctx = metadata.AppendToOutgoingContext(ctx, "x-consul-consistency-mode", "consistent")
|
||||||
}
|
}
|
||||||
if token != "" {
|
if token != "" {
|
||||||
ctx = metadata.AppendToOutgoingContext(context.Background(), HeaderConsulToken, token)
|
ctx = metadata.AppendToOutgoingContext(ctx, HeaderConsulToken, token)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer client.Conn.Close()
|
defer client.Conn.Close()
|
||||||
|
|
Loading…
Reference in New Issue