lilydjwg / nvchecker

New version checker for software releases
MIT License
425 stars 68 forks source link

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

Closed bianjp closed 9 months ago

bianjp commented 9 months ago

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 commented 9 months ago

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

lilydjwg commented 9 months ago

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 commented 9 months ago

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