mirror of
https://github.com/fluxcd/flux2.git
synced 2026-02-09 09:17:27 +00:00
More detail for the RFC
Signed-off-by: GregoireW <24318548+GregoireW@users.noreply.github.com>
This commit is contained in:
parent
200b4c3275
commit
15ea533e42
1 changed files with 16 additions and 5 deletions
|
|
@ -55,15 +55,23 @@ This raise the question on should this feature to be included in flux or not.
|
|||
|
||||
## Design Details
|
||||
|
||||
Simple update on the image automation controller should be enough. Today a
|
||||
filter in the image policy is like:
|
||||
Two options are possible here:
|
||||
|
||||
- Only modify the Image Automation Controller to make it read ImagePolicies spec
|
||||
and compute attributes
|
||||
- Modify the Image Reflector Controller, to extract the attributes, stores them
|
||||
in the status and update the Image Automation Controller to use this new data storage.
|
||||
|
||||
The second option seems to be preferable to separate concerns.
|
||||
|
||||
A simple option would be to allow multiple capture group in the filter in the ImagePolicy:
|
||||
|
||||
```yaml
|
||||
extract: $ts
|
||||
pattern: ^pr-(?P<pr>.*)-(?P<ts>\d*)-(?P<sha1>.*)$
|
||||
```
|
||||
|
||||
It is possible to modify the image automation to take comment like:
|
||||
And then to modify the Image Automation Controller to take comment like:
|
||||
|
||||
```yaml
|
||||
# {"$imagepolicy": "{namespace}:{imagepolicy}:{attributes}"
|
||||
|
|
@ -77,8 +85,11 @@ From previous pattern example, accepted attributes will be:
|
|||
- ts
|
||||
- sha1
|
||||
|
||||
If a user try to use an attribute name like `tag` or `name` which is
|
||||
already defined by flux core, then the original meaning will still be kept :
|
||||
If a user try to capture an attribute with a name like `tag` or `name` (already defined
|
||||
by flux core), then the original value will be kept and a warning should show on the
|
||||
Image Reflector Controller logs.
|
||||
|
||||
As reminder, here is the definition for those default attributes:
|
||||
|
||||
- tag: the full tag string
|
||||
- name: the image name
|
||||
|
|
|
|||
Loading…
Reference in a new issue