繁体   English   中英

curl 命令没有正确读取文件

[英]curl command not reading the file properly

我正在从 Azure 管道执行如下所示的 curl。

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

我的 test.txt 包含类似的数据

            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*

我想打印 curl 电话的所有时间相关信息。 任何输入都可能有帮助

在本地从我的 ubuntu shell curl 调用工作正常作为响应它会打印时间信息

使用 kubectl 命令获取 pod 中的文件列表或目录。

  kubectl exec  [your pod name]  -- ls

检查结果。 如果不存在,使用 cp 命令将文件复制到 pod 中。

  kubectl cp test.txt  mypod:/path/

使用 bash 在我的 pod 中测试,它有效。

结果

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM