Skip to content

Commit 78e4abc

Browse files
committed
adding an example for semverFilter in the the documentation
Signed-off-by: Soule BA <[email protected]>
1 parent 91dfdc2 commit 78e4abc

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
@@ -390,6 +390,37 @@ order to distribute the load more evenly when multiple OCIRepository objects are
390390
set up with the same interval. For more information, please refer to the
391391
[source-controller configuration options](https://fluxcd.io/flux/components/source/options/).
392392

393+
### SemverFilter
394+
395+
`.spec.ref.semverFilter` is an optional field to specify a SemVer filter to apply
396+
when fetching tags from the OCI repository. The filter is a regular expression
397+
that is applied to the tags fetched from the repository. Only tags that match
398+
the filter are considered for the semver range resolution.
399+
400+
**Note:** The filter is only taken into account when the `.spec.ref.semver` field
401+
is set.
402+
403+
```yaml
404+
---
405+
apiVersion: source.toolkit.fluxcd.io/v1beta2
406+
kind: OCIRepository
407+
metadata:
408+
name: podinfo
409+
namespace: default
410+
spec:
411+
interval: 5m0s
412+
url: oci://ghcr.io/stefanprodan/manifests/podinfo
413+
ref:
414+
# SemVer comparisons using constraints without a prerelease comparator will skip prerelease versions.
415+
# Adding a `-0` suffix to the semver range will include prerelease versions.
416+
semver: ">= 6.1.x-0"
417+
semverFilter: ".*-rc.*"
418+
```
419+
420+
In the above example, the controller fetches tags from the `ghcr.io/stefanprodan/manifests/podinfo`
421+
repository and filters them using the regular expression `.*-rc.*`. Only tags that
422+
contain the `-rc` suffix are considered for the semver range resolution.
423+
393424
### Timeout
394425

395426
`.spec.timeout` is an optional field to specify a timeout for OCI operations

0 commit comments

Comments
 (0)