Revert s3 path prefix normalization for plugins (#24184)
This reverts 0af0a4eff4. During the [implementation](https://github.com/mattermost/mattermost/pull/15910) we [discussed](https://github.com/mattermost/mattermost/pull/15910#issuecomment-705925227) fixing the underlying issue. When we did [fix](https://github.com/mattermost/mattermost/pull/15949) the underlying issue, we didn't revert these changes.
Revert it now to simplify the code.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
885802eae7
Коммит
d9edb84523
@@ -874,17 +874,7 @@ func (ch *Channels) getPluginsFromFolder() (map[string]*pluginSignaturePath, *mo
|
||||
|
||||
func (ch *Channels) getPluginsFromFilePaths(fileStorePaths []string) map[string]*pluginSignaturePath {
|
||||
pluginSignaturePathMap := make(map[string]*pluginSignaturePath)
|
||||
|
||||
fsPrefix := ""
|
||||
if *ch.cfgSvc.Config().FileSettings.DriverName == model.ImageDriverS3 {
|
||||
ptr := ch.cfgSvc.Config().FileSettings.AmazonS3PathPrefix
|
||||
if ptr != nil && *ptr != "" {
|
||||
fsPrefix = *ptr + "/"
|
||||
}
|
||||
}
|
||||
|
||||
for _, path := range fileStorePaths {
|
||||
path = strings.TrimPrefix(path, fsPrefix)
|
||||
if strings.HasSuffix(path, ".tar.gz") {
|
||||
id := strings.TrimSuffix(filepath.Base(path), ".tar.gz")
|
||||
helper := &pluginSignaturePath{
|
||||
@@ -896,7 +886,6 @@ func (ch *Channels) getPluginsFromFilePaths(fileStorePaths []string) map[string]
|
||||
}
|
||||
}
|
||||
for _, path := range fileStorePaths {
|
||||
path = strings.TrimPrefix(path, fsPrefix)
|
||||
if strings.HasSuffix(path, ".tar.gz.sig") {
|
||||
id := strings.TrimSuffix(filepath.Base(path), ".tar.gz.sig")
|
||||
if val, ok := pluginSignaturePathMap[id]; !ok {
|
||||
|
||||
Ссылка в новой задаче
Block a user