Skip to content

Entry metadata field#749

Merged
crazy-max merged 2 commits intomasterfrom
entry-metadata
Dec 29, 2022
Merged

Entry metadata field#749
crazy-max merged 2 commits intomasterfrom
entry-metadata

Conversation

@crazy-max
Copy link
Owner

fixes #479
fixes #654

Provides new field {{ .Entry.Metadata }} that returns additional metadata with defaults depending on the provider. User can also add arbitrary metadata through diun.metadata.* labels/annotations like diun.metadata.foo=bar.

Example with mail notifier:

notif:
  mail:
    host: localhost
    port: 25
    ssl: false
    insecureSkipVerify: false
    from: diun@example.com
    to:
      - webmaster@example.com
    templateBody: |
      Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.

      {{ range $key, $value := .Entry.Metadata }}
      * `{{ $key }}`: `{{ $value }}`
      {{- end }}

image

Webhook notifier:

{
  "diun_version": "4.24.0",
  "hostname": "myserver",
  "status": "new",
  "provider": "file",
  "image": "docker.io/crazymax/diun:latest",
  "hub_link": "https://hub.docker.com/r/crazymax/diun",
  "mime_type": "application/vnd.docker.distribution.manifest.list.v2+json",
  "digest": "sha256:216e3ae7de4ca8b553eb11ef7abda00651e79e537e85c46108284e5e91673e01",
  "created": "2020-03-26T12:23:56Z",
  "platform": "linux/amd64",
  "metadata": {
    "ctn_command": "diun serve",
    "ctn_createdat": "2022-12-29 10:22:15 +0100 CET",
    "ctn_id": "0dbd10e15b31add2c48856fd34451adabf50d276efa466fe19a8ef5fbd87ad7c",
    "ctn_names": "diun",
    "ctn_size": "0B",
    "ctn_state": "running",
    "ctn_status": "Up Less than a second (health: starting)"
  }
}

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.

Provide source url for notifications Expand notification template to allow container names

1 participant