Skip to content

pschmitt/plib.jq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

💒 plib.jq

This jq module includes a set of functions that are useful, to me, @pschmitt and maybe to you.

🔨 Installation

Grab ./plib.jq and put it in jq's include path.

🍧 Usage

kubectl get nodes -o json | jq -er -L "$PWD/plib.jq" \
  --argjson cols '[".metadata.name", ".metadata.labels"]' '
    import "plib" as p;
    .items[] | p::getallpaths()
  '

# Output
# {
#   "metadata.name": "mynode-001",
#   "metadata.labels": {
#     "beta.kubernetes.io/arch": "amd64",
#     "beta.kubernetes.io/os": "linux",
#     "kubernetes.io/arch": "amd64",
#     "kubernetes.io/hostname": "mynode-001",
#     "kubernetes.io/os": "linux"
#   }
# }