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:
Will Browne
2025-09-15 14:54:16 +01:00
committed by GitHub
parent 5b07d7031a
commit 2df39fc71a
15 changed files with 152 additions and 31 deletions
+8
View File
@@ -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.