@@ -199,15 +199,21 @@ func (d *Deployment) SetFiles(files []File, volumeMounts []v1.VolumeMount) *broa
199199 fileOverviews = append (fileOverviews , & pb.File {FileMeta : file .Meta })
200200 }
201201
202- volumeIgnoreFiles := make ([]string , 0 , len (d .latestFileNames ))
203- for _ , f := range d .latestFileNames {
204- for _ , vm := range volumeMounts {
202+ // To avoid duplicates, use a set for volume ignore files
203+ volumeIgnoreSet := make (map [string ]struct {}, len (d .latestFileNames ))
204+ for _ , vm := range volumeMounts {
205+ for _ , f := range d .latestFileNames {
205206 if strings .HasPrefix (f , vm .MountPath ) {
206- volumeIgnoreFiles = append ( volumeIgnoreFiles , f )
207+ volumeIgnoreSet [ f ] = struct {}{}
207208 }
208209 }
209210 }
210211
212+ volumeIgnoreFiles := make ([]string , 0 , len (volumeIgnoreSet ))
213+ for f := range volumeIgnoreSet {
214+ volumeIgnoreFiles = append (volumeIgnoreFiles , f )
215+ }
216+
211217 // add ignored files to the overview as 'unmanaged' so agent doesn't touch them
212218 for _ , f := range append (ignoreFiles , volumeIgnoreFiles ... ) {
213219 meta := & pb.FileMeta {
0 commit comments