Skip to content

several questions #1080

Answered by mikefarah
blastik asked this question in Q&A
Jan 24, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote
yq e '.ingress.hosts.[].http.paths.[].backend |= {"service": {"name": .serviceName, "port": {"name": .servicePort}}}' file.yaml
  • You got the LHS right - you need to update the backend element.
  • |= updates the backend node relative to itself (so on the right hand side it's set as the root context).
  • On the RHS create the desired 'service' map based on the 'backend' values.

Hope that makes sense!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mikefarah
Comment options

Answer selected by blastik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants