Skip to content

Commit 6a21edb

Browse files
committed
[core] Implement version and instance information in GetFrameworkInfo
1 parent a1d0201 commit 6a21edb

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

core/server.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ import (
2929
"fmt"
3030
"runtime"
3131
"sort"
32+
"strconv"
3233
"time"
3334

35+
"github.com/AliceO2Group/Control/common/product"
3436
"github.com/AliceO2Group/Control/configuration"
3537
"github.com/AliceO2Group/Control/core/task"
3638
"github.com/AliceO2Group/Control/core/task/channel"
@@ -95,12 +97,25 @@ func (m *RpcServer) GetFrameworkInfo(context.Context, *pb.GetFrameworkInfoReques
9597
m.state.RLock()
9698
defer m.state.RUnlock()
9799

100+
maj, _ := strconv.ParseInt(product.VERSION_MAJOR, 10, 32)
101+
min, _ := strconv.ParseInt(product.VERSION_MINOR, 10, 32)
102+
pat, _ := strconv.ParseInt(product.VERSION_PATCH, 10, 32)
103+
98104
r := &pb.GetFrameworkInfoReply{
99105
FrameworkId: store.GetIgnoreErrors(m.fidStore)(),
100106
EnvironmentsCount: int32(len(m.state.environments.Ids())),
101107
TasksCount: int32(m.state.taskman.TaskCount()),
102108
State: m.state.sm.Current(),
103109
HostsCount: int32(m.state.taskman.AgentCache.Count()),
110+
InstanceName: m.state.config.instanceName,
111+
Version: &pb.Version{
112+
Major: int32(maj),
113+
Minor: int32(min),
114+
Patch: int32(pat),
115+
Build: product.BUILD,
116+
VersionStr: product.VERSION,
117+
ProductName: product.PRETTY_SHORTNAME,
118+
},
104119
}
105120
return r, nil
106121
}

0 commit comments

Comments
 (0)