I want a string list of container repository names instead of structured objects #113
-
cnquery> k8s.pods { containers { containerImage.repository.fullName}}
k8s.pods: [
0: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/coredns/coredns"
}
]
}
1: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/etcd"
}
]
}
2: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/kube-apiserver"
}
]
}
3: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/kube-controller-manager"
}
]
}
4: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/kube-proxy"
}
]
}
5: {
containers: [
0: {
containerImage.repository.fullName: "k8s.gcr.io/kube-scheduler"
}
]
}
6: {
containers: [
0: {
containerImage.repository.fullName: "gcr.io/k8s-minikube/storage-provisioner"
}
]
}
] |
Beta Was this translation helpful? Give feedback.
Answered by
chris-rock
Sep 27, 2022
Replies: 1 comment
-
We have a 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: [
0: "k8s.gcr.io/kube-proxy"
]
}
5: {
name: "kube-scheduler-minikube"
containers.map: [
0: "k8s.gcr.io/kube-scheduler"
]
}
6: {
name: "storage-provisioner"
containers.map: [
0: "gcr.io/k8s-minikube/storage-provisioner"
]
}
]
|
Beta Was this translation helpful? Give feedback.
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
We have a
map
function in MQL available that allows you to only select one field and flatten the list: