@@ -2278,60 +2278,60 @@ addExtraBinIncludes:
22782278 }
22792279
22802280 err := filepath .Walk (inPath ,
2281- func (pth string , info os.FileInfo , err error ) error {
2282- if strings .HasPrefix (pth , "/proc/" ) {
2283- log .Debugf ("skipping /proc file system objects... - '%s'" , pth )
2284- return filepath .SkipDir
2285- }
2281+ func (pth string , info os.FileInfo , err error ) error {
2282+ if strings .HasPrefix (pth , "/proc/" ) {
2283+ log .Debugf ("skipping /proc file system objects... - '%s'" , pth )
2284+ return filepath .SkipDir
2285+ }
22862286
2287- if strings .HasPrefix (pth , "/sys/" ) {
2288- log .Debugf ("skipping /sys file system objects... - '%s'" , pth )
2289- return filepath .SkipDir
2290- }
2287+ if strings .HasPrefix (pth , "/sys/" ) {
2288+ log .Debugf ("skipping /sys file system objects... - '%s'" , pth )
2289+ return filepath .SkipDir
2290+ }
22912291
2292- if strings .HasPrefix (pth , "/dev/" ) {
2293- log .Debugf ("skipping /dev file system objects... - '%s'" , pth )
2294- return filepath .SkipDir
2295- }
2292+ if strings .HasPrefix (pth , "/dev/" ) {
2293+ log .Debugf ("skipping /dev file system objects... - '%s'" , pth )
2294+ return filepath .SkipDir
2295+ }
22962296
2297- // Optimization: Exclude folders early on to prevent slow enumerat
2298- // Can help with mounting big folders from the host.
2299- // TODO: Combine this logic with the similar logic in findSymlinks().
2300- for _ , xpattern := range excludePatterns {
2301- if match , _ := doublestar .Match (xpattern , pth ); match {
2302- if info .Mode ().IsDir () {
2303- return filepath .SkipDir
2297+ // Optimization: Exclude folders early on to prevent slow enumerat
2298+ // Can help with mounting big folders from the host.
2299+ // TODO: Combine this logic with the similar logic in findSymlinks().
2300+ for _ , xpattern := range excludePatterns {
2301+ if match , _ := doublestar .Match (xpattern , pth ); match {
2302+ if info .Mode ().IsDir () {
2303+ return filepath .SkipDir
2304+ }
2305+ return nil
23042306 }
2305- return nil
23062307 }
2307- }
23082308
2309- if err != nil {
2310- log .Debugf ("skipping %s with error: %v" , pth , err )
2311- return nil
2312- }
2309+ if err != nil {
2310+ log .Debugf ("skipping %s with error: %v" , pth , err )
2311+ return nil
2312+ }
23132313
2314- if ! info .Mode ().IsRegular () {
2315- return nil
2316- }
2314+ if ! info .Mode ().IsRegular () {
2315+ return nil
2316+ }
23172317
2318- pth , err = filepath .Abs (pth )
2319- if err != nil {
2320- return nil
2321- }
2318+ pth , err = filepath .Abs (pth )
2319+ if err != nil {
2320+ return nil
2321+ }
23222322
2323- if strings .HasPrefix (pth , "/proc/" ) ||
2324- strings .HasPrefix (pth , "/sys/" ) ||
2325- strings .HasPrefix (pth , "/dev/" ) {
2326- return nil
2327- }
2323+ if strings .HasPrefix (pth , "/proc/" ) ||
2324+ strings .HasPrefix (pth , "/sys/" ) ||
2325+ strings .HasPrefix (pth , "/dev/" ) {
2326+ return nil
2327+ }
23282328
2329- if binProps , _ := binfile .Detected (pth ); binProps != nil && binProps .IsBin {
2330- binPathMap [pth ] = struct {}{}
2331- }
2329+ if binProps , _ := binfile .Detected (pth ); binProps != nil && binProps .IsBin {
2330+ binPathMap [pth ] = struct {}{}
2331+ }
23322332
2333- return nil
2334- })
2333+ return nil
2334+ })
23352335
23362336 if err != nil {
23372337 log .Errorf ("saveArtifacts - error enumerating includeDirBinsList dir (%s) - %v" , inPath , err )
0 commit comments