From 0d7e303809412f1c7339aa6d54d5130089b9556a Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Wed, 25 Jan 2023 15:07:59 +0100 Subject: [PATCH] Chore: Keeping the list of plugin executable complete (#60840) * Keeping the list of executable complete * Update pkg/plugins/storage/fs.go Co-authored-by: Will Browne Co-authored-by: Will Browne --- pkg/plugins/storage/fs.go | 2 +- pkg/plugins/storage/fs_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/plugins/storage/fs.go b/pkg/plugins/storage/fs.go index 302305a1196..e1bf0b99163 100644 --- a/pkg/plugins/storage/fs.go +++ b/pkg/plugins/storage/fs.go @@ -220,7 +220,7 @@ func isSymlinkRelativeTo(basePath string, symlinkDestPath string, symlinkOrigPat func extractFile(file *zip.File, filePath string) (err error) { fileMode := file.Mode() // This is entry point for backend plugins so we want to make them executable - if strings.HasSuffix(filePath, "_linux_amd64") || strings.HasSuffix(filePath, "_darwin_amd64") { + if strings.HasSuffix(filePath, "_linux_amd64") || strings.HasSuffix(filePath, "_linux_arm") || strings.HasSuffix(filePath, "_linux_arm64") || strings.HasSuffix(filePath, "_darwin_amd64") || strings.HasSuffix(filePath, "_darwin_arm64") || strings.HasSuffix(filePath, "_windows_amd64.exe") { fileMode = os.FileMode(0755) } diff --git a/pkg/plugins/storage/fs_test.go b/pkg/plugins/storage/fs_test.go index 044bb0ede12..e55e69842e2 100644 --- a/pkg/plugins/storage/fs_test.go +++ b/pkg/plugins/storage/fs_test.go @@ -157,7 +157,7 @@ func TestExtractFiles(t *testing.T) { // File in zip has permission 644 fileInfo, err = os.Stat(pluginsDir + "/grafana-simple-json-datasource/simple-plugin_windows_amd64.exe") require.NoError(t, err) - require.Equal(t, "-rw-r--r--", fileInfo.Mode().String()) + require.Equal(t, "-rwxr-xr-x", fileInfo.Mode().String()) // File in zip has permission 755 fileInfo, err = os.Stat(pluginsDir + "/grafana-simple-json-datasource/non-plugin-binary")