Add support for Google Cloud Service universe domain configuration

What does this MR do and why?

A customer needs support for Google Cloud Dedicated: https://cloud.google.com/sovereign-cloud?hl=en

This supports the universe_domain setting added in https://github.com/fog/fog-google/pull/652 and https://github.com/google/go-cloud/pull/3651.

References

Relates to https://gitlab.com/gitlab-org/gitlab/-/work_items/581881

How to set up and validate locally

We are still awaiting our test environment, but these changes should not affect existing Google Cloud users. You can validate that fog-google attempts to contact the domain specified in universe_domain. For example, on an Omnibus instance:

gitlab_rails['object_store']['enabled'] = true
gitlab_rails['object_store']['connection'] = { 
  'provider': 'Google', 'google_application_default' => true, 
  'google_project' => 'some-project', 
  'universe_domain' => 'testme.example.com' 
}

You can see this error:

 "exception.class": "Google::Apis::TransmissionError",
  "exception.message": "getaddrinfo: Name or service not known (iamcredentials.testme.example.com:443)",
  "exception.backtrace": [
    "httpclient (2.8.3) lib/httpclient/session.rb:625:in `rescue in create_socket'",
    "httpclient (2.8.3) lib/httpclient/session.rb:607:in `create_socket'",
    "httpclient (2.8.3) lib/httpclient/ssl_socket.rb:21:in `create_socket'",
    "httpclient (2.8.3) lib/httpclient/session.rb:752:in `block in connect'",
    "timeout (0.4.3) lib/timeout.rb:185:in `block in timeout'",
    "timeout (0.4.3) lib/timeout.rb:192:in `timeout'",
    "httpclient (2.8.3) lib/httpclient/session.rb:748:in `connect'",
    "httpclient (2.8.3) lib/httpclient/session.rb:511:in `query'",
    "httpclient (2.8.3) lib/httpclient/session.rb:177:in `query'",
    "httpclient (2.8.3) lib/httpclient.rb:1242:in `do_get_block'",
    "gitlab-labkit (1.1.3) lib/labkit/httpclient_publisher.rb:35:in `block in do_get_block'",
    "activesupport (7.2.3) lib/active_support/notifications.rb:210:in `block in instrument'",
    "activesupport (7.2.3) lib/active_support/notifications/instrumenter.rb:58:in `instrument'",
    "activesupport (7.2.3) lib/active_support/notifications.rb:210:in `instrument'",
    "gitlab-labkit (1.1.3) lib/labkit/httpclient_publisher.rb:32:in `do_get_block'",
    "httpclient (2.8.3) lib/httpclient.rb:1019:in `block in do_request'",
    "httpclient (2.8.3) lib/httpclient.rb:1133:in `protect_keep_alive_disconnected'",
    "httpclient (2.8.3) lib/httpclient.rb:1014:in `do_request'",
    "httpclient (2.8.3) lib/httpclient.rb:1104:in `follow_redirect'",
    "httpclient (2.8.3) lib/httpclient.rb:854:in `request'",
    "google-apis-core (0.18.0) lib/google/apis/core/http_command.rb:323:in `execute_once'",
    "google-apis-core (0.18.0) lib/google/apis/core/http_command.rb:131:in `block (2 levels) in do_retry'",
    "retriable (3.1.2) lib/retriable.rb:61:in `block in retriable'",
    "<internal:numeric>:237:in `times'",
    "retriable (3.1.2) lib/retriable.rb:56:in `retriable'",
    "google-apis-core (0.18.0) lib/google/apis/core/http_command.rb:128:in `block in do_retry'",
    "retriable (3.1.2) lib/retriable.rb:61:in `block in retriable'",
    "<internal:numeric>:237:in `times'",
    "retriable (3.1.2) lib/retriable.rb:56:in `retriable'",
    "google-apis-core (0.18.0) lib/google/apis/core/http_command.rb:118:in `do_retry'",
    "google-apis-core (0.18.0) lib/google/apis/core/http_command.rb:109:in `execute'",
    "google-apis-core (0.18.0) lib/google/apis/core/base_service.rb:507:in `execute_or_queue_command'",
    "google-apis-iamcredentials_v1 (0.24.0) lib/google/apis/iamcredentials_v1/service.rb:251:in `sign_service_account_blob'",
    "fog-google (1.29.1) lib/fog/google/storage/storage_json/real.rb:184:in `iam_signer'",
    "fog-google (1.29.1) lib/fog/google/storage/storage_json/real.rb:74:in `signature'",
    "fog-google (1.29.1) lib/fog/google/storage/storage_json/utils.rb:54:in `host_path_query'",
    "fog-google (1.29.1) lib/fog/google/storage/storage_json/utils.rb:14:in `https_url'",
    "fog-google (1.29.1) lib/fog/google/storage/storage_json/requests/get_object_https_url.rb:9:in `get_object_https_url'",
    "lib/object_storage/direct_upload.rb:162:in `get_url'",
    "lib/object_storage/direct_upload.rb:45:in `to_hash'",

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports

Loading