summaryrefslogtreecommitdiff
path: root/plugins/jobs/pipeline/pipeline.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-20 13:49:58 +0300
committerValery Piashchynski <[email protected]>2021-08-20 13:49:58 +0300
commitd7d753a625764df61adc56f778e6b9fa846851c5 (patch)
tree304fa88ce4e92a0af0524af522fa7a294203d89b /plugins/jobs/pipeline/pipeline.go
parent7c155577ee9f7a4c19bd8aa04d7b44f908f0b5e7 (diff)
Fix sqs maps parsing
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/pipeline/pipeline.go')
-rw-r--r--plugins/jobs/pipeline/pipeline.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/jobs/pipeline/pipeline.go b/plugins/jobs/pipeline/pipeline.go
index 2f4671d3..8a8c1462 100644
--- a/plugins/jobs/pipeline/pipeline.go
+++ b/plugins/jobs/pipeline/pipeline.go
@@ -1,5 +1,10 @@
package pipeline
+import (
+ json "github.com/json-iterator/go"
+ "github.com/spiral/roadrunner/v2/utils"
+)
+
// Pipeline defines pipeline options.
type Pipeline map[string]interface{}
@@ -68,14 +73,17 @@ func (p Pipeline) Bool(name string, d bool) bool {
// Map must return nested map value or empty config.
// Here might be sqs attributes or tags for example
-func (p Pipeline) Map(name string, out map[string]interface{}) {
+func (p Pipeline) Map(name string, out map[string]string) error {
if value, ok := p[name]; ok {
- if m, ok := value.(map[string]interface{}); ok {
- for k, v := range m {
- out[k] = v
+ if m, ok := value.(string); ok {
+ err := json.Unmarshal(utils.AsBytes(m), &out)
+ if err != nil {
+ return err
}
}
}
+
+ return nil
}
// Priority returns default pipeline priority