错误权限被拒绝伪装谷歌云功能

时间:2018-08-15 09:34:45

标签: python google-cloud-platform google-cloud-functions google-authentication gitlab-ci-runner

我正在使用Google Cloud函数(运行时python),并使用gitlab CI Runner进行部署。不幸的是,当我启动部署阶段时,出现了一个错误:

以下是我为跑步者编写的代码:

deploy:
  stage: deploy
  image: google/cloud-sdk
  script:
    - apt-get update && apt-get --only-upgrade install kubectl google-cloud-sdk
    - apt-get install google-cloud-sdk
    - gcloud init
    - gcloud config set project $GCP_PROJECT_ID
    - gcloud config list
    - gcloud beta functions deploy ${FUNCTION_NAME} --memory ${MEMORY} --region ${REGION} --stage-bucket ${STAGE_BUCKET}  --runtime ${RUNTIME} --trigger-http

  <<: *tags_rlt

我得到以下输出:

$ gcloud config list
[component_manager]
disable_update_check = true
[core]
account = dfr-frer0gr-mdef0nsa@rdfrd.iam.gserviceaccount.com
disable_usage_reporting = true
project = rdfrd
[metrics]
environment = github_docker_image

Your active configuration is: [default]
$ gcloud beta functions deploy ${FUNCTION_NAME} --memory ${MEMORY} --region ${REGION} --stage-bucket ${STAGE_BUCKET}  --runtime ${RUNTIME} --trigger-http
ERROR: (gcloud.beta.functions.deploy) ResponseError: status=[403], code=[Forbidden], message=[The caller does not have permission]
ERROR: Job failed: command terminated with exit code 1

请问如何解决此问题

1 个答案:

答案 0 :(得分:0)

验证您的用户和服务帐户已分配的roles