Commit Graph

7 Commits

Author SHA1 Message Date
Arpit Jain
d32ba3f38c fix: do not panic on an invalid image name regexp
IsImageMatched interpolates the image name from kustomization images[].name
straight into a regexp and discarded the compile error. When the name is not
a valid regexp (for example "["), regexp.Compile returns a nil *Regexp and
the following MatchString call dereferences it, so kustomize build crashes with
a SIGSEGV.

Capture the compile error and return false when it is set. A name that can't
compile matches no image, which leaves the resource untouched (the same result
you get for any name that doesn't match). Adds a unit test for the invalid name
and a krusty end-to-end case that builds without panicking.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-07-11 05:50:05 +09:00
koba1t
37715863f0 use Strict unmarshal when read TransformerConfig 2024-02-22 05:39:55 +09:00
Natasha Sarkar
8b082aff5a Change paths for krusty tests to relative, and have top level be '.' instead of 'app' 2021-02-24 16:23:45 -08:00
Donny Xia
9ca8f4602d add legacy filter to image tag transformer 2020-09-01 13:06:14 -07:00
jregan
ef924a5c9c Convert image transformer to kyaml. 2020-07-22 11:10:52 -07:00
Jeffrey Regan
382c330f5b Consolidate test harness to one package. 2019-12-02 12:29:10 -08:00
jregan
a49a764705 More tests. 2019-11-29 08:31:51 -08:00