Skip to content

regexp:(dev|main) not working #765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ybizeul opened this issue Aug 6, 2024 · 4 comments
Open

regexp:(dev|main) not working #765

ybizeul opened this issue Aug 6, 2024 · 4 comments

Comments

@ybizeul
Copy link

ybizeul commented Aug 6, 2024

I'm trying to keep my pod up to date on both main and dev image tags.
It updates fine as long as the tag doesn't change, but if current tag is dev, a push to main won't trigger an update.

@david-garcia-garcia
Copy link
Collaborator

@ybizeul your container tag names need to follow some sort ordered pattern. You can try with regex: or glob: see if you can workaround it (introduced in 611ff29).

In any case, I'd recommend using Semver.

@ybizeul
Copy link
Author

ybizeul commented May 1, 2025

Policy is keel.sh/policy: regexp:^(dev|main)$
Strict semver would force me to publish new images for every change which isn't really necessary for main and dev tags

@david-garcia-garcia
Copy link
Collaborator

david-garcia-garcia commented May 20, 2025

@ybizeul tags watcher only worked with semver. I went through the docs and cannot figure out why it worked this way, maybe this was some sort of legacy behaviour, edge case, overlooked bug or I got it completely wrong....

I attempt to fix it in: #812

Yet, your case will not work as you expect though:

keel.sh/policy: regexp:^(dev|main)$

Keel relies completely on tag names to decide wether to update or not, and what is newer or not. Unless you are using the force policy with match-tag (updates based on digest changes for a specific tag), it will not know when to update (i.e. what tag names is supposed to be "newer" dev or main)

@david-garcia-garcia
Copy link
Collaborator

Watching new tags using regex and glob should be fixed in https://github.com/keel-hq/keel/releases/tag/0.20.1-beta.2

As for the use case:

keel.sh/policy: regexp:^(dev|main)$

Current implementation will setup a tags watcher, but because the tag has not changed, nothing will be updated. This is expected because digest based update is only working with tag watcher (singular), and that only observes one tag.

The only way to reasonbly support updating to the newest image would be retrieving image metadata per tag, and use that to prioritize. That would add extra overhead, and probably require to implement local metadata caching to avoid performance issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants