Description
Repro steps:
- Create a driver with this spec:
{"Name":"remote","Driver":"remote","Nodes":[{"Name":"remote0","Endpoint":"tcp://localhost:1234","Platforms":[{"architecture":"arm64","os":"linux"}],"Flags":null,"DriverOpts":null,"Files":null}
- Send a request to the builder for a different platform
docker buildx build -t out --platform linux/amd64 .
Expected result:
I would expect to fail because there's no available builder that matches the platform
Actual result:
buildx sends the request to the ARM builder
Additional info:
The full problem is more complicated, and involves how the Node fallback logic works when one of the builders is unavailable. Basically we're seeing problems where if platform isn't specified, and one of the builders is unavailable, the request ends up landing on a random Node and with a random Platform.
I think it would be fine if this behavior was opt-in, i.e., there was a driver opt like:
{"Name":"remote","DriverOpts":{"DefaultPlatform": "linux/amd64", "StrictPlatformMatching": true}}