Semver act on all tags #5231
-
Hi, I’m trying to make Flux work by monitoring all semver tags, whatever the version. Below is an example of what I’m trying rn: apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: blog
namespace: flux-system
spec:
interval: 1m
ref:
semver: ">= 0.0.0-0"
url: https://git.example.com/blog
secretRef:
name: blog-access-token
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: blog
namespace: flux-system
spec:
interval: 1m
path: ./kustomize/overlays/staging
prune: true
sourceRef:
kind: GitRepository
name: blog As one can see, I read this to end up with
Btw, there is the following tag in the repository: I tried to add a What am I doing wrong? How to make flux monitor all semver tags, including (but not limited to) pre-release ones? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After some tinkering, I found out that Note As per the spec, it seems that any dot separated identifier which consists only of digits cannot start by This is valid: Flux is working as expected. If one ends up here, they can run the following code snippet in the Go playground to check if their semver is valid: package main
import (
"fmt"
"github.com/Masterminds/semver/v3"
)
func main() {
v, err := semver.NewVersion("YOUR-SEMVER-HERE")
if err != nil {
fmt.Printf("invalid version: %s", err)
}
fmt.Printf("version is valid: %s", v)
} Or check their semver against the RegExp provided in the spec. |
Beta Was this translation helpful? Give feedback.
After some tinkering, I found out that
for some reason0.0.1-rc250305.095646
is not valid, while0.0.1-rc.250305095646
is.Note
As per the spec, it seems that any dot separated identifier which consists only of digits cannot start by
0
.This is valid:
0.0.1-rc.0
,0.0.1-rc.0smthg
,0.0.1-rc.0123smthg
This is not:
0.0.1-rc.01
Flux is working as expected.
If one ends up here, they can run the following code snippet in the Go playground to check if their semver is valid: