[MM-54318] Add file storage information to support package (#24474)

* Reorder stats in support package struct

* Add file storage information to support package

* Add clusterID

* Change method name to DriverName

* Ordering

* Fix test
This commit is contained in:
Ben Schumacher
2023-09-06 09:21:25 +02:00
committed by GitHub
parent 4482ba0fd0
commit b2f36c7cdf
7 changed files with 182 additions and 61 deletions

View File

@@ -23,6 +23,7 @@ type ReadCloseSeeker interface {
}
type FileBackend interface {
DriverName() string
TestConnection() error
Reader(path string) (ReadCloseSeeker, error)

View File

@@ -68,6 +68,10 @@ func copyFile(src, dst string) (err error) {
return
}
func (b *LocalFileBackend) DriverName() string {
return driverLocal
}
func (b *LocalFileBackend) TestConnection() error {
f := bytes.NewReader([]byte("testingwrite"))
if _, err := writeFileLocally(f, filepath.Join(b.directory, TestFilePath)); err != nil {

View File

@@ -57,6 +57,20 @@ func (_m *FileBackend) CopyFile(oldPath string, newPath string) error {
return r0
}
// DriverName provides a mock function with given fields:
func (_m *FileBackend) DriverName() string {
ret := _m.Called()
var r0 string
if rf, ok := ret.Get(0).(func() string); ok {
r0 = rf()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// FileExists provides a mock function with given fields: path
func (_m *FileBackend) FileExists(path string) (bool, error) {
ret := _m.Called(path)

View File

@@ -184,6 +184,10 @@ func (b *S3FileBackend) s3New(isCloud bool) (*s3.Client, error) {
return s3Clnt, nil
}
func (b *S3FileBackend) DriverName() string {
return driverS3
}
func (b *S3FileBackend) TestConnection() error {
exists := true
var err error