Skip to content

Commit

Permalink
fix(cluster): recover cluster params on provider restart
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Aug 21, 2024
1 parent 7e2a151 commit 1d7e64b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cluster/inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ func newInventoryService(

reservations := make([]*reservation, 0, len(deployments))
for _, d := range deployments {
reservations = append(reservations, newReservation(d.LeaseID().OrderID(), d.ManifestGroup()))
res := newReservation(d.LeaseID().OrderID(), d.ManifestGroup())
res.SetClusterParams(d.ClusterParams())

reservations = append(reservations, res)
}

go is.lc.WatchChannel(ctx.Done())
Expand Down
3 changes: 3 additions & 0 deletions cluster/inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
cmocks "github.com/akash-network/provider/cluster/types/v1beta3/mocks"
"github.com/akash-network/provider/event"
"github.com/akash-network/provider/operator/waiter"
crd "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2"
aclient "github.com/akash-network/provider/pkg/client/clientset/versioned"
afake "github.com/akash-network/provider/pkg/client/clientset/versioned/fake"
"github.com/akash-network/provider/tools/fromctx"
Expand Down Expand Up @@ -187,6 +188,8 @@ func TestInventory_ClusterDeploymentDeployed(t *testing.T) {
}

deployment.On("ManifestGroup").Return(&group)
deployment.On("ClusterParams").Return(crd.ClusterSettings{})

deployments[0] = deployment

clusterClient := &mocks.Client{}
Expand Down

0 comments on commit 1d7e64b

Please sign in to comment.