Skip to content

Commit cb5b661

Browse files
authored
Add deployment trace model encode/decode logic for MySQL datastore (#5651)
Signed-off-by: khanhtc1202 <[email protected]>
1 parent 16089a9 commit cb5b661

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/datastore/mysql/model_wrapper.go

+13
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ func wrapModel(entity interface{}) (interface{}, error) {
9292
DeploymentChain: *e,
9393
Extra: e.Id,
9494
}, nil
95+
case *model.DeploymentTrace:
96+
if e == nil {
97+
return nil, fmt.Errorf("nil entity given")
98+
}
99+
return &deploymentTrace{
100+
DeploymentTrace: *e,
101+
Extra: e.Id,
102+
}, nil
95103
default:
96104
return nil, fmt.Errorf("%T is not supported", e)
97105
}
@@ -152,3 +160,8 @@ type deploymentChain struct {
152160
model.DeploymentChain `json:",inline"`
153161
Extra string `json:"_extra"`
154162
}
163+
164+
type deploymentTrace struct {
165+
model.DeploymentTrace `json:",inline"`
166+
Extra string `json:"_extra"`
167+
}

0 commit comments

Comments
 (0)