forked from TrueCloudLab/frostfs-contract
[#99999] nns: Fix CM compatibility
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
48f06df25a
commit
16fd3243ab
2 changed files with 4 additions and 0 deletions
|
@ -239,6 +239,9 @@ func IsAvailable(name string) bool {
|
||||||
ctx := storage.GetReadOnlyContext()
|
ctx := storage.GetReadOnlyContext()
|
||||||
l := len(fragments)
|
l := len(fragments)
|
||||||
if storage.Get(ctx, append([]byte{prefixRoot}, []byte(fragments[l-1])...)) == nil {
|
if storage.Get(ctx, append([]byte{prefixRoot}, []byte(fragments[l-1])...)) == nil {
|
||||||
|
if l != 1 {
|
||||||
|
panic("panic should not happen")
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -588,6 +588,7 @@ func TestNNSIsAvailable(t *testing.T) {
|
||||||
c := newNNSInvoker(t, false)
|
c := newNNSInvoker(t, false)
|
||||||
|
|
||||||
c.Invoke(t, true, "isAvailable", "com")
|
c.Invoke(t, true, "isAvailable", "com")
|
||||||
|
c.InvokeFail(t, "panic should not happen", "isAvailable", "aa.domain.zk")
|
||||||
|
|
||||||
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
|
refresh, retry, expire, ttl := int64(101), int64(102), int64(103), int64(104)
|
||||||
c.Invoke(t, true, "register",
|
c.Invoke(t, true, "register",
|
||||||
|
|
Loading…
Reference in a new issue