You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Cloud Run服务替换YAML定义失败(Windows环境问题)

Cloud Run服务替换命令在Windows环境报错问题

更新:已定位该问题仅出现在Windows环境中,如VS Code或Git Shell。

我们尝试执行以下操作:

  • 将当前Cloud Run服务导出为YAML文件
  • 修改其中一个参数
  • 使用更新后的YAML文件替换原服务

导出命令执行正常:
gcloud run services describe myservice --region=us-central1 --format=export > service1.yaml

生成的YAML文件结构简洁,我们修改了内存配置部分:

- containerPort: 8080
   name: http1
resources:
  limits:
   cpu: 1000m
   memory: 256M

但执行替换命令:
gcloud run services replace ./service1.yaml

时出现如下错误:

错误:(gcloud.run.services.replace) 参数 FILE:无效的 <googlecloudsdk.calliope.arg_parsers.YAMLFileContents object at 0x000001B77074DCD0> 值:'.\\service1.yaml'
用法:gcloud run services replace FILE [可选标志]
  可选标志包括: --async | --cluster | --cluster-location | --context |
                         --help | --kubeconfig | --namespace | --platform |
                         --region

如需了解此命令及其标志的详细信息,请运行:
  gcloud run services replace --help

内容的提问来源于stack exchange,提问作者Pentium10

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.30 20:55:04