* Add rewrite support and fix existing tests * Add unit tests for policy matching * Compile regexes up front and store policies in map * Add test for verify flow with mirror * Rename ImageName -> ResolvedName And only set it when necessary * Rename Rewrite -> Replacement but keep it as rewrite in the yaml
13 lines
294 B
YAML
13 lines
294 B
YAML
version: v1
|
|
kind: policy-mapping
|
|
policies:
|
|
- id: test-images
|
|
description: Local test images
|
|
files:
|
|
- path: policy.rego
|
|
rules:
|
|
- pattern: "^docker[.]io/library/test-image$"
|
|
policy-id: test-images
|
|
- pattern: "^mirror[.]org/library/(.*)$"
|
|
rewrite: docker.io/library/$1
|