Skip to content

Commit

Permalink
fix(cluster): recover cluster params on provider restart (#252)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Sep 26, 2024
1 parent ed8bafb commit 83484f2
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 83484f2

Please sign in to comment.