Skip to content

I want a string list of container repository names instead of structured objects #113

Closed Answered by chris-rock
chris-rock asked this question in Q&A
Discussion options

You must be logged in to vote

We have a map function in MQL available that allows you to only select one field and flatten the list:

cnquery> k8s.pods { name containers.map( containerImage.repository.fullName)}
k8s.pods: [
  0: {
    name: "coredns-64897985d-55mbw"
    containers.map: [
      0: "k8s.gcr.io/coredns/coredns"
    ]
  }
  1: {
    name: "etcd-minikube"
    containers.map: [
      0: "k8s.gcr.io/etcd"
    ]
  }
  2: {
    name: "kube-apiserver-minikube"
    containers.map: [
      0: "k8s.gcr.io/kube-apiserver"
    ]
  }
  3: {
    name: "kube-controller-manager-minikube"
    containers.map: [
      0: "k8s.gcr.io/kube-controller-manager"
    ]
  }
  4: {
    name: "kube-proxy-gpp86"
    containers.map: […

Replies: 1 comment

Comment options

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