Skip to content

k8s remap #14777

Answered by panpan-wu
panpan-wu asked this question in Q&A
Discussion options

You must be logged in to vote

change

      app_name =
        get(.k8s.pod_labels, path: ["app"]) ??
        get!(.k8s.pod_labels, path: ["app.kubernetes.io/name"])

to

      app_name = .k8s.pod_labels.app
      if app_name == null {
        app_name = .k8s.pod_labels."app.kubernetes.io/name"
      }
      if app_name == null {
        app_name = "default"
      }

It works

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by panpan-wu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant