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

custom metadata with docker labels? #1008

Open
3 tasks done
nopoz opened this issue Oct 24, 2023 · 0 comments
Open
3 tasks done

custom metadata with docker labels? #1008

nopoz opened this issue Oct 24, 2023 · 0 comments

Comments

@nopoz
Copy link

nopoz commented Oct 24, 2023

Support guidelines

I've found a bug and checked that ...

  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Reading https://github.com/crazy-max/diun/blob/master/docs/providers/docker.md it would seem to indicate that customizing the predefined metadata fields or custom meta data fields are possible with docker labels. However, testing this myself I can't seem to get it to work which makes me think this isn't currently possible and/or I'm reading the doc wrong.

The context is that I would like to make my notification titles read "<app name>:<version> is available" to make them as easy to read with as little extra text as possible. The closest I can get is templateTitle: "{{ .Entry.Image.Path }}:{{ .Entry.Image.Tag }} is available which also includes the repo name like linuxserver/plex:version-1.32.5.7349-8f4248874 is available. I don't need the ""linuxserver" portion from the example and can get it from the notification body if I really need it.

Thanks!

Expected behaviour

customize metadata with docker labels as per the docker.md file

Actual behaviour

can't customize metadata with docker labels

Steps to reproduce

Steps I tried:

  1. modify the container diun.metadata.ctn_id with a label and reference it in a notification template with {{ .Meta.ID }} - no effect, it remains "diun".
  2. create a custom label with diun.metadata.foo and reference it in a notification template with {{ .Meta.foo }} which throws an error in the diun logs: Pushover notification failed error="cannot render notif title: template: title:1:8: executing \"title\" at <.Meta.foo>: can't evaluate field foo in type model.Meta"

Diun version

4.26

Docker info

Server Version: 24.0.6

Docker Compose config

No response

Logs

Pushover notification failed error="cannot render notif title: template: title:1:8: executing \"title\" at <.Meta.foo>: can't evaluate field foo in type model.Meta

Additional info

No response

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

No branches or pull requests

1 participant