Skip to content

Extend image policy with numerical ordering #102

@stefanprodan

Description

@stefanprodan

While alphabetical ordering works great with image tags that contain a RFC3339 timestamp, it's not suitable for CI build IDs, as these are numbers with no padding.

I propose we introduce a new ordering option called numerical to be able to correct detect the latest build for tags in the format <PREFIX>-<BUILD_ID>.

Example:

kind: ImagePolicy
spec:
  filterTags:
    pattern: '^main-[a-fA-F0-9]+-(?P<id>.*)'
    extract: '$id'
  policy:
    numerical:
      order: asc

Given the tags main-845d3a80-100 and main-3e32dc8a-2 the numerical policy, unlike alphabetical, will chose main-3e32dc8a-100 as the latest build.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions