Skip to content

Commit

Permalink
More detail for the RFC
Browse files Browse the repository at this point in the history
Signed-off-by: GregoireW <24318548+GregoireW@users.noreply.github.com>
  • Loading branch information
GregoireW committed Jan 25, 2022
1 parent 200b4c3 commit 15ea533
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions rfcs/0005-managed-attributes-image-automation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit 15ea533

Please sign in to comment.