Skip to content

Commit 484fa7c

Browse files
committed
Move architecture+variant logic together, separate from wantedOS
The architecture+variant choices interact, and are orthogonal from OS. Should not change behavior. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
1 parent d9b1d8e commit 484fa7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/pkg/platform/platform_matcher.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@ func WantedPlatforms(ctx *types.SystemContext) ([]imgspecv1.Platform, error) {
128128
if ctx != nil && ctx.ArchitectureChoice != "" {
129129
wantedArch = ctx.ArchitectureChoice
130130
}
131-
wantedOS := runtime.GOOS
132-
if ctx != nil && ctx.OSChoice != "" {
133-
wantedOS = ctx.OSChoice
134-
}
135-
136131
wantedVariant := getCPUVariant(runtime.GOOS, runtime.GOARCH)
137132
if ctx != nil && ctx.VariantChoice != "" {
138133
wantedVariant = ctx.VariantChoice
139134
}
140135

136+
wantedOS := runtime.GOOS
137+
if ctx != nil && ctx.OSChoice != "" {
138+
wantedOS = ctx.OSChoice
139+
}
140+
141141
var wantedPlatforms []imgspecv1.Platform
142142
if wantedVariant != "" && compatibility[wantedArch] != nil {
143143
wantedPlatforms = make([]imgspecv1.Platform, 0, len(compatibility[wantedArch]))

0 commit comments

Comments
 (0)