Skip to content

Configure digest watching per container from the Docker watcher - #1485

Closed
111blackeagle111 wants to merge 5 commits into
getwud:mainfrom
111blackeagle111:feat/central-digest-watch
Closed

111blackeagle111 wants to merge 5 commits into
getwud:mainfrom
111blackeagle111:feat/central-digest-watch

Conversation

@111blackeagle111

@111blackeagle111 111blackeagle111 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds watcher-local WUD_WATCHER_<NAME>_CONTAINERDIGESTS to enable or disable digest watching by exact Docker container name, for example {"postgres-db":{"watchdigest":true}}. JSON strings and native configuration objects share the same strict schema, with existing __FILE support. Explicit nonempty wud.watch.digest labels take precedence; unmatched containers retain existing defaults.

The resolver always returns a boolean, and payload label/cache handling follows upstream. Numeric-tag defaults and version discovery remain unchanged. No new digest algorithm, tag filters, storage changes, dependencies or UI are introduced.

Validation against main fb5245 (WUD 9.7.0): 2,728 backend tests, backend/documentation builds and documentation lint pass. Coverage improves on every axis; ESLint reports zero errors and the same 196 existing warning identities as pristine main. Independent QA passed 26 real Docker Engine checks with dedicated amd64 workloads and a controlled OCI registry, plus synthetic-fixture and direct-contract checks. Notification delivery, updater actions, UI and real ARM workloads were not tested. Upstream CI results are separate from these local checks.

@111blackeagle111
111blackeagle111 marked this pull request as ready for review October 25, 2026 13:04
@111blackeagle111

Copy link
Copy Markdown
Contributor Author

I've updated this PR against main (9.7.0) and resolved the changelog conflict. Local tests, builds and lint checks pass; the new CI run is awaiting maintainer approval. Could you share your thoughts on the approach when you have a chance?

@fmartinou

Copy link
Copy Markdown
Collaborator

Hi @111blackeagle111,

Thanks a lot for the rebase and for the high-quality contribution (tests and documentation are top-notch!).

We’ve been discussing this internally because it touches an important design question for WUD:

  1. Scope & naming: We really like the ability to override digest watching without modifying container labels (great for unlabelable appliances and Docker Hub rate limits). However, naming the variable CONTAINEROPTIONS while only supporting watchdigest raises expectations that all container options (taginclude, watch, delay, etc.) can be configured centrally. We are debating whether we should:

    • Keep this PR focused strictly on digest overrides (e.g. renaming to CONTAINERDIGESTS to keep things unambiguous), or
    • Design a broader "Workload Policy Engine" that would eventually support all options across all watchers (Docker/Compose, Swarm, Nomad, K8s), likely via a mounted configuration file.
  2. A couple of technical points in the current diff:

    • The fallback to store labels (actualContainerLabels = ... containerInStore?.labels) in Docker.ts introduces a potential inconsistency where labels are retained from the store on partial payloads, but other fields (stack, delay, transformTags) still reset because they read from the raw payload. Any partial payload caching logic should probably be addressed in a separate, dedicated PR.
    • resolveWatchDigest can return undefined, whereas container.image.digest.watch expects a strict boolean (?? false).
    • The Joi schema only accepts a stringified JSON; using joi.alternatives() would allow native JS objects as well (handy for programmatic usage/tests).

What are your thoughts on this? Would you prefer narrowing this PR to a dedicated digest override feature first, or do you have ideas on how this could fit into a more global options mechanism?

@111blackeagle111

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed feedback. I’d prefer to keep this PR focused on digest overrides first.

I agree that CONTAINEROPTIONS is too broad for the current scope.
I’ll rename it to CONTAINERDIGESTS and make the proposed adjustments:

  • Remove the store-label fallback, preserving upstream payload handling and leaving partial-payload caching for a separate PR.
  • Make resolveWatchDigest return a strict boolean, with false as the final fallback.
  • Accept both stringified JSON and native objects through joi.alternatives(), using the same strict validation.
    I’ll update the tests and documentation accordingly, preserving existing label precedence and defaults.

A broader policy mechanism across watchers is worth discussing separately, particularly how workload selection and precedence should work.
Does this narrower direction fit what you have in mind?

@fmartinou

Copy link
Copy Markdown
Collaborator

Hi @111blackeagle111,

Yes, this sounds like a great plan and aligns perfectly with what we had in mind!

Keeping this PR focused and clean with CONTAINERDIGESTS while addressing those technical points will make it much easier to review, test, and merge. We can then open an RFC/discussion for the broader multi-watcher policy engine down the road.

Looking forward to your updates!

@111blackeagle111
111blackeagle111 force-pushed the feat/central-digest-watch branch from 4cabacd to 4f8b408 Compare November 2, 2026 00:17
@111blackeagle111

111blackeagle111 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @fmartinou.
Updated as agreed: the setting is now CONTAINERDIGESTS, the store-label fallback has been removed, the resolver always returns a boolean, and JSON strings and native objects share the same strict validation.

Tests and documentation are updated. All 2,728 backend tests pass, along with builds and lint checks. Targeted checks against a real Docker Engine also passed using dedicated amd64 workloads and a controlled registry.

The new CI run is awaiting maintainer approval. Thanks again for the feedback!

fmartinou added a commit that referenced this pull request Nov 7, 2026
…name with CONTAINERDIGESTS (#1485)

Co-authored-by: 111blackeagle111 <96172471+111blackeagle111@users.noreply.github.com>
fmartinou added a commit that referenced this pull request Nov 7, 2026
…name with CONTAINERDIGESTS (#1485)

Co-authored-by: 111blackeagle111 <96172471+111blackeagle111@users.noreply.github.com>
@fmartinou

Copy link
Copy Markdown
Collaborator

Merged into main via commit 7efae78!

Thank you very much @111blackeagle111 for the great work, quick responsiveness, and high quality of your contribution!

@fmartinou fmartinou closed this Nov 7, 2026
@111blackeagle111

Copy link
Copy Markdown
Contributor Author

Thanks, @fmartinou . I really enjoyed working with you on this PR. I appreciated how friendly and professional you were throughout the review. I hope we get to work together again on another PR and if you ever need a hand with a bug, I’m happy to help.

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.

2 participants