File tree 1 file changed +15
-2
lines changed
_template/mapper/configmap
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ import (
23
23
24
24
"k8s.io/klog/v2"
25
25
26
- "github.com/kubeedge/mappers-go/mappers/common"
27
26
"github.com/kubeedge/mappers-go/mappers/Template/globals"
27
+ "github.com/kubeedge/mappers-go/mappers/common"
28
28
)
29
29
30
30
// Parse parse the configmap.
@@ -57,8 +57,21 @@ func Parse(path string,
57
57
return err
58
58
}
59
59
60
- if instance .PProtocol .Protocol != "Template " {
60
+ if instance .PProtocol .Protocol != "customized-protocol " {
61
61
continue
62
+ } else {
63
+ cprotocol := struct {
64
+ ProtocolName string `json:"protocolName"`
65
+ ConfigData json.RawMessage
66
+ }{}
67
+ err = json .Unmarshal (instance .PProtocol .ProtocolConfigs , & cprotocol )
68
+ if err != nil {
69
+ klog .Error ("customized-protocol unmarshal error:" , err )
70
+ continue
71
+ }
72
+ if cprotocol .ProtocolName != "Template" {
73
+ continue
74
+ }
62
75
}
63
76
64
77
for k := 0 ; k < len (instance .PropertyVisitors ); k ++ {
You can’t perform that action at this time.
0 commit comments