@@ -87,12 +87,12 @@ func syncItem(ctx context.Context, a *latestV1.Artifact, tag string, e filemon.E
87
87
return nil , fmt .Errorf ("retrieving working dir for %q: %w" , tag , err )
88
88
}
89
89
90
- toCopy , err := intersect (a .Workspace , containerWd , syncRules , append (e .Added , e .Modified ... ))
90
+ toCopy , err := intersect (ctx , a .Workspace , containerWd , syncRules , append (e .Added , e .Modified ... ))
91
91
if err != nil {
92
92
return nil , fmt .Errorf ("intersecting sync map and added, modified files: %w" , err )
93
93
}
94
94
95
- toDelete , err := intersect (a .Workspace , containerWd , syncRules , e .Deleted )
95
+ toDelete , err := intersect (ctx , a .Workspace , containerWd , syncRules , e .Deleted )
96
96
if err != nil {
97
97
return nil , fmt .Errorf ("intersecting sync map and deleted files: %w" , err )
98
98
}
@@ -134,14 +134,14 @@ func inferredSyncItem(ctx context.Context, a *latestV1.Artifact, tag string, e f
134
134
}
135
135
}
136
136
if ! matches {
137
- log .Entry (context . TODO () ).Infof ("Changed file %s does not match any sync pattern. Skipping sync" , relPath )
137
+ log .Entry (ctx ).Infof ("Changed file %s does not match any sync pattern. Skipping sync" , relPath )
138
138
return nil , nil
139
139
}
140
140
141
141
if dsts , ok := syncMap [relPath ]; ok {
142
142
toCopy [f ] = dsts
143
143
} else {
144
- log .Entry (context . TODO () ).Infof ("Changed file %s is not syncable. Skipping sync" , relPath )
144
+ log .Entry (ctx ).Infof ("Changed file %s is not syncable. Skipping sync" , relPath )
145
145
return nil , nil
146
146
}
147
147
}
@@ -206,7 +206,7 @@ func latestTag(image string, builds []graph.Artifact) string {
206
206
return ""
207
207
}
208
208
209
- func intersect (contextWd , containerWd string , syncRules []* latestV1.SyncRule , files []string ) (syncMap , error ) {
209
+ func intersect (ctx context. Context , contextWd , containerWd string , syncRules []* latestV1.SyncRule , files []string ) (syncMap , error ) {
210
210
ret := make (syncMap )
211
211
for _ , f := range files {
212
212
relPath , err := filepath .Rel (contextWd , f )
@@ -220,7 +220,7 @@ func intersect(contextWd, containerWd string, syncRules []*latestV1.SyncRule, fi
220
220
}
221
221
222
222
if len (dsts ) == 0 {
223
- log .Entry (context . TODO () ).Infof ("Changed file %s does not match any sync pattern. Skipping sync" , relPath )
223
+ log .Entry (ctx ).Infof ("Changed file %s does not match any sync pattern. Skipping sync" , relPath )
224
224
return nil , nil
225
225
}
226
226
0 commit comments