Update object storage consolidated configuration for the Google provider
🤔 What does this merge request do and why?
Due to Improve Google Cloud Storage support (&9457 - closed), when object is configured with:
- consolidated form
- provider set to
Google
Workhorse has to be configured to build its own object storage client. See this example.
GDK already do this for the two other providers: AWS and Azure. This MR adds support for Google.
Now, the Google provider has 3 ways to be configured:
- Using ADC.
- Pointing to the credentials json file.
- Dumping the contents of the credentials json file in the config file.
We can safely blindly support all 3 in parallel. If workhorse receives all 3 in its config file, it will try them one by one and the first that succeeds will be used. See this function.
⚙ How to set up and validate locally
Have a gdk.yml
file with:
object_store:
enabled: true
consolidated_form: true
connection:
provider: Google
google_project: "project"
google_application_default: true
google_json_key_location: "/dev/null/credentials.json"
google_json_key_string: |-
{
"multi_line": true,
"credentials": {
"foo": "bar"
}
}
1️⃣ With master
$ gdk reconfigure
- Check
gitlab/workhorse/config.toml
, you will get:
[object_storage]
provider = "Google"
This is not a valid Workhorse configuration and it will
2️⃣ With this MR
$ gdk reconfigure
- Check
gitlab/workhorse/config.toml
, you should see that it contains:
[object_storage]
provider = "Google"
[object_storage.google]
google_application_default = true
google_json_key_location = "/dev/null/credentials.json"
google_json_key_string = '''
{
"multi_line": true,
"credentials": {
"foo": "bar"
}
}
'''
📣 Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
🏁 Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by David Fernandez