fix(container/image_versions): reject entries that are not image references
The parser retained any key ending in _IMAGE, so a harmless-looking variable like NOT_AN_IMAGE="something" would be treated as a pinned container image. Add a value-shape check: the value must contain both a registry separator (/) and a tag separator (:) to qualify.
This commit is contained in:
parent
c5ea41d0cb
commit
2843cc1e84
@ -107,8 +107,11 @@ fn parse_image_versions(content: &str) -> HashMap<String, String> {
|
||||
}
|
||||
}
|
||||
|
||||
// Keep only *_IMAGE entries
|
||||
vars.retain(|k, _| k.ends_with("_IMAGE"));
|
||||
// Keep only *_IMAGE entries whose value looks like a container image
|
||||
// reference (contains a `:` tag separator and at least one `/` path
|
||||
// component). Rejects placeholder values like "something" so a
|
||||
// hand-edit typo in image-versions.sh never gets treated as an image.
|
||||
vars.retain(|k, v| k.ends_with("_IMAGE") && v.contains(':') && v.contains('/'));
|
||||
vars
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user