-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add azure storage account support
Signed-off-by: Jan-Otto Kröpke <[email protected]>
- Loading branch information
Showing
16 changed files
with
4,414 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{ | ||
"distSpecVersion": "1.1.0-dev", | ||
"storage": { | ||
"rootDirectory": "/tmp/zot", | ||
"dedupe": true, | ||
"storageDriver": { | ||
"name": "azure", | ||
"rootdirectory": "/zot", | ||
"container": "zot-storage", | ||
"accountname": "zot-storage", | ||
"accountkey": "azurite", | ||
"serviceurl": "http://localhost:10000" | ||
}, | ||
"subPaths": { | ||
"/a": { | ||
"rootDirectory": "/tmp/zot1", | ||
"dedupe": false, | ||
"storageDriver": { | ||
"name": "azure", | ||
"rootdirectory": "/zot-a", | ||
"container": "zot-storage", | ||
"accountname": "zot-storage", | ||
"accountkey": "azurite", | ||
"serviceurl": "http://localhost:10000" | ||
} | ||
}, | ||
"/b": { | ||
"rootDirectory": "/tmp/zot2", | ||
"dedupe": true, | ||
"remoteCache": false, | ||
"storageDriver": { | ||
"name": "azure", | ||
"rootdirectory": "/zot-b", | ||
"container": "zot-storage", | ||
"accountname": "zot-storage", | ||
"accountkey": "azurite", | ||
"serviceurl": "http://localhost:10000" | ||
} | ||
}, | ||
"/c": { | ||
"rootDirectory": "/tmp/zot3", | ||
"dedupe": true, | ||
"remoteCache": true, | ||
"storageDriver": { | ||
"name": "azure", | ||
"rootdirectory": "/zot-c", | ||
"container": "zot-storage", | ||
"accountname": "zot-storage", | ||
"accountkey": "azurite", | ||
"serviceurl": "http://localhost:10000" | ||
} | ||
} | ||
} | ||
}, | ||
"http": { | ||
"address": "127.0.0.1", | ||
"port": "8080" | ||
}, | ||
"log": { | ||
"level": "debug" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package azure | ||
|
||
import ( | ||
// Add s3 support. | ||
"github.com/distribution/distribution/v3/registry/storage/driver" | ||
// Load s3 driver. | ||
_ "github.com/distribution/distribution/v3/registry/storage/driver/azure" | ||
|
||
"zotregistry.dev/zot/pkg/extensions/monitoring" | ||
zlog "zotregistry.dev/zot/pkg/log" | ||
"zotregistry.dev/zot/pkg/storage/cache" | ||
common "zotregistry.dev/zot/pkg/storage/common" | ||
"zotregistry.dev/zot/pkg/storage/imagestore" | ||
storageTypes "zotregistry.dev/zot/pkg/storage/types" | ||
) | ||
|
||
// NewImageStore returns a new image store backed by cloud storages. | ||
// see https://github.com/docker/docker.github.io/tree/master/registry/storage-drivers | ||
// Use the last argument to properly set a cache database, or it will default to boltDB local storage. | ||
func NewImageStore(rootDir string, cacheDir string, dedupe, commit bool, log zlog.Logger, | ||
metrics monitoring.MetricServer, linter common.Lint, store driver.StorageDriver, cacheDriver cache.Cache, | ||
) storageTypes.ImageStore { | ||
return imagestore.NewImageStore( | ||
rootDir, | ||
cacheDir, | ||
dedupe, | ||
commit, | ||
log, | ||
metrics, | ||
linter, | ||
New(store), | ||
cacheDriver, | ||
) | ||
} |
Oops, something went wrong.