Code Review
/
src
/
xds
/
xds-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add Server UUID and use it build CmdID.
[src/xds/xds-server.git]
/
lib
/
apiv1
/
exec.go
diff --git
a/lib/apiv1/exec.go
b/lib/apiv1/exec.go
index
fd0f8bb
..
0167196
100644
(file)
--- a/
lib/apiv1/exec.go
+++ b/
lib/apiv1/exec.go
@@
-19,7
+19,8
@@
type (
// ExecArgs JSON parameters of /exec command
ExecArgs struct {
ID string `json:"id" binding:"required"`
// ExecArgs JSON parameters of /exec command
ExecArgs struct {
ID string `json:"id" binding:"required"`
- SdkID string `json:"sdkid"` // sdk ID to use for setting env
+ SdkID string `json:"sdkID"` // sdk ID to use for setting env
+ CmdID string `json:"cmdID"` // command unique ID
Cmd string `json:"cmd" binding:"required"`
Args []string `json:"args"`
Env []string `json:"env"`
Cmd string `json:"cmd" binding:"required"`
Args []string `json:"args"`
Env []string `json:"env"`
@@
-168,11
+169,13
@@
func (s *APIService) execCmd(c *gin.Context) {
}
// Unique ID for each commands
}
// Unique ID for each commands
- cmdID := strconv.Itoa(execCommandID)
- execCommandID++
+ if args.CmdID == "" {
+ args.CmdID = s.cfg.ServerUID[:18] + "_" + strconv.Itoa(execCommandID)
+ execCommandID++
+ }
// Create new execution over WS context
// Create new execution over WS context
- execWS := eows.New(strings.Join(cmd, " "), cmdArgs, sop, sess.ID,
c
mdID)
+ execWS := eows.New(strings.Join(cmd, " "), cmdArgs, sop, sess.ID,
args.C
mdID)
execWS.Log = s.log
// Append client project dir to environment
execWS.Log = s.log
// Append client project dir to environment