I'm trying to determine internal IP of a docker container and use that as an value in an yaml config file. The command for determining the IP is;
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' controller-control-plane
And, for editing the config in place, I'm using;
yq -i '.kubeslice.controller.endpoint = "https://<output_from_previous_command>:6443"' values.yaml
Now, if I want to use the 1st command as an argument like this;
yq '.kubeslice.controller.endpoint = "https://$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' controller-control-plane):6443"' values.yaml
Then the output is not coming as intended.
kubeslice:
controller:
loglevel: info
rbacResourcePrefix: kubeslice-rbac
projectnsPrefix: kubeslice
endpoint: https://$(docker inspect -f {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}} controller-control-plane):6443
How to do this correctly so that end point gets the correct IP value instead of the command string?