gcloud 属性 验证被跳过
gcloud Property validation was skipped
我正在使用 gcloud CLI 配置我的区域和地区:
gcloud config set compute/region us-central1
gcloud config set compute/zone us-central1-c
但是每个命令持续大约 15 秒,我收到警告:
WARNING: Property validation for compute/region was skipped
一切正常,但为什么我有 15 秒的延迟和警告?
使用详细参数,输出为:
DEBUG: Running [gcloud.config.set] with arguments: [--verbosity: "debug", SECTION/PROPERTY: "compute/region", VALUE: "us-central1"]
Updated property [compute/region].
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true
DEBUG: Starting new HTTP connection (1): metadata.google.internal:80
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true HTTP/1.1" 200 185
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token HTTP/1.1" 200 1050
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true
DEBUG: Starting new HTTP connection (1): metadata.google.internal:80
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true HTTP/1.1" 200 185
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token HTTP/1.1" 200 1050
DEBUG: Starting new HTTPS connection (1): compute.googleapis.com:443
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
WARNING: Property validation for compute/region was skipped.
为了使 gcloud 工具更易于使用,Google Cloud 将尝试验证提供的值,包括“compute/region”。在这种情况下,它必须从 API 中获取可用区域的完整列表。如果失败,无论出于何种原因,它都会显示此警告消息。
众多原因之一可能是计算引擎 API 未启用。也可能是缺少身份验证,尽管 Cloud Build 默认启用身份验证,并且您不需要任何特殊权限即可 运行 此命令。
要找出到底出了什么问题,您可以尝试将 --log-http 参数添加到您的 gcloud 命令行。这将显示与 API 的任何交互的完整详细信息,包括响应中的任何错误消息。
无论如何,这只是一个警告,配置条目仍在更新中。即使验证失败也会发生这种情况,例如该区域不存在。正如我上面提到的,这只是一个功能,可以帮助让用户知道他们是否犯了某些类型的简单错误。
我正在使用 gcloud CLI 配置我的区域和地区:
gcloud config set compute/region us-central1
gcloud config set compute/zone us-central1-c
但是每个命令持续大约 15 秒,我收到警告:
WARNING: Property validation for compute/region was skipped
一切正常,但为什么我有 15 秒的延迟和警告?
使用详细参数,输出为:
DEBUG: Running [gcloud.config.set] with arguments: [--verbosity: "debug", SECTION/PROPERTY: "compute/region", VALUE: "us-central1"]
Updated property [compute/region].
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true
DEBUG: Starting new HTTP connection (1): metadata.google.internal:80
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true HTTP/1.1" 200 185
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token HTTP/1.1" 200 1050
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true
DEBUG: Starting new HTTP connection (1): metadata.google.internal:80
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/?recursive=true HTTP/1.1" 200 185
DEBUG: Making request: GET http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token
DEBUG: http://metadata.google.internal:80 "GET /computeMetadata/v1/instance/service-accounts/GOOGLE_AACOUNT_REPLACED@cloudbuild.gserviceaccount.com/token HTTP/1.1" 200 1050
DEBUG: Starting new HTTPS connection (1): compute.googleapis.com:443
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
DEBUG: https://compute.googleapis.com:443 "POST /batch/compute/v1 HTTP/1.1" 200 None
WARNING: Property validation for compute/region was skipped.
为了使 gcloud 工具更易于使用,Google Cloud 将尝试验证提供的值,包括“compute/region”。在这种情况下,它必须从 API 中获取可用区域的完整列表。如果失败,无论出于何种原因,它都会显示此警告消息。
众多原因之一可能是计算引擎 API 未启用。也可能是缺少身份验证,尽管 Cloud Build 默认启用身份验证,并且您不需要任何特殊权限即可 运行 此命令。
要找出到底出了什么问题,您可以尝试将 --log-http 参数添加到您的 gcloud 命令行。这将显示与 API 的任何交互的完整详细信息,包括响应中的任何错误消息。
无论如何,这只是一个警告,配置条目仍在更新中。即使验证失败也会发生这种情况,例如该区域不存在。正如我上面提到的,这只是一个功能,可以帮助让用户知道他们是否犯了某些类型的简单错误。