Plugins: Add metrics for fs + cloud provisioning info (#111030)
* add new metrics for plugin fs + cloud provisioning * fix test * update label
This commit is contained in:
@@ -30,6 +30,10 @@ func NewLocalFS(basePath string) LocalFS {
|
||||
return LocalFS{basePath: basePath}
|
||||
}
|
||||
|
||||
func (f LocalFS) Type() string {
|
||||
return "local"
|
||||
}
|
||||
|
||||
// fileIsAllowed takes an absolute path to a file and an os.FileInfo for that file, and it checks if access to that
|
||||
// file is allowed or not. Access to a file is allowed if the file is in the FS's Base() directory, and if it's a
|
||||
// symbolic link it should not end up outside the plugin's directory.
|
||||
@@ -215,6 +219,10 @@ func NewStaticFS(fs FS) (StaticFS, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f StaticFS) Type() string {
|
||||
return f.FS.Type()
|
||||
}
|
||||
|
||||
// Open checks that name is an allowed file and, if so, it returns a fs.File to access it, by calling the
|
||||
// underlying FS' Open() method.
|
||||
// If access is denied, the function returns ErrFileNotExist.
|
||||
|
||||
Reference in New Issue
Block a user