mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
build: fix incorrect solve opt platform from being set
This regression was introduced in 616fb3e55c
,
with the node resolution refactor.
The core issue here is just that we would unconditionally set the
solve opt's platform to the default current platform, which was
incorrect. We can prevent this easily by having a special case for the
default case, like we had before, and then not setting the platforms
field on this (which keeping the resolution behavior which was
introduced).
Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
@ -22,6 +22,7 @@ func TestFindDriverSanity(t *testing.T) {
|
||||
require.Len(t, res, 1)
|
||||
require.Equal(t, 0, res[0].driverIndex)
|
||||
require.Equal(t, "aaa", res[0].Node().Builder)
|
||||
require.Equal(t, []specs.Platform{platforms.DefaultSpec()}, res[0].platforms)
|
||||
}
|
||||
|
||||
func TestFindDriverEmpty(t *testing.T) {
|
||||
@ -227,6 +228,7 @@ func TestSelectNodeCurrentPlatform(t *testing.T) {
|
||||
require.True(t, perfect)
|
||||
require.Len(t, res, 1)
|
||||
require.Equal(t, "bbb", res[0].Node().Builder)
|
||||
require.Empty(t, res[0].platforms)
|
||||
}
|
||||
|
||||
func TestSelectNodeAdditionalPlatforms(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user