Skip to content

Commit 8abffc9

Browse files
author
Andrew Hare
committed
fix: Hack empty service resource endpoints
1 parent 716f63b commit 8abffc9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

gateway/grpc/lease.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"google.golang.org/grpc/codes"
1010
"google.golang.org/grpc/status"
1111

12+
types "github.com/akash-network/akash-api/go/node/types/v1beta3"
13+
1214
"github.com/akash-network/provider"
1315
pmanifest "github.com/akash-network/provider/manifest"
1416
)
@@ -24,6 +26,17 @@ func (l *leaseV1) SendManifest(ctx context.Context, r *leasev1.SendManifestReque
2426
m = r.GetManifest()
2527
)
2628

29+
// HACK(andrewhare): Existing manifests expected service resource endpoints
30+
// to be JSON serialized as [] instead of null when determining the manifest
31+
// version hash. This forces Go to do the right thing.
32+
for g := range m {
33+
for s := range m[g].Services {
34+
if len(m[g].Services[s].Resources.Endpoints) == 0 {
35+
m[g].Services[s].Resources.Endpoints = make(types.Endpoints, 0)
36+
}
37+
}
38+
}
39+
2740
err := l.c.Manifest().Submit(ctx, id, m)
2841
if err == nil {
2942
return &leasev1.SendManifestResponse{}, nil

0 commit comments

Comments
 (0)