@@ -34,13 +34,22 @@ import (
3434// architecture that could not be locked. Using the "index" architecture is equivalent to what
3535// this used to return prior to supporting per-arch locked configs.
3636func LockImageConfiguration (ctx context.Context , ic types.ImageConfiguration , opts ... Option ) (map [string ]* types.ImageConfiguration , map [string ][]string , error ) {
37- mc , err := NewMultiArch ( ctx , ic . Archs , append (opts , WithImageConfiguration (ic ))... )
37+ o , input , err := NewOptions ( append (opts , WithImageConfiguration (ic ))... )
3838 if err != nil {
3939 return nil , nil , err
4040 }
4141
42- archs := make ([]resolved , 0 , len (ic .Archs ))
43- ics := make (map [string ]* types.ImageConfiguration , len (ic .Archs )+ 1 )
42+ input .Contents .BuildRepositories = sets .List (sets .New (input .Contents .BuildRepositories ... ).Insert (o .ExtraBuildRepos ... ))
43+ input .Contents .RuntimeRepositories = sets .List (sets .New (input .Contents .RuntimeRepositories ... ).Insert (o .ExtraRuntimeRepos ... ))
44+ input .Contents .Keyring = sets .List (sets .New (input .Contents .Keyring ... ).Insert (o .ExtraKeyFiles ... ))
45+
46+ mc , err := NewMultiArch (ctx , input .Archs , append (opts , WithImageConfiguration (* input ))... )
47+ if err != nil {
48+ return nil , nil , err
49+ }
50+
51+ archs := make ([]resolved , 0 , len (input .Archs ))
52+ ics := make (map [string ]* types.ImageConfiguration , len (input .Archs )+ 1 )
4453
4554 // Determine the exact versions of our transitive packages and lock them
4655 // down in the "resolved" configuration, so that this build may be
@@ -79,16 +88,16 @@ func LockImageConfiguration(ctx context.Context, ic types.ImageConfiguration, op
7988 archs = append (archs , r )
8089 }
8190
82- pls , missing , err := unify (ic .Contents .Packages , archs )
91+ pls , missing , err := unify (input .Contents .Packages , archs )
8392 if err != nil {
8493 return nil , missing , err
8594 }
8695
8796 // Set the locked package lists.
8897 for arch , pl := range pls {
89- // Create a defensive copy of "ic ".
98+ // Create a defensive copy of "input ".
9099 copied := types.ImageConfiguration {}
91- if err := ic .MergeInto (& copied ); err != nil {
100+ if err := input .MergeInto (& copied ); err != nil {
92101 return nil , nil , err
93102 }
94103
0 commit comments