Skip to content
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

container source plugin supports watching update of a specified tag #243

Merged
merged 2 commits into from
Dec 2, 2023

Conversation

bianjp
Copy link
Contributor

@bianjp bianjp commented Nov 30, 2023

This PR extends the container source plugin to support watching update of a specified tag.

Previously the container parameter can only be image_path, now it will also accept image_path:tag. If no tag is given, the plugin's behavior is the same as before.

When watching for a specified tag, the tag's version is the update time of the tag. Single image tag itself does not have any update time, we take the creation time of the image ID referred by the tag. Theoretically speaking the creation time is not 100% reliable but in practice it is acceptable and more readable than image ID.

Sample config:

# watch the latest tag
[oraclelinux]
source = "container"
container = "library/oraclelinux"

# watch the update of oraclelinux:8 tag
[oraclelinux-8]
source = "container"
container = "library/oraclelinux:8"

Resolve #241

@yan12125
Copy link
Contributor

yan12125 commented Dec 2, 2023

Thanks! I'm not sure if it will be confusing to return different data types with different configurations, though.

@lilydjwg lilydjwg merged commit 4833135 into lilydjwg:master Dec 2, 2023
25 checks passed
@lilydjwg
Copy link
Owner

lilydjwg commented Dec 2, 2023

if it will be confusing to return different data types with different configurations, though.

It's already happening, e.g. for those git-hosting sites.

@yan12125
Copy link
Contributor

yan12125 commented Dec 2, 2023

Oh you're right. Indeed I was once confused by cases like use_latest_release and use_max_tag in the github source.

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

Successfully merging this pull request may close these issues.

[Feature Request] Support watch update of specific docker image tag
3 participants