mirror of
https://github.com/kopia/kopia.git
synced 2026-05-09 15:23:02 -04:00
chore(providers): warn messages for extra storage providers (#5324)
Add warnings for unsupported, not actively tested and not maintained providers
This commit is contained in:
@@ -330,12 +330,12 @@ func NewApp() *App {
|
||||
{"from-config", "the provided configuration file", func() StorageFlags { return &storageFromConfigFlags{} }},
|
||||
|
||||
{"azure", "an Azure blob storage", func() StorageFlags { return &storageAzureFlags{} }},
|
||||
{"b2", "a B2 bucket", func() StorageFlags { return &storageB2Flags{} }},
|
||||
{"b2", "a B2 bucket [DEPRECATED]", func() StorageFlags { return &storageB2Flags{} }},
|
||||
{"filesystem", "a filesystem", func() StorageFlags { return &storageFilesystemFlags{} }},
|
||||
{"gcs", "a Google Cloud Storage bucket", func() StorageFlags { return &storageGCSFlags{} }},
|
||||
{"gdrive", "a Google Drive folder", func() StorageFlags { return &storageGDriveFlags{} }},
|
||||
{"gdrive", "a Google Drive folder [Not maintained]", func() StorageFlags { return &storageGDriveFlags{} }},
|
||||
|
||||
{"rclone", "a rclone-based provided", func() StorageFlags { return &storageRcloneFlags{} }},
|
||||
{"rclone", "a rclone-based provider [Not maintained]", func() StorageFlags { return &storageRcloneFlags{} }},
|
||||
{"s3", "an S3 bucket", func() StorageFlags { return &storageS3Flags{} }},
|
||||
{"sftp", "an SFTP storage", func() StorageFlags { return &storageSFTPFlags{} }},
|
||||
{"webdav", "a WebDAV storage", func() StorageFlags { return &storageWebDAVFlags{} }},
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"github.com/kopia/kopia/internal/timestampmeta"
|
||||
"github.com/kopia/kopia/repo/blob"
|
||||
"github.com/kopia/kopia/repo/blob/retrying"
|
||||
"github.com/kopia/kopia/repo/logging"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -24,6 +25,8 @@
|
||||
timeMapKey = "kopia-mtime" // case is important, must be all-lowercase
|
||||
)
|
||||
|
||||
var log = logging.Module("b2")
|
||||
|
||||
type b2Storage struct {
|
||||
Options
|
||||
blob.DefaultProviderImplementation
|
||||
@@ -247,7 +250,9 @@ func (s *b2Storage) String() string {
|
||||
}
|
||||
|
||||
// New creates new B2-backed storage with specified options.
|
||||
func New(_ context.Context, opt *Options, isCreate bool) (blob.Storage, error) {
|
||||
func New(ctx context.Context, opt *Options, isCreate bool) (blob.Storage, error) {
|
||||
log(ctx).Warn("The B2 storage provider is deprecated and will be removed in the future, use the S3-compatible storage provider instead")
|
||||
|
||||
_ = isCreate
|
||||
|
||||
if opt.BucketName == "" {
|
||||
|
||||
@@ -547,6 +547,8 @@ func CreateDriveService(ctx context.Context, opt *Options) (*drive.Service, erro
|
||||
func New(ctx context.Context, opt *Options, isCreate bool) (blob.Storage, error) {
|
||||
_ = isCreate
|
||||
|
||||
log(ctx).Warn("The GDrive storage provider is not actively tested, it may cause data loss, use at your own risk")
|
||||
|
||||
if opt.FolderID == "" {
|
||||
return nil, errors.New("folder-id must be specified")
|
||||
}
|
||||
|
||||
@@ -248,6 +248,8 @@ func (r *rcloneStorage) runRCloneAndWaitForServerAddress(ctx context.Context, c
|
||||
//
|
||||
//nolint:funlen
|
||||
func New(ctx context.Context, opt *Options, isCreate bool) (blob.Storage, error) {
|
||||
log(ctx).Warn("The rclone storage provider is not actively tested, it may cause data loss, use at your own risk")
|
||||
|
||||
// generate directory for all temp files.
|
||||
td, err := os.MkdirTemp("", "kopia-rclone")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user