Commit 5f4f91e 1 parent cd63c20 commit 5f4f91e Copy full SHA for 5f4f91e
File tree 1 file changed +11
-1
lines changed
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ import (
23
23
"os"
24
24
"path/filepath"
25
25
"strings"
26
+ "sync"
26
27
27
28
"github.com/Masterminds/semver/v3"
28
29
securejoin "github.com/cyphar/filepath-securejoin"
@@ -57,6 +58,8 @@ type DependencyManager struct {
57
58
// Dependencies contains a list of dependencies, and the respective
58
59
// repository the dependency can be found at.
59
60
Dependencies []* DependencyWithRepository
61
+
62
+ mu sync.Mutex
60
63
}
61
64
62
65
// Build compiles and builds the dependencies of the Chart.
@@ -66,7 +69,8 @@ func (dm *DependencyManager) Build(ctx context.Context) error {
66
69
}
67
70
68
71
errs , ctx := errgroup .WithContext (ctx )
69
- for _ , item := range dm .Dependencies {
72
+ for _ , i := range dm .Dependencies {
73
+ item := i
70
74
errs .Go (func () error {
71
75
select {
72
76
case <- ctx .Done ():
@@ -123,7 +127,10 @@ func (dm *DependencyManager) addLocalDependency(dpr *DependencyWithRepository) e
123
127
return err
124
128
}
125
129
130
+ dm .mu .Lock ()
126
131
dm .Chart .AddDependency (ch )
132
+ dm .mu .Unlock ()
133
+
127
134
return nil
128
135
}
129
136
@@ -147,7 +154,10 @@ func (dm *DependencyManager) addRemoteDependency(dpr *DependencyWithRepository)
147
154
return err
148
155
}
149
156
157
+ dm .mu .Lock ()
150
158
dm .Chart .AddDependency (ch )
159
+ dm .mu .Unlock ()
160
+
151
161
return nil
152
162
}
153
163
You can’t perform that action at this time.
0 commit comments