У нас есть политика, ограничивающая ресурсы для регионов ЕС.
Когда я пытаюсь выполнить облачную сборку, gcloud хочет создать корзину (gs: // [PROJECT_ID] _cloudbuild) для хранения промежуточных источников. Этот шаг завершается неудачно, поскольку используется местоположение по умолчанию ('us'):
"code": 412,
"message": "'us' violates constraint ‘constraints/gcp.resourceLocations’"
В качестве обходного пути я попытался передать существующее ведро, расположенное в допустимой области (используя --gcs-source-staging-dir), но я получил ту же ошибку.
Как это можно решить?
Здесь журналы HTTP:
$ gcloud --log-http builds submit --gcs-source-staging-dir gs://my-custom-bucket/staging \
--tag gcr.io/xxxxxxxxxx/quickstart-image .
=======================
==== request start ====
uri: https://www.googleapis.com/storage/v1/b?project=xxxxxxxxxx&alt=json
method: POST
== headers start ==
accept: application/json
content-type: application/json
== headers end ==
== body start ==
{"name": "my-custom-bucket"}
== body end ==
==== request end ====
---- response start ----
-- headers start --
server: UploadServer
status: 412
-- headers end --
-- body start --
{
"error": {
"errors": [
{
"domain": "global",
"reason": "conditionNotMet",
"message": "'us' violates constraint ‘constraints/gcp.resourceLocations’",
"locationType": "header",
"location": "If-Match"
}
],
"code": 412,
"message": "'us' violates constraint ‘constraints/gcp.resourceLocations’"
}
}
-- body end --
---- response end ----
----------------------
ERROR: (gcloud.builds.submit) HTTPError 412: 'us' violates constraint ‘constraints/gcp.resourceLocations’