add support for gcs

This commit is contained in:
Pierig Le Saux
2026-03-27 19:57:25 -04:00
committed by André Roth
parent 9bb8de68d0
commit ed4af9a0f6
10 changed files with 694 additions and 1 deletions
+16
View File
@@ -62,6 +62,7 @@ type ConfigStructure struct { // nolint: maligned
// Storage
FileSystemPublishRoots map[string]FileSystemPublishRoot `json:"FileSystemPublishEndpoints" yaml:"filesystem_publish_endpoints"`
S3PublishRoots map[string]S3PublishRoot `json:"S3PublishEndpoints" yaml:"s3_publish_endpoints"`
GCSPublishRoots map[string]GCSPublishRoot `json:"GcsPublishEndpoints" yaml:"gcs_publish_endpoints"`
SwiftPublishRoots map[string]SwiftPublishRoot `json:"SwiftPublishEndpoints" yaml:"swift_publish_endpoints"`
AzurePublishRoots map[string]AzureEndpoint `json:"AzurePublishEndpoints" yaml:"azure_publish_endpoints"`
PackagePoolStorage PackagePoolStorage `json:"packagePoolStorage" yaml:"packagepool_storage"`
@@ -189,6 +190,20 @@ type S3PublishRoot struct {
Debug bool `json:"debug" yaml:"debug"`
}
// GCSPublishRoot describes single GCS publishing entry point
type GCSPublishRoot struct {
Bucket string `json:"bucket" yaml:"bucket"`
Prefix string `json:"prefix" yaml:"prefix"`
CredentialsFile string `json:"credentialsFile" yaml:"credentials_file"`
ServiceAccountJSON string `json:"serviceAccountJSON" yaml:"service_account_json"`
Project string `json:"project" yaml:"project"`
ACL string `json:"acl" yaml:"acl"`
StorageClass string `json:"storageClass" yaml:"storage_class"`
EncryptionKey string `json:"encryptionKey" yaml:"encryption_key"`
DisableMultiDel bool `json:"disableMultiDel" yaml:"disable_multidel"`
Debug bool `json:"debug" yaml:"debug"`
}
// SwiftPublishRoot describes single OpenStack Swift publishing entry point
type SwiftPublishRoot struct {
Container string `json:"container" yaml:"container"`
@@ -239,6 +254,7 @@ var Config = ConfigStructure{
PpaBaseURL: "http://ppa.launchpad.net",
FileSystemPublishRoots: map[string]FileSystemPublishRoot{},
S3PublishRoots: map[string]S3PublishRoot{},
GCSPublishRoots: map[string]GCSPublishRoot{},
SwiftPublishRoots: map[string]SwiftPublishRoot{},
AzurePublishRoots: map[string]AzureEndpoint{},
AsyncAPI: false,
+30
View File
@@ -49,6 +49,9 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
Region: "us-east-1",
Bucket: "repo"}}
s.config.GCSPublishRoots = map[string]GCSPublishRoot{"test": {
Bucket: "repo"}}
s.config.SwiftPublishRoots = map[string]SwiftPublishRoot{"test": {
Container: "repo"}}
@@ -132,6 +135,20 @@ func (s *ConfigSuite) TestSaveConfig(c *C) {
" \"debug\": false\n" +
" }\n" +
" },\n" +
" \"GcsPublishEndpoints\": {\n" +
" \"test\": {\n" +
" \"bucket\": \"repo\",\n" +
" \"prefix\": \"\",\n" +
" \"credentialsFile\": \"\",\n" +
" \"serviceAccountJSON\": \"\",\n" +
" \"project\": \"\",\n" +
" \"acl\": \"\",\n" +
" \"storageClass\": \"\",\n" +
" \"encryptionKey\": \"\",\n" +
" \"disableMultiDel\": false,\n" +
" \"debug\": false\n" +
" }\n" +
" },\n" +
" \"SwiftPublishEndpoints\": {\n" +
" \"test\": {\n" +
" \"container\": \"repo\",\n" +
@@ -275,6 +292,7 @@ func (s *ConfigSuite) TestSaveYAML2Config(c *C) {
"skip_bz2_publishing: false\n" +
"filesystem_publish_endpoints: {}\n" +
"s3_publish_endpoints: {}\n" +
"gcs_publish_endpoints: {}\n" +
"swift_publish_endpoints: {}\n" +
"azure_publish_endpoints: {}\n" +
"packagepool_storage:\n" +
@@ -352,6 +370,18 @@ s3_publish_endpoints:
force_sigv2: true
force_virtualhosted_style: true
debug: true
gcs_publish_endpoints:
test:
bucket: gcs-bucket
prefix: pre-gcs
credentials_file: /tmp/creds.json
service_account_json: '{"type":"service_account"}'
project: test-project
acl: public-read
storage_class: STANDARD
encryption_key: "12345678901234567890123456789012"
disable_multidel: true
debug: true
swift_publish_endpoints:
test:
container: c1