Skip to content
This repository was archived by the owner on Dec 17, 2025. It is now read-only.

feat: add open container version to log messages - #2001

Open
aauren wants to merge 1955 commits into
containrrr:mainfrom
aauren:add_opencontainer_version_to_log
Open

feat: add open container version to log messages#2001
aauren wants to merge 1955 commits into
containrrr:mainfrom
aauren:add_opencontainer_version_to_log

Conversation

@aauren

@aauren aauren commented Jul 14, 2024

Copy link
Copy Markdown

What This PR Does

It adds the opencontainers image version to the update log if it exists on the container to give a better description of what the upgrade actually is.

As the issue that I linked below points out, org.opencontainers.image.version is a piloted standard to bring more consistency to container labels. All containers built via GitHub actions add them. Additionally, all containers from linuxserver contain them as well.

Related Issues

This is partially related to #1848

Although in that issue, they were asking that this information be added to watchtower's templating function. I don't actually use the templating function, so I didn't put it there, but I would imagine that making container labels available via the template functions would be a much larger PR.

Testing

I have been running with this setup for several days and it has worked great for me.

Example Output

Found new [lscr.io/linuxserver/nzbhydra2:latest](http://lscr.io/linuxserver/nzbhydra2:latest) image (fbeb6b7869e3 - v7.3.0-ls16)
Stopping /nzbhydra2 (387cd3eb4f70 - v7.2.3-ls15) with SIGTERM
Creating /nzbhydra2
Removing image ba50bb7dfb51

@aauren
aauren requested a review from simonaronsson as a code owner July 14, 2024 17:28

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations on opening your first pull request! We'll get back to you as soon as possible. In the meantime, please make sure you've updated the documentation to reflect your changes and have added test automation as needed. Thanks! 🙏🏼

@aauren
aauren force-pushed the add_opencontainer_version_to_log branch from 4a1e6b2 to d60d5bb Compare September 8, 2025 23:24
@aauren
aauren requested a review from piksel as a code owner September 8, 2025 23:24
@aauren
aauren force-pushed the add_opencontainer_version_to_log branch 3 times, most recently from bdc9864 to 1c2b7b1 Compare April 6, 2026 16:33
github-actions Bot and others added 23 commits June 24, 2026 10:05
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
containrrr#1849)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…1853)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainrrr#1855)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ble (containrrr#1856)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…1.9 (containrrr#1858)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainrrr#1861)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
containrrr#1863)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…1.10 (containrrr#1864)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ntainrrr#1867)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainrrr#1868)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainrrr#1870)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…nrrr#1872)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…r#1874)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
github-actions Bot and others added 29 commits August 3, 2026 22:51
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…r#2094)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…n/net/http/otelhttp to v0.70.0 (containrrr#2096)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…1.38 (containrrr#2098)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…7.0 (containrrr#2099)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…1.39 (containrrr#2101)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ntainrrr#2102)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…2106)

- Detect Docker bridge driver generated MACs derived from IPv4 address
- Clear engine-generated MACs during endpoint processing
- Preserve user-configured MAC addresses that do not match the IP pattern
- Allow intentionally cleared engine-generated MACs to pass `validateMacAddresses`
- Add tests for engine-generated MAC detection, clearing logic, and validation waiver behavior
- Update existing test fixtures to use user-configured MACs where preservation is the expected behavior
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
… recovery (containrrr#2108)

* fix(actions): ensure sufficient timeout for container create/start during restart

- Use max of configured timeout and defaultCreateStartTimeout for detached context
- Create fresh contexts for rename-back and cleanup operations
- Add test coverage for timeout minimums and context distinctness

* test(actions): validate context propagation for container create and start operations

- Verify CreateContainer and StartContainerByID receive the same detached context as SetNoRestartPolicy
- Ensure deadline consistency across container lifecycle operations during restart flow
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…state (containrrr#2109)

* fix(cleanup): remove orphaned Watchtower containers stuck in created state

- Detect and remove Watchtower containers left in created state after failed self-update
- Add IsCreated() method to Container interface with implementation and mock updates
- Validate container scope matches current scope during orphaned cleanup
- Add comprehensive test coverage for orphaned created-state container scenarios

* test(actions): remove obsolete deadline absence assertions from detached context tests

- Celete outdated else branch that expected no deadlines on CreateContainer and StartContainerByID contexts
- Align test expectations with enforced timeout propagation for container lifecycle operations
* fix(recovery): attempt to start orphaned Watchtower containers stuck in created state

- Add TryRecoverOrphanedContainer to recover containers from failed self-updates
- Invoke recovery during pre-run and update flows before setting no-restart policy
- Validate container scope matches current scope during recovery attempts
- Add dedicated test suite for recovery scenarios and context cancellation behavior

* fix: isolate timeout context and add scope validation for orphaned Watchtower containers

- Use dedicated recoverCtx with restartPolicyTimeout instead of shared exit or restart policy contexts
- Extract isRecoverableOrphan helper to centralize eligibility checks for container recovery
- Enforce scope matching to prevent cross-scope recovery of orphaned containers
- Replace busy-wait synchronization loops with gomega.Eventually in detached context tests
- Add test coverage for scope mismatch scenarios in update_recovery_test.go
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ontainrrr#2116)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ble (containrrr#2118)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…ontainrrr#2120)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…1.40 (containrrr#2121)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ssages (containrrr#2124)

- Add fatal validation for empty email from, to, and server fields
- Add fatal validation for empty Slack hook URL
- Simplify Gotify token and URL error messages
- Simplify Microsoft Teams webhook URL error message
- Add tests for empty required field validation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Include org.opencontainers.image.version labels in email notifications
when a new image is found. Both the old (current) and new image versions
are displayed on a single line, making version transitions easy to see
at a glance. Example output:

  Found new image: ghcr.io/homarr-labs/homarr:latest (b7734c440450) v0.15.0 -> v0.16.0

The version is extracted from the new image during the staleness check
and from the running container's labels for the old version. Images
without the OCI version label are displayed without version info.
@aauren
aauren force-pushed the add_opencontainer_version_to_log branch from 1c2b7b1 to 8e7f199 Compare August 9, 2026 00:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants