Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 部署管理器更新错误:预览中的部署不能有更新的目标_Google Cloud Platform_Google Deployment Manager - Fatal编程技术网

Google cloud platform 部署管理器更新错误:预览中的部署不能有更新的目标

Google cloud platform 部署管理器更新错误:预览中的部署不能有更新的目标,google-cloud-platform,google-deployment-manager,Google Cloud Platform,Google Deployment Manager,每次尝试通过部署管理器对预览中的现有部署运行更新时,都会出现以下错误: $ gcloud deployment-manager deployments update abc --config abc.yaml ERROR: (gcloud.deployment-manager.deployments.update) ResponseError: code=400, message=Invalid value for field 'resource.target': ''. Deployment

每次尝试通过部署管理器对预览中的现有部署运行更新时,都会出现以下错误:

$ gcloud deployment-manager deployments update abc --config abc.yaml
ERROR: (gcloud.deployment-manager.deployments.update) ResponseError: code=400, message=Invalid value for field 'resource.target': ''.  Deployment in preview must not have a target with UPDATE
但是,如果我不使用gcloud命令行上的更新并转到控制台并单击“部署”,则更新将正常进行


这是什么原因造成的?

这是我们这边的问题。我们目前正在进行修复;我目前无法提供修复的预计到达时间。我强烈建议继续使用通过控制台部署找到的解决方法。

取消预览,然后再次运行部署更新

gcloud deployment-manager deployments cancel-preview DEPLOYMENT

对我来说,问题在于,我调用了更新API,以便使用第一次创建预览时传递的完整
body
参数应用预览

修复方法是只传递preview apply调用的
body
参数中的
fingerprint
name
属性

project_name = '...'
deployment_name = '...'

existing_deployment = service.deployments().get(
    project=project_name,
    deployment=deployment_name).execute()

service.deployments().update(
    project=project_name,
    deployment=deployment_name,
    body={
        'name': deployment_name,
        'fingerprint': existing_deployment["fingerprint"],
    },
    preview=False).execute()

刚碰到这件事,我没有按照指示去做。在预览中创建某些内容后,不再传递配置,只需应用即可

创建预览

gcloud deployment-manager deployments update my-deployment --config my-config.yaml --preview
运行部署

gcloud deployment-manager deployments update my-deployment
文件

这一次有什么更新吗?我也经历过这种情况,这看起来像是很容易遇到的问题,这实际上更有意义。但我发誓一年前我研究这个的时候,文档不在那里。谢谢