Coder
Coder

Reputation: 157

curl command not reading the file properly

I am performing curl like below from the Azure pipeline.

kubectl exec ${podName} -- curl -w "@test.txt" -vik --resolve ${{ parameters.DomainPrimary }}:443:$IPPrimary ${APP_ENDPOINT}

my test.txt contains data like

            time_namelookup:  %{time_namelookup}\n
            time_connect:  %{time_connect}\n
            time_appconnect:  %{time_appconnect}\n
            time_pretransfer:  %{time_pretransfer}\n
            time_redirect:  %{time_redirect}\n
            time_starttransfer:  %{time_starttransfer}\n
                    ----------\n
            time_total:  %{time_total}\n
Warning: Failed to read test.txt*

I wanted to print all the time related info for the curl call. Any inputs could be helpful

Locally from my ubuntu shell curl call works fine as with response it will print the time info

Upvotes: 0

Views: 99

Answers (1)

Dou Xu-MSFT
Dou Xu-MSFT

Reputation: 3231

use kubectl command to get the file lists or directory in your pod.

  kubectl exec  [your pod name]  -- ls

Check the result. If it does not exist, use cp command to copy files to a pod.

  kubectl cp test.txt  mypod:/path/

Test in my pod with bash, it works.

result

Upvotes: 1

Related Questions