houston 버전 관리

This commit is contained in:
2023-06-29 12:05:11 +09:00
parent a8821b694b
commit 02db65e06f
5 changed files with 90 additions and 76 deletions

View File

@ -149,8 +149,9 @@ func gatherDeployedPrograms(storageRoot, name string) []*protos.VersionAndArgs {
if ver.IsDir() {
args := lastExecutionArgs(path.Join(targetPath, ver.Name()))
rawvers = append(rawvers, &protos.VersionAndArgs{
Version: ver.Name(),
Args: args,
Version: ver.Name(),
Args: args,
Readonly: false,
})
}
}
@ -164,25 +165,33 @@ func gatherDeployedPrograms(storageRoot, name string) []*protos.VersionAndArgs {
}
func (hc *houstonClient) makeOperationQueryRequest() *protos.OperationQueryRequest {
procs := make([]*protos.ProcessDescription, 0, len(hc.childProcs)+1)
var procs []*protos.ProcessDescription
var deploys []*protos.DeployedVersions
var selfname string
var selfargs []string
if hc.standalone {
procs = append(procs, &protos.ProcessDescription{
Name: os.Args[0],
Args: os.Args[1:],
Version: hc.version,
State: protos.ProcessState_Running,
Pid: int32(os.Getpid()),
})
selfname = path.Base(os.Args[0])
selfargs = os.Args[1:]
} else {
procs = append(procs, &protos.ProcessDescription{
Name: "houston",
Args: []string{},
Version: hc.version,
State: protos.ProcessState_Running,
Pid: int32(os.Getpid()),
})
selfname = "houston"
selfargs = []string{}
}
procs = append(procs, &protos.ProcessDescription{
Name: selfname,
Args: selfargs,
Version: hc.version,
State: protos.ProcessState_Running,
Pid: int32(os.Getpid()),
})
deploys = append(deploys, &protos.DeployedVersions{
Name: selfname,
Versions: []*protos.VersionAndArgs{
{Version: hc.version, Args: selfargs, Readonly: true},
},
})
for _, child := range hc.childProcs {
procs = append(procs, &protos.ProcessDescription{
Name: child.name,
@ -193,13 +202,13 @@ func (hc *houstonClient) makeOperationQueryRequest() *protos.OperationQueryReque
})
}
var deploys []*protos.DeployedVersions
for name, prog := range hc.deploys {
deploys = append(deploys, &protos.DeployedVersions{
Name: name,
Versions: prog,
})
}
hn, _ := os.Hostname()
return &protos.OperationQueryRequest{
Hostname: hn,