You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/projectconfig/distro.go
+22-4Lines changed: 22 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,10 @@
4
4
package projectconfig
5
5
6
6
import (
7
+
"fmt"
7
8
"runtime"
8
9
10
+
"dario.cat/mergo"
9
11
"github.com/brunoga/deep"
10
12
)
11
13
@@ -80,15 +82,31 @@ type DistroVersionDefinition struct {
80
82
MockConfigPathAarch64string`toml:"mock-config-aarch64,omitempty" json:"mockConfigAarch64,omitempty" validate:"omitempty,filepath" jsonschema:"title=Mock config file,description=Path to the aarch64 mock config file for this version"`
81
83
}
82
84
85
+
// MergeUpdatesFrom mutates the distro definition, updating it with overrides present in other.
86
+
// Uses [mergo.WithOverride] without WithAppendSlice so that slice fields like
87
+
// [DistroDefinition.PackageRepositories] are replaced, not appended. This supports the primary
88
+
// use case of swapping between package sources via --config-file overrides.
89
+
//
90
+
// For map fields like [DistroDefinition.Versions], mergo replaces the entire value for a
91
+
// matching key rather than doing a field-level merge within the value struct.
0 commit comments