Skip to content

Commit 6d7189d

Browse files
committed
adding an example for semverFilter in the the documentation
Signed-off-by: Soule BA <[email protected]>
1 parent 10434e7 commit 6d7189d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/spec/v1beta2/ocirepositories.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,37 @@ spec:
441441

442442
This field takes precedence over [`.tag`](#tag-example).
443443

444+
#### SemverFilter example
445+
446+
`.spec.ref.semverFilter` is an optional field to specify a SemVer filter to apply
447+
when fetching tags from the OCI repository. The filter is a regular expression
448+
that is applied to the tags fetched from the repository. Only tags that match
449+
the filter are considered for the semver range resolution.
450+
451+
**Note:** The filter is only taken into account when the `.spec.ref.semver` field
452+
is set.
453+
454+
```yaml
455+
---
456+
apiVersion: source.toolkit.fluxcd.io/v1beta2
457+
kind: OCIRepository
458+
metadata:
459+
name: podinfo
460+
namespace: default
461+
spec:
462+
interval: 5m0s
463+
url: oci://ghcr.io/stefanprodan/manifests/podinfo
464+
ref:
465+
# SemVer comparisons using constraints without a prerelease comparator will skip prerelease versions.
466+
# Adding a `-0` suffix to the semver range will include prerelease versions.
467+
semver: ">= 6.1.x-0"
468+
semverFilter: ".*-rc.*"
469+
```
470+
471+
In the above example, the controller fetches tags from the `ghcr.io/stefanprodan/manifests/podinfo`
472+
repository and filters them using the regular expression `.*-rc.*`. Only tags that
473+
contain the `-rc` suffix are considered for the semver range resolution.
474+
444475
#### Digest example
445476

446477
To pull a specific digest, use `.spec.ref.digest`:

0 commit comments

Comments
 (0)