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

Templating: allow to transform json text to object #166

Open
diorcety opened this issue Mar 13, 2024 · 1 comment
Open

Templating: allow to transform json text to object #166

diorcety opened this issue Mar 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@diorcety
Copy link

diorcety commented Mar 13, 2024

A custom annotation or label with json as text should be allow to transform to object.
For example

[
  {
    "annotations": {
      "summary": "Instance instance1 has been down for more than 5 minutes",
      "data": "{\"field1\": \"value1\"}"
    },
    "labels": {
      "instance": "instance1"
    },
    "startsAt": "2024-03-12T14:09:43.689Z"
  }]

we should be allowed to do something like that in template:

{{ range (data .Annotations.data).SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}

@diorcety
Copy link
Author

diorcety@c36cf12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants