mirror of
https://github.com/distribution/distribution.git
synced 2025-06-28 00:08:48 +00:00
fix: load gcs credentials and client inside DriverConstructor (#4218)
This commit is contained in:
commit
14366a2dff
@ -34,6 +34,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcsDriverConstructor = func(rootDirectory string) (storagedriver.StorageDriver, error) {
|
||||||
jsonKey, err := os.ReadFile(credentials)
|
jsonKey, err := os.ReadFile(credentials)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("Error reading JSON key : %v", err))
|
panic(fmt.Sprintf("Error reading JSON key : %v", err))
|
||||||
@ -67,7 +68,6 @@ func init() {
|
|||||||
panic(fmt.Sprintf("Error initializing gcs client : %v", err))
|
panic(fmt.Sprintf("Error initializing gcs client : %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
gcsDriverConstructor = func(rootDirectory string) (storagedriver.StorageDriver, error) {
|
|
||||||
parameters := driverParameters{
|
parameters := driverParameters{
|
||||||
bucket: bucket,
|
bucket: bucket,
|
||||||
rootDirectory: rootDirectory,
|
rootDirectory: rootDirectory,
|
||||||
|
Loading…
Reference in New Issue
Block a user