k8s-image-availability-exporter icon indicating copy to clipboard operation
k8s-image-availability-exporter copied to clipboard

Fix ignoring all images when --ignored-images option absent

Open verdel opened this issue 3 years ago • 1 comments

Fix #55

When --ignored-images option absent we have regexp list with one compile regexp. This regexp with compile empty string value matches all images in k8s cluster and exporter ignore they.

This is due to calling string.Split() in this piece of code:

var regexes []regexp.Regexp
regexStrings := strings.Split(*ignoredImagesStr, "~")
  for _, regexStr := range regexStrings {
    regexes = append(regexes, *regexp.MustCompile(regexStr))
  }

We should fill the regexes array only if the --ignored-images option was specified when starting the exporter.

verdel avatar Aug 02 '22 21:08 verdel

Codecov Report

Merging #57 (08d668e) into master (358c329) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   19.12%   19.12%           
=======================================
  Files           5        5           
  Lines         596      596           
=======================================
  Hits          114      114           
  Misses        474      474           
  Partials        8        8           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 358c329...08d668e. Read the comment docs.

codecov[bot] avatar Aug 02 '22 21:08 codecov[bot]