Integration: Change to grpc.NewClient
Fun times: In grpc 1.63 grpc.Dial and a few of the options we use (WithBlock) are deprecated in favor of the no-IO variant NewClient. The uses in the integration tests should be easy to swap however as they don't use WithBlock anyways, so that's what this change aims to do. This also removes some context.WithTimeout's as I don't see anywhere the context is actually used in Dial if you don't also specify WithBlock (and it's especially not used now with NewClient as it doesn't even take in a context). Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
		| @@ -33,7 +33,6 @@ limitations under the License. | ||||
| package remote | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"time" | ||||
| @@ -62,10 +61,7 @@ func NewImageService(endpoint string, connectionTimeout time.Duration) (internal | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	ctx, cancel := context.WithTimeout(context.Background(), connectionTimeout) | ||||
| 	defer cancel() | ||||
|  | ||||
| 	conn, err := grpc.DialContext(ctx, addr, | ||||
| 	conn, err := grpc.NewClient(addr, | ||||
| 		grpc.WithTransportCredentials(insecure.NewCredentials()), | ||||
| 		grpc.WithContextDialer(dialer), | ||||
| 		grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxMsgSize)), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Danny Canter
					Danny Canter