Browse Source

Merge pull request #2866 from ArchiFleKs/docs/semver

docs: add other semver example with range
Hidde Beydals 1 month ago
parent
commit
1d94e0a227
No account linked to committer's email address
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      docs/references/automated-image-update.md

+ 20
- 0
docs/references/automated-image-update.md View File

@@ -57,6 +57,25 @@ The above configuration will make Flux update the image when you push
57 57
 an image tag that matches the [semantic version](https://semver.org/)
58 58
 expression e.g `my-app:1.0.1` but not `my-app:1.2.0`. 
59 59
 
60
+Flux also support all the other ranges and operators available [here](https://github.com/Masterminds/semver) in addition to the `~` range.
61
+
62
+Restrict image to deploy prerelease version up until `myapp:1.0.0` but not `myapp:1.0.1`:
63
+
64
+```yaml
65
+apiVersion: apps/v1
66
+kind: Deployment
67
+metadata:
68
+  annotations:
69
+    fluxcd.io/automated: "true"
70
+    fluxcd.io/tag.app: "semver: >= 1.0.0-rc.0, <1.0.1"
71
+spec:
72
+  template:
73
+    spec:
74
+      containers:
75
+      - name: app
76
+        image: docker.io/org/my-app:1.0.0-rc.1
77
+```
78
+
60 79
 Restrict image updates with glob and regex expressions:
61 80
 
62 81
 ```yaml
@@ -85,3 +104,4 @@ For the `app` container, Flux will update it when you push a tag for the
85 104
 To target a specific container the annotation format is `fluxcd.io/tag.<CONTAINER>: <TYPE>:<EXPRESSION>`.
86 105
 
87 106
 You can turn off the automation with `fluxcd.io/automated: "false"` or with `fluxcd.io/locked: "true"`.
107
+

Loading…
Cancel
Save