fix(docs): correct invalid regex in snapshot ecs help examples - #1080
Conversation
|
Claude finished @dangrondahl's task in 1m 33s —— View job Review: PR #1080 — fix invalid regex in
|
The --*-regex flags compile their values as Go RE2 regexes, but two examples used "*-prod-*", which fails with "missing argument to repetition operator" - and only after the AWS API calls have run. Also anchor the four remaining examples that read as globs: "backend-*" compiles, but -* means "zero or more hyphens" and matching is unanchored, so it really means "contains backend". Add a test that every regex pattern in the examples compiles.
c8fb475 to
1dcc2f3
Compare
Fixes #1079.
The
--*-regexflags onkosli snapshot ecscompile their values as Go RE2 regexes (internal/filters/resourceFilter.go), but two help examples used"*-prod-*":Anyone copying those examples gets a failed snapshot, and only after the AWS API calls have already run.
Changes:
"*-prod-*"->".*-prod-.*"(the two broken examples)"my-cluster-*"/"backend-*"->"^my-cluster-.*"/"^backend-.*". These compiled, but read as globs:-*means "zero or more hyphens" and matching is unanchored, so"backend-*"really meant "containsbackend" (it matchedbackendfoo).example regex "*-prod-*" does not compile.Help text only - no behaviour change.