Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1194 from kindermoumoute/lowercase_for_all
Browse files Browse the repository at this point in the history
Make plugin name not case sensitive
  • Loading branch information
candysmurf authored Sep 9, 2016
2 parents 9693452 + bd7ce23 commit dda8bab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions control/plugin/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"io"
"os/exec"
"path"
"strings"
"time"

log "github.com/Sirupsen/logrus"
Expand Down Expand Up @@ -146,6 +147,16 @@ func (e *ExecutablePlugin) Run(timeout time.Duration) (Response, error) {
// Kill the plugin if we failed to load it.
e.Kill()
}
lowerName := strings.ToLower(resp.Meta.Name)
if lowerName != resp.Meta.Name {
execLogger.WithFields(log.Fields{
"plugin-name": resp.Meta.Name,
"plugin-version": resp.Meta.Version,
"plugin-type": resp.Type.String(),
}).Warning("uppercase plugin name")
}
resp.Meta.Name = lowerName

return resp, err
}

Expand Down
4 changes: 4 additions & 0 deletions scheduler/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package scheduler

import (
"errors"
"strings"
"sync"

log "github.com/Sirupsen/logrus"
Expand Down Expand Up @@ -133,6 +134,7 @@ func convertProcessNode(pr []wmap.ProcessWorkflowMapNode) ([]*processNode, error
if p.Version < 1 {
p.Version = -1
}
p.Name = strings.ToLower(p.Name)
prNodes[i] = &processNode{
name: p.Name,
version: p.Version,
Expand All @@ -148,6 +150,7 @@ func convertProcessNode(pr []wmap.ProcessWorkflowMapNode) ([]*processNode, error
func convertPublishNode(pu []wmap.PublishWorkflowMapNode) ([]*publishNode, error) {
puNodes := make([]*publishNode, len(pu))
for i, p := range pu {

cdn, err := p.GetConfigNode()
if err != nil {
return nil, err
Expand All @@ -158,6 +161,7 @@ func convertPublishNode(pu []wmap.PublishWorkflowMapNode) ([]*publishNode, error
if p.Version < 1 {
p.Version = -1
}
p.Name = strings.ToLower(p.Name)
puNodes[i] = &publishNode{
name: p.Name,
version: p.Version,
Expand Down

0 comments on commit dda8bab

Please sign in to comment.