I have a question about the answers in CKA: in the question Vote List the InternalIP of all nodes in the cluster

the MOCK EXAM answer is:
Check the following using jsonpath:
kubectl get nodes -o jsonpath=‘{.items[*].status.addresses[?(@.type==“InternalIP”)].address}’ > /root/CKA/node_ips

I ask, am I obliged to put one IP next to the other with space between the IPs or can I put \n after each IP?

I would use the following answer:
kubectl get nodes -o wide | awk 'NR>1 { print $6} ’

Would it be wrong because I put \n ? I always had this doubt.

thanks

For purposes of the mock exam, you’ll probably want to leave all the answers as your jsponpath expression wants to put them; the grader is expecting that if I recall correctly.

If it’s for your own purposes, you can of course reformat the data any way you like; awk is a fine way to do that.