From 1ea8e07798810c141e83383284f99684be950cfd Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Wed, 15 Nov 2023 10:07:08 -0800 Subject: [PATCH] feat: bid attributes (#162) Signed-off-by: Artur Troian --- _run/common-kube.mk | 2 +- balance_checker.go | 7 +- bidengine/order.go | 9 +- bidengine/order_test.go | 31 +- bidengine/provider_attributes_test.go | 15 +- bidengine/service.go | 2 +- client/broadcaster/serial.go | 2 +- cluster/client.go | 2 +- cluster/hostname.go | 2 +- cluster/inventory.go | 2 +- cluster/inventory_test.go | 2 +- cluster/kube/builder/builder.go | 2 +- cluster/kube/cleanup.go | 2 +- cluster/kube/client.go | 2 +- cluster/kube/client_exec.go | 2 +- cluster/kube/client_exec_test.go | 2 +- cluster/kube/client_hostname_connections.go | 2 +- cluster/kube/client_ingress.go | 2 +- cluster/kube/client_test.go | 2 +- .../recover_lease_id_from_labels.go | 2 +- cluster/kube/cluster_ip_connections.go | 2 +- cluster/kube/deploy_test.go | 2 +- cluster/kube/inventory_test.go | 6 +- cluster/kube/metallb/client.go | 2 +- cluster/manager.go | 2 +- cluster/manager_cleanup.go | 2 +- cluster/mocks/client.go | 230 ++--- cluster/mocks/cluster.go | 37 +- cluster/mocks/deployment.go | 2 +- cluster/mocks/hostname_service_client.go | 44 +- cluster/mocks/i_deployment.go | 15 +- cluster/mocks/ip_operator_client.go | 18 +- cluster/mocks/metallb_client.go | 20 +- cluster/mocks/read_client.go | 118 +-- cluster/mocks/reservation.go | 59 +- cluster/mocks/reservation_group.go | 43 + cluster/mocks/service.go | 90 +- cluster/monitor.go | 2 +- cluster/operatorclients/ip_operator_client.go | 2 +- cluster/reservation.go | 6 +- cluster/service.go | 2 +- cluster/types/v1beta3/deployment.go | 2 +- cluster/types/v1beta3/directives.go | 2 +- cluster/types/v1beta3/hostname.go | 2 +- cluster/types/v1beta3/interfaces.go | 2 +- cluster/types/v1beta3/ip.go | 2 +- cluster/types/v1beta3/reservation.go | 3 +- cluster/util/ip_sharing_key.go | 2 +- cluster/util/lease_id_to_namespace.go | 2 +- cmd/provider-services/cmd/helpers.go | 2 +- cmd/provider-services/cmd/leaseEvents.go | 2 +- cmd/provider-services/cmd/leaseLogs.go | 2 +- cmd/provider-services/cmd/migrate.go | 4 - .../cmd/migrate/v2beta2/migrate.go | 808 ------------------ cmd/provider-services/cmd/run.go | 2 +- config.go | 2 +- event/events.go | 2 +- gateway/rest/client.go | 3 +- gateway/rest/client_shell.go | 2 +- gateway/rest/integration_test.go | 13 +- gateway/rest/middleware.go | 2 +- gateway/rest/path.go | 2 +- gateway/rest/router.go | 2 +- gateway/rest/router_migrate_test.go | 2 +- gateway/rest/router_test.go | 7 +- go.mod | 6 +- go.sum | 8 +- integration/app_test.go | 2 +- integration/container2container_test.go | 2 +- integration/customcurrency_test.go | 2 +- integration/deployment_update_test.go | 2 +- integration/e2e_test.go | 2 +- integration/escrow_monitor_test.go | 2 +- integration/ipaddress_test.go | 2 +- integration/migrate_hostname_test.go | 2 +- integration/node_port_test.go | 2 +- integration/persistentstorage_test.go | 2 +- make/init.mk | 2 +- make/setup-cache.mk | 3 +- manifest/manager.go | 3 +- manifest/manager_test.go | 2 +- manifest/parse.go | 2 +- manifest/service.go | 2 +- manifest/watchdog.go | 2 +- manifest/watchdog_test.go | 4 +- .../hostnameoperator/hostname_operator.go | 2 +- .../hostname_operator_test.go | 2 +- .../hostname_operator_types.go | 2 +- operator/ipoperator/ip_operator.go | 2 +- operator/ipoperator/ip_operator_test.go | 2 +- operator/ipoperator/ip_operator_types.go | 2 +- .../types/delete_reservation_request.go | 2 +- .../ipoperator/types/reservation_request.go | 2 +- operator/operatorcommon/ignore_list.go | 2 +- pkg/apis/akash.network/v2beta1/types.go | 4 +- pkg/apis/akash.network/v2beta2/manifest.go | 2 +- pkg/apis/akash.network/v2beta2/types.go | 2 +- script/tools.sh | 14 + service.go | 4 + session/session.go | 10 +- testutil/provider/provider.go | 2 +- version/version.go | 10 +- 102 files changed, 560 insertions(+), 1232 deletions(-) delete mode 100644 cmd/provider-services/cmd/migrate/v2beta2/migrate.go diff --git a/_run/common-kube.mk b/_run/common-kube.mk index 14dd35e82..e1a7bd099 100644 --- a/_run/common-kube.mk +++ b/_run/common-kube.mk @@ -64,7 +64,7 @@ kube-prepare-image-akash: RELEASE_DOCKER_IMAGE=ghcr.io/akash-network/node kube-prepare-image-akash: ifneq ($(SKIP_BUILD), true) ifeq ($(AKASH_BUILD_LOCAL_IMAGE), true) - $(AP_ROOT)/script/tools.sh build-akash $(AKASHD_LOCAL_PATH) + $(AP_ROOT)/script/tools.sh build-akash-docker $(AKASHD_LOCAL_PATH) else docker pull $(AKASH_DOCKER_IMAGE) endif diff --git a/balance_checker.go b/balance_checker.go index c2582ad8e..de910dc24 100644 --- a/balance_checker.go +++ b/balance_checker.go @@ -12,9 +12,10 @@ import ( tmrpc "github.com/tendermint/tendermint/rpc/core/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" - "github.com/akash-network/node/client" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" + aclient "github.com/akash-network/node/client" + "github.com/akash-network/node/pubsub" netutil "github.com/akash-network/node/util/network" "github.com/akash-network/node/util/runner" @@ -68,7 +69,7 @@ type leaseCheckResponse struct { func newBalanceChecker(ctx context.Context, bqc btypes.QueryClient, - aqc client.QueryClient, + aqc aclient.QueryClient, accAddr sdk.AccAddress, clientSession session.Session, bus pubsub.Bus, diff --git a/bidengine/order.go b/bidengine/order.go index 1119ed0dd..cdafbf78f 100644 --- a/bidengine/order.go +++ b/bidengine/order.go @@ -15,7 +15,7 @@ import ( atypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" metricsutils "github.com/akash-network/node/util/metrics" "github.com/akash-network/node/util/runner" @@ -337,8 +337,7 @@ loop: o.log.Info("requesting reservation") // Begin reserving resources from cluster. clusterch = runner.Do(metricsutils.ObserveRunner(func() runner.Result { - v := runner.NewResult(o.cluster.Reserve(o.orderID, group)) - return v + return runner.NewResult(o.cluster.Reserve(o.orderID, group)) }, reservationDuration)) case result := <-clusterch: @@ -400,8 +399,10 @@ loop: o.log.Debug("submitting fulfillment", "price", price) + offer := mtypes.ResourceOfferFromRU(reservation.GetAllocatedResources()) + // Begin submitting fulfillment - msg = mtypes.NewMsgCreateBid(o.orderID, o.session.Provider().Address(), price, o.cfg.Deposit) + msg = mtypes.NewMsgCreateBid(o.orderID, o.session.Provider().Address(), price, o.cfg.Deposit, offer) bidch = runner.Do(func() runner.Result { return runner.NewResult(nil, o.session.Client().Tx().Broadcast(ctx, msg)) }) diff --git a/bidengine/order_test.go b/bidengine/order_test.go index a30dc205d..c339b8bde 100644 --- a/bidengine/order_test.go +++ b/bidengine/order_test.go @@ -19,7 +19,7 @@ import ( audittypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" atypes "github.com/akash-network/akash-api/go/node/types/v1beta3" broadcastmocks "github.com/akash-network/node/client/broadcaster/mocks" @@ -42,8 +42,8 @@ type orderTestScaffold struct { queryClient *clientmocks.QueryClient client *clientmocks.Client txClient *broadcastmocks.Client - cluster *clustermocks.Cluster + cluster *clustermocks.Cluster broadcasts chan sdk.Msg reserveCallNotify chan int } @@ -98,23 +98,24 @@ func makeMocks(s *orderTestScaffold) { queryClientMock.On("Orders", mock.Anything, mock.Anything).Return(&mtypes.QueryOrdersResponse{}, nil) queryClientMock.On("Provider", mock.Anything, mock.Anything).Return(&ptypes.QueryProviderResponse{}, nil) - txClientMock := &broadcastmocks.Client{} + txMocks := &broadcastmocks.Client{} s.broadcasts = make(chan sdk.Msg, 1) - txClientMock.On("Broadcast", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { + txMocks.On("Broadcast", mock.Anything, mock.Anything).Run(func(args mock.Arguments) { s.broadcasts <- args.Get(1).(sdk.Msg) }).Return(nil) - clientMock := &clientmocks.Client{} - clientMock.On("Query").Return(queryClientMock) - clientMock.On("Tx").Return(txClientMock) + clientMocks := &clientmocks.Client{} + clientMocks.On("Query").Return(queryClientMock) + clientMocks.On("Tx").Return(txMocks) - s.client = clientMock + s.client = clientMocks s.queryClient = queryClientMock - s.txClient = txClientMock + s.txClient = txMocks mockReservation := &clustermocks.Reservation{} mockReservation.On("OrderID").Return(s.orderID) mockReservation.On("Resources").Return(groupResult.Group) + mockReservation.On("GetAllocatedResources").Return(groupResult.Group.GroupSpec.Resources) s.cluster = &clustermocks.Cluster{} s.reserveCallNotify = make(chan int, 1) @@ -128,7 +129,7 @@ func makeMocks(s *orderTestScaffold) { type nullProviderAttrSignatureService struct{} -func (nullProviderAttrSignatureService) GetAuditorAttributeSignatures(auditor string) ([]audittypes.Provider, error) { +func (nullProviderAttrSignatureService) GetAuditorAttributeSignatures(_ string) ([]audittypes.Provider, error) { return nil, nil // Return no attributes & no error } @@ -138,7 +139,14 @@ func (nullProviderAttrSignatureService) GetAttributes() (atypes.Attributes, erro const testBidCreatedAt = 1234556789 -func makeOrderForTest(t *testing.T, checkForExistingBid bool, bidState mtypes.Bid_State, pricing BidPricingStrategy, callerConfig *Config, sessionHeight int64) (*order, orderTestScaffold, <-chan int) { +func makeOrderForTest( + t *testing.T, + checkForExistingBid bool, + bidState mtypes.Bid_State, + pricing BidPricingStrategy, + callerConfig *Config, + sessionHeight int64, +) (*order, orderTestScaffold, <-chan int) { if pricing == nil { pricing = testBidPricingStrategy(1) require.NotNil(t, pricing) @@ -399,7 +407,6 @@ func Test_BidOrderAndThenLeaseCreated(t *testing.T) { } func Test_BidOrderAndThenLeaseCreatedForDifferentDeployment(t *testing.T) { - order, scaffold, _ := makeOrderForTest(t, false, mtypes.BidStateInvalid, nil, nil, testBidCreatedAt) // Wait for first broadcast diff --git a/bidengine/provider_attributes_test.go b/bidengine/provider_attributes_test.go index f520d28e6..187dd44e8 100644 --- a/bidengine/provider_attributes_test.go +++ b/bidengine/provider_attributes_test.go @@ -9,15 +9,16 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + atypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" + + ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" + akashtypes "github.com/akash-network/akash-api/go/node/types/v1beta3" + clientmocks "github.com/akash-network/node/client/mocks" "github.com/akash-network/node/pubsub" "github.com/akash-network/node/testutil" "github.com/akash-network/provider/session" - - atypes "github.com/akash-network/akash-api/go/node/audit/v1beta3" - ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" - akashtypes "github.com/akash-network/akash-api/go/node/types/v1beta3" ) type providerAttributesTestScaffold struct { @@ -31,7 +32,11 @@ type providerAttributesTestScaffold struct { providerAddr sdk.AccAddress } -func setupProviderAttributesTestScaffold(t *testing.T, ttl time.Duration, clientFactory func(scaffold *providerAttributesTestScaffold) *clientmocks.QueryClient) *providerAttributesTestScaffold { +func setupProviderAttributesTestScaffold( + t *testing.T, + ttl time.Duration, + clientFactory func(scaffold *providerAttributesTestScaffold, + ) *clientmocks.QueryClient) *providerAttributesTestScaffold { retval := &providerAttributesTestScaffold{ auditorAddr: testutil.AccAddress(t), providerAddr: testutil.AccAddress(t), diff --git a/bidengine/service.go b/bidengine/service.go index 95fd97c95..ce188c13d 100644 --- a/bidengine/service.go +++ b/bidengine/service.go @@ -11,7 +11,7 @@ import ( sdkquery "github.com/cosmos/cosmos-sdk/types/query" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" mquery "github.com/akash-network/node/x/market/query" diff --git a/client/broadcaster/serial.go b/client/broadcaster/serial.go index 26dace2a5..52ef3faec 100644 --- a/client/broadcaster/serial.go +++ b/client/broadcaster/serial.go @@ -18,7 +18,7 @@ import ( "github.com/tendermint/tendermint/libs/log" ttypes "github.com/tendermint/tendermint/types" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" abroadcaster "github.com/akash-network/node/client/broadcaster" ) diff --git a/cluster/client.go b/cluster/client.go index a4186ef4c..fa2fe956f 100644 --- a/cluster/client.go +++ b/cluster/client.go @@ -18,7 +18,7 @@ import ( mani "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/akash-api/go/node/types/unit" types "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/sdl" diff --git a/cluster/hostname.go b/cluster/hostname.go index c7bad4d59..cb3f3eb57 100644 --- a/cluster/hostname.go +++ b/cluster/hostname.go @@ -10,7 +10,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/pkg/errors" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clustertypes "github.com/akash-network/provider/cluster/types/v1beta3" ) diff --git a/cluster/inventory.go b/cluster/inventory.go index 9eddc34d4..45108c5b9 100644 --- a/cluster/inventory.go +++ b/cluster/inventory.go @@ -16,7 +16,7 @@ import ( "github.com/tendermint/tendermint/libs/log" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" atypes "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/pubsub" diff --git a/cluster/inventory_test.go b/cluster/inventory_test.go index 5e618f659..e5f95ae39 100644 --- a/cluster/inventory_test.go +++ b/cluster/inventory_test.go @@ -11,7 +11,7 @@ import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/akash-api/go/node/types/unit" types "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/pubsub" diff --git a/cluster/kube/builder/builder.go b/cluster/kube/builder/builder.go index d77c0c23e..07329ac5c 100644 --- a/cluster/kube/builder/builder.go +++ b/cluster/kube/builder/builder.go @@ -12,7 +12,7 @@ import ( "github.com/tendermint/tendermint/libs/log" mani "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ctypes "github.com/akash-network/provider/cluster/types/v1beta3" clusterUtil "github.com/akash-network/provider/cluster/util" diff --git a/cluster/kube/cleanup.go b/cluster/kube/cleanup.go index b886bc036..99d85c349 100644 --- a/cluster/kube/cleanup.go +++ b/cluster/kube/cleanup.go @@ -9,7 +9,7 @@ import ( "k8s.io/apimachinery/pkg/selection" "k8s.io/client-go/kubernetes" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster/kube/builder" ) diff --git a/cluster/kube/client.go b/cluster/kube/client.go index efd7ecf08..d04752e3b 100644 --- a/cluster/kube/client.go +++ b/cluster/kube/client.go @@ -25,7 +25,7 @@ import ( mapi "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/sdl" metricsutils "github.com/akash-network/node/util/metrics" diff --git a/cluster/kube/client_exec.go b/cluster/kube/client_exec.go index 559121a98..149ce0531 100644 --- a/cluster/kube/client_exec.go +++ b/cluster/kube/client_exec.go @@ -16,7 +16,7 @@ import ( "k8s.io/client-go/tools/remotecommand" executil "k8s.io/client-go/util/exec" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster" "github.com/akash-network/provider/cluster/kube/builder" diff --git a/cluster/kube/client_exec_test.go b/cluster/kube/client_exec_test.go index 8c48e18e5..91aeb083f 100644 --- a/cluster/kube/client_exec_test.go +++ b/cluster/kube/client_exec_test.go @@ -17,7 +17,7 @@ import ( kubefake "k8s.io/client-go/kubernetes/fake" "k8s.io/client-go/rest" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/sdl" "github.com/akash-network/node/testutil" diff --git a/cluster/kube/client_hostname_connections.go b/cluster/kube/client_hostname_connections.go index ee64803d3..c61f3ca14 100644 --- a/cluster/kube/client_hostname_connections.go +++ b/cluster/kube/client_hostname_connections.go @@ -13,7 +13,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster/kube/builder" ctypes "github.com/akash-network/provider/cluster/types/v1beta3" diff --git a/cluster/kube/client_ingress.go b/cluster/kube/client_ingress.go index e4adecac7..09a129c88 100644 --- a/cluster/kube/client_ingress.go +++ b/cluster/kube/client_ingress.go @@ -13,7 +13,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/pager" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" metricsutils "github.com/akash-network/node/util/metrics" "github.com/akash-network/provider/cluster/kube/builder" diff --git a/cluster/kube/client_test.go b/cluster/kube/client_test.go index dfef7f8c1..dfaa43d39 100644 --- a/cluster/kube/client_test.go +++ b/cluster/kube/client_test.go @@ -16,7 +16,7 @@ import ( "k8s.io/client-go/rest" manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/testutil" diff --git a/cluster/kube/clientcommon/recover_lease_id_from_labels.go b/cluster/kube/clientcommon/recover_lease_id_from_labels.go index cb59a0cc5..167965747 100644 --- a/cluster/kube/clientcommon/recover_lease_id_from_labels.go +++ b/cluster/kube/clientcommon/recover_lease_id_from_labels.go @@ -5,7 +5,7 @@ import ( "fmt" "strconv" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster/kube/builder" ) diff --git a/cluster/kube/cluster_ip_connections.go b/cluster/kube/cluster_ip_connections.go index a51c4e997..d9d6100c8 100644 --- a/cluster/kube/cluster_ip_connections.go +++ b/cluster/kube/cluster_ip_connections.go @@ -14,7 +14,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster/kube/builder" kubeclienterrors "github.com/akash-network/provider/cluster/kube/errors" diff --git a/cluster/kube/deploy_test.go b/cluster/kube/deploy_test.go index bf094ac92..d3b716d8b 100644 --- a/cluster/kube/deploy_test.go +++ b/cluster/kube/deploy_test.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" sdk "github.com/cosmos/cosmos-sdk/types" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/sdl" "github.com/akash-network/node/testutil" diff --git a/cluster/kube/inventory_test.go b/cluster/kube/inventory_test.go index 478a1ebfc..cdafae7ba 100644 --- a/cluster/kube/inventory_test.go +++ b/cluster/kube/inventory_test.go @@ -13,7 +13,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/akash-api/go/node/types/unit" atypes "github.com/akash-network/akash-api/go/node/types/v1beta3" "github.com/akash-network/node/testutil" @@ -47,6 +47,10 @@ func (r *testReservation) SetAllocatedResources(val dtypes.ResourceUnits) { r.adjustedResources = val } +func (r *testReservation) GetAllocatedResources() dtypes.ResourceUnits { + return r.adjustedResources +} + func (r *testReservation) Allocated() bool { return false } diff --git a/cluster/kube/metallb/client.go b/cluster/kube/metallb/client.go index aec1ca9b6..034fc3122 100644 --- a/cluster/kube/metallb/client.go +++ b/cluster/kube/metallb/client.go @@ -24,7 +24,7 @@ import ( "k8s.io/client-go/util/flowcontrol" manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster/kube/builder" "github.com/akash-network/provider/cluster/kube/clientcommon" diff --git a/cluster/manager.go b/cluster/manager.go index 2f43e26d3..936556ab6 100644 --- a/cluster/manager.go +++ b/cluster/manager.go @@ -15,7 +15,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promauto" mani "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" kubeclienterrors "github.com/akash-network/provider/cluster/kube/errors" diff --git a/cluster/manager_cleanup.go b/cluster/manager_cleanup.go index e04dd316d..e3360f7c5 100644 --- a/cluster/manager_cleanup.go +++ b/cluster/manager_cleanup.go @@ -4,7 +4,7 @@ import ( "context" "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" logger "github.com/tendermint/tendermint/libs/log" ) diff --git a/cluster/mocks/client.go b/cluster/mocks/client.go index d0309d8a5..0700c8624 100644 --- a/cluster/mocks/client.go +++ b/cluster/mocks/client.go @@ -9,14 +9,14 @@ import ( io "io" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" - mock "github.com/stretchr/testify/mock" remotecommand "k8s.io/client-go/tools/remotecommand" v1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" + v2beta2 "github.com/akash-network/akash-api/go/manifest/v2beta2" version "k8s.io/apimachinery/pkg/version" @@ -133,11 +133,11 @@ func (_c *Client_ConnectHostnameToDeployment_Call) RunAndReturn(run func(context } // DeclareHostname provides a mock function with given fields: ctx, lID, host, serviceName, externalPort -func (_m *Client) DeclareHostname(ctx context.Context, lID marketv1beta3.LeaseID, host string, serviceName string, externalPort uint32) error { +func (_m *Client) DeclareHostname(ctx context.Context, lID v1beta4.LeaseID, host string, serviceName string, externalPort uint32) error { ret := _m.Called(ctx, lID, host, serviceName, externalPort) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, string, uint32) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, string, uint32) error); ok { r0 = rf(ctx, lID, host, serviceName, externalPort) } else { r0 = ret.Error(0) @@ -153,7 +153,7 @@ type Client_DeclareHostname_Call struct { // DeclareHostname is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID // - host string // - serviceName string // - externalPort uint32 @@ -161,9 +161,9 @@ func (_e *Client_Expecter) DeclareHostname(ctx interface{}, lID interface{}, hos return &Client_DeclareHostname_Call{Call: _e.mock.On("DeclareHostname", ctx, lID, host, serviceName, externalPort)} } -func (_c *Client_DeclareHostname_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID, host string, serviceName string, externalPort uint32)) *Client_DeclareHostname_Call { +func (_c *Client_DeclareHostname_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID, host string, serviceName string, externalPort uint32)) *Client_DeclareHostname_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(string), args[4].(uint32)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(string), args[4].(uint32)) }) return _c } @@ -173,17 +173,17 @@ func (_c *Client_DeclareHostname_Call) Return(_a0 error) *Client_DeclareHostname return _c } -func (_c *Client_DeclareHostname_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, string, uint32) error) *Client_DeclareHostname_Call { +func (_c *Client_DeclareHostname_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, string, uint32) error) *Client_DeclareHostname_Call { _c.Call.Return(run) return _c } // DeclareIP provides a mock function with given fields: ctx, lID, serviceName, port, externalPort, proto, sharingKey, overwrite -func (_m *Client) DeclareIP(ctx context.Context, lID marketv1beta3.LeaseID, serviceName string, port uint32, externalPort uint32, proto v2beta2.ServiceProtocol, sharingKey string, overwrite bool) error { +func (_m *Client) DeclareIP(ctx context.Context, lID v1beta4.LeaseID, serviceName string, port uint32, externalPort uint32, proto v2beta2.ServiceProtocol, sharingKey string, overwrite bool) error { ret := _m.Called(ctx, lID, serviceName, port, externalPort, proto, sharingKey, overwrite) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, uint32, uint32, v2beta2.ServiceProtocol, string, bool) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, uint32, uint32, v2beta2.ServiceProtocol, string, bool) error); ok { r0 = rf(ctx, lID, serviceName, port, externalPort, proto, sharingKey, overwrite) } else { r0 = ret.Error(0) @@ -199,7 +199,7 @@ type Client_DeclareIP_Call struct { // DeclareIP is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID // - serviceName string // - port uint32 // - externalPort uint32 @@ -210,9 +210,9 @@ func (_e *Client_Expecter) DeclareIP(ctx interface{}, lID interface{}, serviceNa return &Client_DeclareIP_Call{Call: _e.mock.On("DeclareIP", ctx, lID, serviceName, port, externalPort, proto, sharingKey, overwrite)} } -func (_c *Client_DeclareIP_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID, serviceName string, port uint32, externalPort uint32, proto v2beta2.ServiceProtocol, sharingKey string, overwrite bool)) *Client_DeclareIP_Call { +func (_c *Client_DeclareIP_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID, serviceName string, port uint32, externalPort uint32, proto v2beta2.ServiceProtocol, sharingKey string, overwrite bool)) *Client_DeclareIP_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(uint32), args[4].(uint32), args[5].(v2beta2.ServiceProtocol), args[6].(string), args[7].(bool)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(uint32), args[4].(uint32), args[5].(v2beta2.ServiceProtocol), args[6].(string), args[7].(bool)) }) return _c } @@ -222,7 +222,7 @@ func (_c *Client_DeclareIP_Call) Return(_a0 error) *Client_DeclareIP_Call { return _c } -func (_c *Client_DeclareIP_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, uint32, uint32, v2beta2.ServiceProtocol, string, bool) error) *Client_DeclareIP_Call { +func (_c *Client_DeclareIP_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, uint32, uint32, v2beta2.ServiceProtocol, string, bool) error) *Client_DeclareIP_Call { _c.Call.Return(run) return _c } @@ -325,15 +325,15 @@ func (_c *Client_Deployments_Call) RunAndReturn(run func(context.Context) ([]v1b } // Exec provides a mock function with given fields: ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq -func (_m *Client) Exec(ctx context.Context, lID marketv1beta3.LeaseID, service string, podIndex uint, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, tty bool, tsq remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error) { +func (_m *Client) Exec(ctx context.Context, lID v1beta4.LeaseID, service string, podIndex uint, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, tty bool, tsq remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error) { ret := _m.Called(ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq) var r0 v1beta3.ExecResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error)); ok { return rf(ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) v1beta3.ExecResult); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) v1beta3.ExecResult); ok { r0 = rf(ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq) } else { if ret.Get(0) != nil { @@ -341,7 +341,7 @@ func (_m *Client) Exec(ctx context.Context, lID marketv1beta3.LeaseID, service s } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) error); ok { r1 = rf(ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq) } else { r1 = ret.Error(1) @@ -357,7 +357,7 @@ type Client_Exec_Call struct { // Exec is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID // - service string // - podIndex uint // - cmd []string @@ -370,9 +370,9 @@ func (_e *Client_Expecter) Exec(ctx interface{}, lID interface{}, service interf return &Client_Exec_Call{Call: _e.mock.On("Exec", ctx, lID, service, podIndex, cmd, stdin, stdout, stderr, tty, tsq)} } -func (_c *Client_Exec_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID, service string, podIndex uint, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, tty bool, tsq remotecommand.TerminalSizeQueue)) *Client_Exec_Call { +func (_c *Client_Exec_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID, service string, podIndex uint, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, tty bool, tsq remotecommand.TerminalSizeQueue)) *Client_Exec_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(uint), args[4].([]string), args[5].(io.Reader), args[6].(io.Writer), args[7].(io.Writer), args[8].(bool), args[9].(remotecommand.TerminalSizeQueue)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(uint), args[4].([]string), args[5].(io.Reader), args[6].(io.Writer), args[7].(io.Writer), args[8].(bool), args[9].(remotecommand.TerminalSizeQueue)) }) return _c } @@ -382,21 +382,21 @@ func (_c *Client_Exec_Call) Return(_a0 v1beta3.ExecResult, _a1 error) *Client_Ex return _c } -func (_c *Client_Exec_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error)) *Client_Exec_Call { +func (_c *Client_Exec_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, uint, []string, io.Reader, io.Writer, io.Writer, bool, remotecommand.TerminalSizeQueue) (v1beta3.ExecResult, error)) *Client_Exec_Call { _c.Call.Return(run) return _c } // ForwardedPortStatus provides a mock function with given fields: _a0, _a1 -func (_m *Client) ForwardedPortStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error) { +func (_m *Client) ForwardedPortStatus(_a0 context.Context, _a1 v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error) { ret := _m.Called(_a0, _a1) var r0 map[string][]v1beta3.ForwardedPortStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) map[string][]v1beta3.ForwardedPortStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) map[string][]v1beta3.ForwardedPortStatus); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -404,7 +404,7 @@ func (_m *Client) ForwardedPortStatus(_a0 context.Context, _a1 marketv1beta3.Lea } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -420,14 +420,14 @@ type Client_ForwardedPortStatus_Call struct { // ForwardedPortStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *Client_Expecter) ForwardedPortStatus(_a0 interface{}, _a1 interface{}) *Client_ForwardedPortStatus_Call { return &Client_ForwardedPortStatus_Call{Call: _e.mock.On("ForwardedPortStatus", _a0, _a1)} } -func (_c *Client_ForwardedPortStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *Client_ForwardedPortStatus_Call { +func (_c *Client_ForwardedPortStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *Client_ForwardedPortStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -437,21 +437,21 @@ func (_c *Client_ForwardedPortStatus_Call) Return(_a0 map[string][]v1beta3.Forwa return _c } -func (_c *Client_ForwardedPortStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)) *Client_ForwardedPortStatus_Call { +func (_c *Client_ForwardedPortStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)) *Client_ForwardedPortStatus_Call { _c.Call.Return(run) return _c } // GetDeclaredIPs provides a mock function with given fields: ctx, leaseID -func (_m *Client) GetDeclaredIPs(ctx context.Context, leaseID marketv1beta3.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error) { +func (_m *Client) GetDeclaredIPs(ctx context.Context, leaseID v1beta4.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error) { ret := _m.Called(ctx, leaseID) var r0 []akash_networkv2beta2.ProviderLeasedIPSpec var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error)); ok { return rf(ctx, leaseID) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) []akash_networkv2beta2.ProviderLeasedIPSpec); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) []akash_networkv2beta2.ProviderLeasedIPSpec); ok { r0 = rf(ctx, leaseID) } else { if ret.Get(0) != nil { @@ -459,7 +459,7 @@ func (_m *Client) GetDeclaredIPs(ctx context.Context, leaseID marketv1beta3.Leas } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(ctx, leaseID) } else { r1 = ret.Error(1) @@ -475,14 +475,14 @@ type Client_GetDeclaredIPs_Call struct { // GetDeclaredIPs is a helper method to define mock.On call // - ctx context.Context -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *Client_Expecter) GetDeclaredIPs(ctx interface{}, leaseID interface{}) *Client_GetDeclaredIPs_Call { return &Client_GetDeclaredIPs_Call{Call: _e.mock.On("GetDeclaredIPs", ctx, leaseID)} } -func (_c *Client_GetDeclaredIPs_Call) Run(run func(ctx context.Context, leaseID marketv1beta3.LeaseID)) *Client_GetDeclaredIPs_Call { +func (_c *Client_GetDeclaredIPs_Call) Run(run func(ctx context.Context, leaseID v1beta4.LeaseID)) *Client_GetDeclaredIPs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -492,7 +492,7 @@ func (_c *Client_GetDeclaredIPs_Call) Return(_a0 []akash_networkv2beta2.Provider return _c } -func (_c *Client_GetDeclaredIPs_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error)) *Client_GetDeclaredIPs_Call { +func (_c *Client_GetDeclaredIPs_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) ([]akash_networkv2beta2.ProviderLeasedIPSpec, error)) *Client_GetDeclaredIPs_Call { _c.Call.Return(run) return _c } @@ -552,28 +552,28 @@ func (_c *Client_GetHostnameDeploymentConnections_Call) RunAndReturn(run func(co } // GetManifestGroup provides a mock function with given fields: _a0, _a1 -func (_m *Client) GetManifestGroup(_a0 context.Context, _a1 marketv1beta3.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error) { +func (_m *Client) GetManifestGroup(_a0 context.Context, _a1 v1beta4.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error) { ret := _m.Called(_a0, _a1) var r0 bool var r1 akash_networkv2beta2.ManifestGroup var r2 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) bool); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) akash_networkv2beta2.ManifestGroup); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) akash_networkv2beta2.ManifestGroup); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Get(1).(akash_networkv2beta2.ManifestGroup) } - if rf, ok := ret.Get(2).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(2).(func(context.Context, v1beta4.LeaseID) error); ok { r2 = rf(_a0, _a1) } else { r2 = ret.Error(2) @@ -589,14 +589,14 @@ type Client_GetManifestGroup_Call struct { // GetManifestGroup is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *Client_Expecter) GetManifestGroup(_a0 interface{}, _a1 interface{}) *Client_GetManifestGroup_Call { return &Client_GetManifestGroup_Call{Call: _e.mock.On("GetManifestGroup", _a0, _a1)} } -func (_c *Client_GetManifestGroup_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *Client_GetManifestGroup_Call { +func (_c *Client_GetManifestGroup_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *Client_GetManifestGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -606,7 +606,7 @@ func (_c *Client_GetManifestGroup_Call) Return(_a0 bool, _a1 akash_networkv2beta return _c } -func (_c *Client_GetManifestGroup_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error)) *Client_GetManifestGroup_Call { +func (_c *Client_GetManifestGroup_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (bool, akash_networkv2beta2.ManifestGroup, error)) *Client_GetManifestGroup_Call { _c.Call.Return(run) return _c } @@ -719,15 +719,15 @@ func (_c *Client_KubeVersion_Call) RunAndReturn(run func() (*version.Info, error } // LeaseEvents provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *Client) LeaseEvents(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool) (v1beta3.EventsWatcher, error) { +func (_m *Client) LeaseEvents(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool) (v1beta3.EventsWatcher, error) { ret := _m.Called(_a0, _a1, _a2, _a3) var r0 v1beta3.EventsWatcher var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool) (v1beta3.EventsWatcher, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool) (v1beta3.EventsWatcher, error)); ok { return rf(_a0, _a1, _a2, _a3) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool) v1beta3.EventsWatcher); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool) v1beta3.EventsWatcher); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { if ret.Get(0) != nil { @@ -735,7 +735,7 @@ func (_m *Client) LeaseEvents(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string, bool) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string, bool) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { r1 = ret.Error(1) @@ -751,16 +751,16 @@ type Client_LeaseEvents_Call struct { // LeaseEvents is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string // - _a3 bool func (_e *Client_Expecter) LeaseEvents(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *Client_LeaseEvents_Call { return &Client_LeaseEvents_Call{Call: _e.mock.On("LeaseEvents", _a0, _a1, _a2, _a3)} } -func (_c *Client_LeaseEvents_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool)) *Client_LeaseEvents_Call { +func (_c *Client_LeaseEvents_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool)) *Client_LeaseEvents_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(bool)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(bool)) }) return _c } @@ -770,21 +770,21 @@ func (_c *Client_LeaseEvents_Call) Return(_a0 v1beta3.EventsWatcher, _a1 error) return _c } -func (_c *Client_LeaseEvents_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, bool) (v1beta3.EventsWatcher, error)) *Client_LeaseEvents_Call { +func (_c *Client_LeaseEvents_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, bool) (v1beta3.EventsWatcher, error)) *Client_LeaseEvents_Call { _c.Call.Return(run) return _c } // LeaseLogs provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 -func (_m *Client) LeaseLogs(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool, _a4 *int64) ([]*v1beta3.ServiceLog, error) { +func (_m *Client) LeaseLogs(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool, _a4 *int64) ([]*v1beta3.ServiceLog, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) var r0 []*v1beta3.ServiceLog var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)); ok { return rf(_a0, _a1, _a2, _a3, _a4) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) []*v1beta3.ServiceLog); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) []*v1beta3.ServiceLog); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { if ret.Get(0) != nil { @@ -792,7 +792,7 @@ func (_m *Client) LeaseLogs(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) error); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4) } else { r1 = ret.Error(1) @@ -808,7 +808,7 @@ type Client_LeaseLogs_Call struct { // LeaseLogs is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string // - _a3 bool // - _a4 *int64 @@ -816,9 +816,9 @@ func (_e *Client_Expecter) LeaseLogs(_a0 interface{}, _a1 interface{}, _a2 inter return &Client_LeaseLogs_Call{Call: _e.mock.On("LeaseLogs", _a0, _a1, _a2, _a3, _a4)} } -func (_c *Client_LeaseLogs_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool, _a4 *int64)) *Client_LeaseLogs_Call { +func (_c *Client_LeaseLogs_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool, _a4 *int64)) *Client_LeaseLogs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(bool), args[4].(*int64)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(bool), args[4].(*int64)) }) return _c } @@ -828,21 +828,21 @@ func (_c *Client_LeaseLogs_Call) Return(_a0 []*v1beta3.ServiceLog, _a1 error) *C return _c } -func (_c *Client_LeaseLogs_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)) *Client_LeaseLogs_Call { +func (_c *Client_LeaseLogs_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)) *Client_LeaseLogs_Call { _c.Call.Return(run) return _c } // LeaseStatus provides a mock function with given fields: _a0, _a1 -func (_m *Client) LeaseStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error) { +func (_m *Client) LeaseStatus(_a0 context.Context, _a1 v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error) { ret := _m.Called(_a0, _a1) var r0 map[string]*v1beta3.ServiceStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) map[string]*v1beta3.ServiceStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) map[string]*v1beta3.ServiceStatus); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -850,7 +850,7 @@ func (_m *Client) LeaseStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID) (m } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -866,14 +866,14 @@ type Client_LeaseStatus_Call struct { // LeaseStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *Client_Expecter) LeaseStatus(_a0 interface{}, _a1 interface{}) *Client_LeaseStatus_Call { return &Client_LeaseStatus_Call{Call: _e.mock.On("LeaseStatus", _a0, _a1)} } -func (_c *Client_LeaseStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *Client_LeaseStatus_Call { +func (_c *Client_LeaseStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *Client_LeaseStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -883,7 +883,7 @@ func (_c *Client_LeaseStatus_Call) Return(_a0 map[string]*v1beta3.ServiceStatus, return _c } -func (_c *Client_LeaseStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error)) *Client_LeaseStatus_Call { +func (_c *Client_LeaseStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error)) *Client_LeaseStatus_Call { _c.Call.Return(run) return _c } @@ -997,11 +997,11 @@ func (_c *Client_ObserveIPState_Call) RunAndReturn(run func(context.Context) (<- } // PurgeDeclaredHostname provides a mock function with given fields: ctx, lID, hostname -func (_m *Client) PurgeDeclaredHostname(ctx context.Context, lID marketv1beta3.LeaseID, hostname string) error { +func (_m *Client) PurgeDeclaredHostname(ctx context.Context, lID v1beta4.LeaseID, hostname string) error { ret := _m.Called(ctx, lID, hostname) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string) error); ok { r0 = rf(ctx, lID, hostname) } else { r0 = ret.Error(0) @@ -1017,15 +1017,15 @@ type Client_PurgeDeclaredHostname_Call struct { // PurgeDeclaredHostname is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID // - hostname string func (_e *Client_Expecter) PurgeDeclaredHostname(ctx interface{}, lID interface{}, hostname interface{}) *Client_PurgeDeclaredHostname_Call { return &Client_PurgeDeclaredHostname_Call{Call: _e.mock.On("PurgeDeclaredHostname", ctx, lID, hostname)} } -func (_c *Client_PurgeDeclaredHostname_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID, hostname string)) *Client_PurgeDeclaredHostname_Call { +func (_c *Client_PurgeDeclaredHostname_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID, hostname string)) *Client_PurgeDeclaredHostname_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string)) }) return _c } @@ -1035,17 +1035,17 @@ func (_c *Client_PurgeDeclaredHostname_Call) Return(_a0 error) *Client_PurgeDecl return _c } -func (_c *Client_PurgeDeclaredHostname_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string) error) *Client_PurgeDeclaredHostname_Call { +func (_c *Client_PurgeDeclaredHostname_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string) error) *Client_PurgeDeclaredHostname_Call { _c.Call.Return(run) return _c } // PurgeDeclaredHostnames provides a mock function with given fields: ctx, lID -func (_m *Client) PurgeDeclaredHostnames(ctx context.Context, lID marketv1beta3.LeaseID) error { +func (_m *Client) PurgeDeclaredHostnames(ctx context.Context, lID v1beta4.LeaseID) error { ret := _m.Called(ctx, lID) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) error); ok { r0 = rf(ctx, lID) } else { r0 = ret.Error(0) @@ -1061,14 +1061,14 @@ type Client_PurgeDeclaredHostnames_Call struct { // PurgeDeclaredHostnames is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID func (_e *Client_Expecter) PurgeDeclaredHostnames(ctx interface{}, lID interface{}) *Client_PurgeDeclaredHostnames_Call { return &Client_PurgeDeclaredHostnames_Call{Call: _e.mock.On("PurgeDeclaredHostnames", ctx, lID)} } -func (_c *Client_PurgeDeclaredHostnames_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID)) *Client_PurgeDeclaredHostnames_Call { +func (_c *Client_PurgeDeclaredHostnames_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID)) *Client_PurgeDeclaredHostnames_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -1078,17 +1078,17 @@ func (_c *Client_PurgeDeclaredHostnames_Call) Return(_a0 error) *Client_PurgeDec return _c } -func (_c *Client_PurgeDeclaredHostnames_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) error) *Client_PurgeDeclaredHostnames_Call { +func (_c *Client_PurgeDeclaredHostnames_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) error) *Client_PurgeDeclaredHostnames_Call { _c.Call.Return(run) return _c } // PurgeDeclaredIP provides a mock function with given fields: ctx, lID, serviceName, externalPort, proto -func (_m *Client) PurgeDeclaredIP(ctx context.Context, lID marketv1beta3.LeaseID, serviceName string, externalPort uint32, proto v2beta2.ServiceProtocol) error { +func (_m *Client) PurgeDeclaredIP(ctx context.Context, lID v1beta4.LeaseID, serviceName string, externalPort uint32, proto v2beta2.ServiceProtocol) error { ret := _m.Called(ctx, lID, serviceName, externalPort, proto) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, uint32, v2beta2.ServiceProtocol) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, uint32, v2beta2.ServiceProtocol) error); ok { r0 = rf(ctx, lID, serviceName, externalPort, proto) } else { r0 = ret.Error(0) @@ -1104,7 +1104,7 @@ type Client_PurgeDeclaredIP_Call struct { // PurgeDeclaredIP is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID // - serviceName string // - externalPort uint32 // - proto v2beta2.ServiceProtocol @@ -1112,9 +1112,9 @@ func (_e *Client_Expecter) PurgeDeclaredIP(ctx interface{}, lID interface{}, ser return &Client_PurgeDeclaredIP_Call{Call: _e.mock.On("PurgeDeclaredIP", ctx, lID, serviceName, externalPort, proto)} } -func (_c *Client_PurgeDeclaredIP_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID, serviceName string, externalPort uint32, proto v2beta2.ServiceProtocol)) *Client_PurgeDeclaredIP_Call { +func (_c *Client_PurgeDeclaredIP_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID, serviceName string, externalPort uint32, proto v2beta2.ServiceProtocol)) *Client_PurgeDeclaredIP_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(uint32), args[4].(v2beta2.ServiceProtocol)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(uint32), args[4].(v2beta2.ServiceProtocol)) }) return _c } @@ -1124,17 +1124,17 @@ func (_c *Client_PurgeDeclaredIP_Call) Return(_a0 error) *Client_PurgeDeclaredIP return _c } -func (_c *Client_PurgeDeclaredIP_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, uint32, v2beta2.ServiceProtocol) error) *Client_PurgeDeclaredIP_Call { +func (_c *Client_PurgeDeclaredIP_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, uint32, v2beta2.ServiceProtocol) error) *Client_PurgeDeclaredIP_Call { _c.Call.Return(run) return _c } // PurgeDeclaredIPs provides a mock function with given fields: ctx, lID -func (_m *Client) PurgeDeclaredIPs(ctx context.Context, lID marketv1beta3.LeaseID) error { +func (_m *Client) PurgeDeclaredIPs(ctx context.Context, lID v1beta4.LeaseID) error { ret := _m.Called(ctx, lID) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) error); ok { r0 = rf(ctx, lID) } else { r0 = ret.Error(0) @@ -1150,14 +1150,14 @@ type Client_PurgeDeclaredIPs_Call struct { // PurgeDeclaredIPs is a helper method to define mock.On call // - ctx context.Context -// - lID marketv1beta3.LeaseID +// - lID v1beta4.LeaseID func (_e *Client_Expecter) PurgeDeclaredIPs(ctx interface{}, lID interface{}) *Client_PurgeDeclaredIPs_Call { return &Client_PurgeDeclaredIPs_Call{Call: _e.mock.On("PurgeDeclaredIPs", ctx, lID)} } -func (_c *Client_PurgeDeclaredIPs_Call) Run(run func(ctx context.Context, lID marketv1beta3.LeaseID)) *Client_PurgeDeclaredIPs_Call { +func (_c *Client_PurgeDeclaredIPs_Call) Run(run func(ctx context.Context, lID v1beta4.LeaseID)) *Client_PurgeDeclaredIPs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -1167,17 +1167,17 @@ func (_c *Client_PurgeDeclaredIPs_Call) Return(_a0 error) *Client_PurgeDeclaredI return _c } -func (_c *Client_PurgeDeclaredIPs_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) error) *Client_PurgeDeclaredIPs_Call { +func (_c *Client_PurgeDeclaredIPs_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) error) *Client_PurgeDeclaredIPs_Call { _c.Call.Return(run) return _c } // RemoveHostnameFromDeployment provides a mock function with given fields: ctx, hostname, leaseID, allowMissing -func (_m *Client) RemoveHostnameFromDeployment(ctx context.Context, hostname string, leaseID marketv1beta3.LeaseID, allowMissing bool) error { +func (_m *Client) RemoveHostnameFromDeployment(ctx context.Context, hostname string, leaseID v1beta4.LeaseID, allowMissing bool) error { ret := _m.Called(ctx, hostname, leaseID, allowMissing) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string, marketv1beta3.LeaseID, bool) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, string, v1beta4.LeaseID, bool) error); ok { r0 = rf(ctx, hostname, leaseID, allowMissing) } else { r0 = ret.Error(0) @@ -1194,15 +1194,15 @@ type Client_RemoveHostnameFromDeployment_Call struct { // RemoveHostnameFromDeployment is a helper method to define mock.On call // - ctx context.Context // - hostname string -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID // - allowMissing bool func (_e *Client_Expecter) RemoveHostnameFromDeployment(ctx interface{}, hostname interface{}, leaseID interface{}, allowMissing interface{}) *Client_RemoveHostnameFromDeployment_Call { return &Client_RemoveHostnameFromDeployment_Call{Call: _e.mock.On("RemoveHostnameFromDeployment", ctx, hostname, leaseID, allowMissing)} } -func (_c *Client_RemoveHostnameFromDeployment_Call) Run(run func(ctx context.Context, hostname string, leaseID marketv1beta3.LeaseID, allowMissing bool)) *Client_RemoveHostnameFromDeployment_Call { +func (_c *Client_RemoveHostnameFromDeployment_Call) Run(run func(ctx context.Context, hostname string, leaseID v1beta4.LeaseID, allowMissing bool)) *Client_RemoveHostnameFromDeployment_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(string), args[2].(marketv1beta3.LeaseID), args[3].(bool)) + run(args[0].(context.Context), args[1].(string), args[2].(v1beta4.LeaseID), args[3].(bool)) }) return _c } @@ -1212,21 +1212,21 @@ func (_c *Client_RemoveHostnameFromDeployment_Call) Return(_a0 error) *Client_Re return _c } -func (_c *Client_RemoveHostnameFromDeployment_Call) RunAndReturn(run func(context.Context, string, marketv1beta3.LeaseID, bool) error) *Client_RemoveHostnameFromDeployment_Call { +func (_c *Client_RemoveHostnameFromDeployment_Call) RunAndReturn(run func(context.Context, string, v1beta4.LeaseID, bool) error) *Client_RemoveHostnameFromDeployment_Call { _c.Call.Return(run) return _c } // ServiceStatus provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Client) ServiceStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string) (*v1beta3.ServiceStatus, error) { +func (_m *Client) ServiceStatus(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string) (*v1beta3.ServiceStatus, error) { ret := _m.Called(_a0, _a1, _a2) var r0 *v1beta3.ServiceStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string) (*v1beta3.ServiceStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string) (*v1beta3.ServiceStatus, error)); ok { return rf(_a0, _a1, _a2) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string) *v1beta3.ServiceStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string) *v1beta3.ServiceStatus); ok { r0 = rf(_a0, _a1, _a2) } else { if ret.Get(0) != nil { @@ -1234,7 +1234,7 @@ func (_m *Client) ServiceStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID, } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { r1 = ret.Error(1) @@ -1250,15 +1250,15 @@ type Client_ServiceStatus_Call struct { // ServiceStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string func (_e *Client_Expecter) ServiceStatus(_a0 interface{}, _a1 interface{}, _a2 interface{}) *Client_ServiceStatus_Call { return &Client_ServiceStatus_Call{Call: _e.mock.On("ServiceStatus", _a0, _a1, _a2)} } -func (_c *Client_ServiceStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string)) *Client_ServiceStatus_Call { +func (_c *Client_ServiceStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string)) *Client_ServiceStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string)) }) return _c } @@ -1268,17 +1268,17 @@ func (_c *Client_ServiceStatus_Call) Return(_a0 *v1beta3.ServiceStatus, _a1 erro return _c } -func (_c *Client_ServiceStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string) (*v1beta3.ServiceStatus, error)) *Client_ServiceStatus_Call { +func (_c *Client_ServiceStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string) (*v1beta3.ServiceStatus, error)) *Client_ServiceStatus_Call { _c.Call.Return(run) return _c } // TeardownLease provides a mock function with given fields: _a0, _a1 -func (_m *Client) TeardownLease(_a0 context.Context, _a1 marketv1beta3.LeaseID) error { +func (_m *Client) TeardownLease(_a0 context.Context, _a1 v1beta4.LeaseID) error { ret := _m.Called(_a0, _a1) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) error); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) @@ -1294,14 +1294,14 @@ type Client_TeardownLease_Call struct { // TeardownLease is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *Client_Expecter) TeardownLease(_a0 interface{}, _a1 interface{}) *Client_TeardownLease_Call { return &Client_TeardownLease_Call{Call: _e.mock.On("TeardownLease", _a0, _a1)} } -func (_c *Client_TeardownLease_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *Client_TeardownLease_Call { +func (_c *Client_TeardownLease_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *Client_TeardownLease_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -1311,7 +1311,7 @@ func (_c *Client_TeardownLease_Call) Return(_a0 error) *Client_TeardownLease_Cal return _c } -func (_c *Client_TeardownLease_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) error) *Client_TeardownLease_Call { +func (_c *Client_TeardownLease_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) error) *Client_TeardownLease_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/cluster.go b/cluster/mocks/cluster.go index 48aaf2f2e..ada1e1ae5 100644 --- a/cluster/mocks/cluster.go +++ b/cluster/mocks/cluster.go @@ -3,12 +3,11 @@ package mocks import ( - deploymentv1beta3 "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mock "github.com/stretchr/testify/mock" - + v1beta3 "github.com/akash-network/akash-api/go/node/deployment/v1beta3" typesv1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" + mock "github.com/stretchr/testify/mock" - v1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // Cluster is an autogenerated mock type for the Cluster type @@ -25,15 +24,15 @@ func (_m *Cluster) EXPECT() *Cluster_Expecter { } // Reserve provides a mock function with given fields: _a0, _a1 -func (_m *Cluster) Reserve(_a0 v1beta3.OrderID, _a1 deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error) { +func (_m *Cluster) Reserve(_a0 v1beta4.OrderID, _a1 v1beta3.ResourceGroup) (typesv1beta3.Reservation, error) { ret := _m.Called(_a0, _a1) var r0 typesv1beta3.Reservation var r1 error - if rf, ok := ret.Get(0).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error)); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID, v1beta3.ResourceGroup) (typesv1beta3.Reservation, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) typesv1beta3.Reservation); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID, v1beta3.ResourceGroup) typesv1beta3.Reservation); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -41,7 +40,7 @@ func (_m *Cluster) Reserve(_a0 v1beta3.OrderID, _a1 deploymentv1beta3.ResourceGr } } - if rf, ok := ret.Get(1).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) error); ok { + if rf, ok := ret.Get(1).(func(v1beta4.OrderID, v1beta3.ResourceGroup) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -56,15 +55,15 @@ type Cluster_Reserve_Call struct { } // Reserve is a helper method to define mock.On call -// - _a0 v1beta3.OrderID -// - _a1 deploymentv1beta3.ResourceGroup +// - _a0 v1beta4.OrderID +// - _a1 v1beta3.ResourceGroup func (_e *Cluster_Expecter) Reserve(_a0 interface{}, _a1 interface{}) *Cluster_Reserve_Call { return &Cluster_Reserve_Call{Call: _e.mock.On("Reserve", _a0, _a1)} } -func (_c *Cluster_Reserve_Call) Run(run func(_a0 v1beta3.OrderID, _a1 deploymentv1beta3.ResourceGroup)) *Cluster_Reserve_Call { +func (_c *Cluster_Reserve_Call) Run(run func(_a0 v1beta4.OrderID, _a1 v1beta3.ResourceGroup)) *Cluster_Reserve_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(v1beta3.OrderID), args[1].(deploymentv1beta3.ResourceGroup)) + run(args[0].(v1beta4.OrderID), args[1].(v1beta3.ResourceGroup)) }) return _c } @@ -74,17 +73,17 @@ func (_c *Cluster_Reserve_Call) Return(_a0 typesv1beta3.Reservation, _a1 error) return _c } -func (_c *Cluster_Reserve_Call) RunAndReturn(run func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error)) *Cluster_Reserve_Call { +func (_c *Cluster_Reserve_Call) RunAndReturn(run func(v1beta4.OrderID, v1beta3.ResourceGroup) (typesv1beta3.Reservation, error)) *Cluster_Reserve_Call { _c.Call.Return(run) return _c } // Unreserve provides a mock function with given fields: _a0 -func (_m *Cluster) Unreserve(_a0 v1beta3.OrderID) error { +func (_m *Cluster) Unreserve(_a0 v1beta4.OrderID) error { ret := _m.Called(_a0) var r0 error - if rf, ok := ret.Get(0).(func(v1beta3.OrderID) error); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -99,14 +98,14 @@ type Cluster_Unreserve_Call struct { } // Unreserve is a helper method to define mock.On call -// - _a0 v1beta3.OrderID +// - _a0 v1beta4.OrderID func (_e *Cluster_Expecter) Unreserve(_a0 interface{}) *Cluster_Unreserve_Call { return &Cluster_Unreserve_Call{Call: _e.mock.On("Unreserve", _a0)} } -func (_c *Cluster_Unreserve_Call) Run(run func(_a0 v1beta3.OrderID)) *Cluster_Unreserve_Call { +func (_c *Cluster_Unreserve_Call) Run(run func(_a0 v1beta4.OrderID)) *Cluster_Unreserve_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(v1beta3.OrderID)) + run(args[0].(v1beta4.OrderID)) }) return _c } @@ -116,7 +115,7 @@ func (_c *Cluster_Unreserve_Call) Return(_a0 error) *Cluster_Unreserve_Call { return _c } -func (_c *Cluster_Unreserve_Call) RunAndReturn(run func(v1beta3.OrderID) error) *Cluster_Unreserve_Call { +func (_c *Cluster_Unreserve_Call) RunAndReturn(run func(v1beta4.OrderID) error) *Cluster_Unreserve_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/deployment.go b/cluster/mocks/deployment.go index cbf26098a..55795e402 100644 --- a/cluster/mocks/deployment.go +++ b/cluster/mocks/deployment.go @@ -3,7 +3,7 @@ package mocks import ( - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta4" mock "github.com/stretchr/testify/mock" v2beta2 "github.com/akash-network/akash-api/go/manifest/v2beta2" diff --git a/cluster/mocks/hostname_service_client.go b/cluster/mocks/hostname_service_client.go index 4af2fcd12..39393e24a 100644 --- a/cluster/mocks/hostname_service_client.go +++ b/cluster/mocks/hostname_service_client.go @@ -5,10 +5,10 @@ package mocks import ( context "context" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/cosmos/cosmos-sdk/types" mock "github.com/stretchr/testify/mock" - types "github.com/cosmos/cosmos-sdk/types" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // HostnameServiceClient is an autogenerated mock type for the HostnameServiceClient type @@ -68,11 +68,11 @@ func (_c *HostnameServiceClient_CanReserveHostnames_Call) RunAndReturn(run func( } // PrepareHostnamesForTransfer provides a mock function with given fields: ctx, hostnames, leaseID -func (_m *HostnameServiceClient) PrepareHostnamesForTransfer(ctx context.Context, hostnames []string, leaseID marketv1beta3.LeaseID) error { +func (_m *HostnameServiceClient) PrepareHostnamesForTransfer(ctx context.Context, hostnames []string, leaseID v1beta4.LeaseID) error { ret := _m.Called(ctx, hostnames, leaseID) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []string, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, []string, v1beta4.LeaseID) error); ok { r0 = rf(ctx, hostnames, leaseID) } else { r0 = ret.Error(0) @@ -89,14 +89,14 @@ type HostnameServiceClient_PrepareHostnamesForTransfer_Call struct { // PrepareHostnamesForTransfer is a helper method to define mock.On call // - ctx context.Context // - hostnames []string -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *HostnameServiceClient_Expecter) PrepareHostnamesForTransfer(ctx interface{}, hostnames interface{}, leaseID interface{}) *HostnameServiceClient_PrepareHostnamesForTransfer_Call { return &HostnameServiceClient_PrepareHostnamesForTransfer_Call{Call: _e.mock.On("PrepareHostnamesForTransfer", ctx, hostnames, leaseID)} } -func (_c *HostnameServiceClient_PrepareHostnamesForTransfer_Call) Run(run func(ctx context.Context, hostnames []string, leaseID marketv1beta3.LeaseID)) *HostnameServiceClient_PrepareHostnamesForTransfer_Call { +func (_c *HostnameServiceClient_PrepareHostnamesForTransfer_Call) Run(run func(ctx context.Context, hostnames []string, leaseID v1beta4.LeaseID)) *HostnameServiceClient_PrepareHostnamesForTransfer_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]string), args[2].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].([]string), args[2].(v1beta4.LeaseID)) }) return _c } @@ -106,17 +106,17 @@ func (_c *HostnameServiceClient_PrepareHostnamesForTransfer_Call) Return(_a0 err return _c } -func (_c *HostnameServiceClient_PrepareHostnamesForTransfer_Call) RunAndReturn(run func(context.Context, []string, marketv1beta3.LeaseID) error) *HostnameServiceClient_PrepareHostnamesForTransfer_Call { +func (_c *HostnameServiceClient_PrepareHostnamesForTransfer_Call) RunAndReturn(run func(context.Context, []string, v1beta4.LeaseID) error) *HostnameServiceClient_PrepareHostnamesForTransfer_Call { _c.Call.Return(run) return _c } // ReleaseHostnames provides a mock function with given fields: leaseID -func (_m *HostnameServiceClient) ReleaseHostnames(leaseID marketv1beta3.LeaseID) error { +func (_m *HostnameServiceClient) ReleaseHostnames(leaseID v1beta4.LeaseID) error { ret := _m.Called(leaseID) var r0 error - if rf, ok := ret.Get(0).(func(marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(0).(func(v1beta4.LeaseID) error); ok { r0 = rf(leaseID) } else { r0 = ret.Error(0) @@ -131,14 +131,14 @@ type HostnameServiceClient_ReleaseHostnames_Call struct { } // ReleaseHostnames is a helper method to define mock.On call -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *HostnameServiceClient_Expecter) ReleaseHostnames(leaseID interface{}) *HostnameServiceClient_ReleaseHostnames_Call { return &HostnameServiceClient_ReleaseHostnames_Call{Call: _e.mock.On("ReleaseHostnames", leaseID)} } -func (_c *HostnameServiceClient_ReleaseHostnames_Call) Run(run func(leaseID marketv1beta3.LeaseID)) *HostnameServiceClient_ReleaseHostnames_Call { +func (_c *HostnameServiceClient_ReleaseHostnames_Call) Run(run func(leaseID v1beta4.LeaseID)) *HostnameServiceClient_ReleaseHostnames_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(marketv1beta3.LeaseID)) + run(args[0].(v1beta4.LeaseID)) }) return _c } @@ -148,21 +148,21 @@ func (_c *HostnameServiceClient_ReleaseHostnames_Call) Return(_a0 error) *Hostna return _c } -func (_c *HostnameServiceClient_ReleaseHostnames_Call) RunAndReturn(run func(marketv1beta3.LeaseID) error) *HostnameServiceClient_ReleaseHostnames_Call { +func (_c *HostnameServiceClient_ReleaseHostnames_Call) RunAndReturn(run func(v1beta4.LeaseID) error) *HostnameServiceClient_ReleaseHostnames_Call { _c.Call.Return(run) return _c } // ReserveHostnames provides a mock function with given fields: ctx, hostnames, leaseID -func (_m *HostnameServiceClient) ReserveHostnames(ctx context.Context, hostnames []string, leaseID marketv1beta3.LeaseID) ([]string, error) { +func (_m *HostnameServiceClient) ReserveHostnames(ctx context.Context, hostnames []string, leaseID v1beta4.LeaseID) ([]string, error) { ret := _m.Called(ctx, hostnames, leaseID) var r0 []string var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []string, marketv1beta3.LeaseID) ([]string, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []string, v1beta4.LeaseID) ([]string, error)); ok { return rf(ctx, hostnames, leaseID) } - if rf, ok := ret.Get(0).(func(context.Context, []string, marketv1beta3.LeaseID) []string); ok { + if rf, ok := ret.Get(0).(func(context.Context, []string, v1beta4.LeaseID) []string); ok { r0 = rf(ctx, hostnames, leaseID) } else { if ret.Get(0) != nil { @@ -170,7 +170,7 @@ func (_m *HostnameServiceClient) ReserveHostnames(ctx context.Context, hostnames } } - if rf, ok := ret.Get(1).(func(context.Context, []string, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, []string, v1beta4.LeaseID) error); ok { r1 = rf(ctx, hostnames, leaseID) } else { r1 = ret.Error(1) @@ -187,14 +187,14 @@ type HostnameServiceClient_ReserveHostnames_Call struct { // ReserveHostnames is a helper method to define mock.On call // - ctx context.Context // - hostnames []string -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *HostnameServiceClient_Expecter) ReserveHostnames(ctx interface{}, hostnames interface{}, leaseID interface{}) *HostnameServiceClient_ReserveHostnames_Call { return &HostnameServiceClient_ReserveHostnames_Call{Call: _e.mock.On("ReserveHostnames", ctx, hostnames, leaseID)} } -func (_c *HostnameServiceClient_ReserveHostnames_Call) Run(run func(ctx context.Context, hostnames []string, leaseID marketv1beta3.LeaseID)) *HostnameServiceClient_ReserveHostnames_Call { +func (_c *HostnameServiceClient_ReserveHostnames_Call) Run(run func(ctx context.Context, hostnames []string, leaseID v1beta4.LeaseID)) *HostnameServiceClient_ReserveHostnames_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].([]string), args[2].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].([]string), args[2].(v1beta4.LeaseID)) }) return _c } @@ -204,7 +204,7 @@ func (_c *HostnameServiceClient_ReserveHostnames_Call) Return(_a0 []string, _a1 return _c } -func (_c *HostnameServiceClient_ReserveHostnames_Call) RunAndReturn(run func(context.Context, []string, marketv1beta3.LeaseID) ([]string, error)) *HostnameServiceClient_ReserveHostnames_Call { +func (_c *HostnameServiceClient_ReserveHostnames_Call) RunAndReturn(run func(context.Context, []string, v1beta4.LeaseID) ([]string, error)) *HostnameServiceClient_ReserveHostnames_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/i_deployment.go b/cluster/mocks/i_deployment.go index 3910d8da2..83a75e6ce 100644 --- a/cluster/mocks/i_deployment.go +++ b/cluster/mocks/i_deployment.go @@ -3,9 +3,10 @@ package mocks import ( - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" mock "github.com/stretchr/testify/mock" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" + v2beta2 "github.com/akash-network/akash-api/go/manifest/v2beta2" ) @@ -66,14 +67,14 @@ func (_c *IDeployment_ClusterParams_Call) RunAndReturn(run func() interface{}) * } // LeaseID provides a mock function with given fields: -func (_m *IDeployment) LeaseID() marketv1beta3.LeaseID { +func (_m *IDeployment) LeaseID() v1beta4.LeaseID { ret := _m.Called() - var r0 marketv1beta3.LeaseID - if rf, ok := ret.Get(0).(func() marketv1beta3.LeaseID); ok { + var r0 v1beta4.LeaseID + if rf, ok := ret.Get(0).(func() v1beta4.LeaseID); ok { r0 = rf() } else { - r0 = ret.Get(0).(marketv1beta3.LeaseID) + r0 = ret.Get(0).(v1beta4.LeaseID) } return r0 @@ -96,12 +97,12 @@ func (_c *IDeployment_LeaseID_Call) Run(run func()) *IDeployment_LeaseID_Call { return _c } -func (_c *IDeployment_LeaseID_Call) Return(_a0 marketv1beta3.LeaseID) *IDeployment_LeaseID_Call { +func (_c *IDeployment_LeaseID_Call) Return(_a0 v1beta4.LeaseID) *IDeployment_LeaseID_Call { _c.Call.Return(_a0) return _c } -func (_c *IDeployment_LeaseID_Call) RunAndReturn(run func() marketv1beta3.LeaseID) *IDeployment_LeaseID_Call { +func (_c *IDeployment_LeaseID_Call) RunAndReturn(run func() v1beta4.LeaseID) *IDeployment_LeaseID_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/ip_operator_client.go b/cluster/mocks/ip_operator_client.go index d9fc14932..017726089 100644 --- a/cluster/mocks/ip_operator_client.go +++ b/cluster/mocks/ip_operator_client.go @@ -9,7 +9,7 @@ import ( types "github.com/akash-network/provider/operator/ipoperator/types" - v1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // IPOperatorClient is an autogenerated mock type for the IPOperatorClient type @@ -68,15 +68,15 @@ func (_c *IPOperatorClient_Check_Call) RunAndReturn(run func(context.Context) er } // GetIPAddressStatus provides a mock function with given fields: ctx, orderID -func (_m *IPOperatorClient) GetIPAddressStatus(ctx context.Context, orderID v1beta3.OrderID) ([]types.LeaseIPStatus, error) { +func (_m *IPOperatorClient) GetIPAddressStatus(ctx context.Context, orderID v1beta4.OrderID) ([]types.LeaseIPStatus, error) { ret := _m.Called(ctx, orderID) var r0 []types.LeaseIPStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, v1beta3.OrderID) ([]types.LeaseIPStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.OrderID) ([]types.LeaseIPStatus, error)); ok { return rf(ctx, orderID) } - if rf, ok := ret.Get(0).(func(context.Context, v1beta3.OrderID) []types.LeaseIPStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.OrderID) []types.LeaseIPStatus); ok { r0 = rf(ctx, orderID) } else { if ret.Get(0) != nil { @@ -84,7 +84,7 @@ func (_m *IPOperatorClient) GetIPAddressStatus(ctx context.Context, orderID v1be } } - if rf, ok := ret.Get(1).(func(context.Context, v1beta3.OrderID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.OrderID) error); ok { r1 = rf(ctx, orderID) } else { r1 = ret.Error(1) @@ -100,14 +100,14 @@ type IPOperatorClient_GetIPAddressStatus_Call struct { // GetIPAddressStatus is a helper method to define mock.On call // - ctx context.Context -// - orderID v1beta3.OrderID +// - orderID v1beta4.OrderID func (_e *IPOperatorClient_Expecter) GetIPAddressStatus(ctx interface{}, orderID interface{}) *IPOperatorClient_GetIPAddressStatus_Call { return &IPOperatorClient_GetIPAddressStatus_Call{Call: _e.mock.On("GetIPAddressStatus", ctx, orderID)} } -func (_c *IPOperatorClient_GetIPAddressStatus_Call) Run(run func(ctx context.Context, orderID v1beta3.OrderID)) *IPOperatorClient_GetIPAddressStatus_Call { +func (_c *IPOperatorClient_GetIPAddressStatus_Call) Run(run func(ctx context.Context, orderID v1beta4.OrderID)) *IPOperatorClient_GetIPAddressStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(v1beta3.OrderID)) + run(args[0].(context.Context), args[1].(v1beta4.OrderID)) }) return _c } @@ -117,7 +117,7 @@ func (_c *IPOperatorClient_GetIPAddressStatus_Call) Return(_a0 []types.LeaseIPSt return _c } -func (_c *IPOperatorClient_GetIPAddressStatus_Call) RunAndReturn(run func(context.Context, v1beta3.OrderID) ([]types.LeaseIPStatus, error)) *IPOperatorClient_GetIPAddressStatus_Call { +func (_c *IPOperatorClient_GetIPAddressStatus_Call) RunAndReturn(run func(context.Context, v1beta4.OrderID) ([]types.LeaseIPStatus, error)) *IPOperatorClient_GetIPAddressStatus_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/metallb_client.go b/cluster/mocks/metallb_client.go index 90681167c..7c8c502ab 100644 --- a/cluster/mocks/metallb_client.go +++ b/cluster/mocks/metallb_client.go @@ -5,11 +5,11 @@ package mocks import ( context "context" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" - mock "github.com/stretchr/testify/mock" v1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" + + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // MetalLBClient is an autogenerated mock type for the Client type @@ -123,15 +123,15 @@ func (_c *MetalLBClient_DetectPoolChanges_Call) RunAndReturn(run func(context.Co } // GetIPAddressStatusForLease provides a mock function with given fields: ctx, leaseID -func (_m *MetalLBClient) GetIPAddressStatusForLease(ctx context.Context, leaseID marketv1beta3.LeaseID) ([]v1beta3.IPLeaseState, error) { +func (_m *MetalLBClient) GetIPAddressStatusForLease(ctx context.Context, leaseID v1beta4.LeaseID) ([]v1beta3.IPLeaseState, error) { ret := _m.Called(ctx, leaseID) var r0 []v1beta3.IPLeaseState var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) ([]v1beta3.IPLeaseState, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) ([]v1beta3.IPLeaseState, error)); ok { return rf(ctx, leaseID) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) []v1beta3.IPLeaseState); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) []v1beta3.IPLeaseState); ok { r0 = rf(ctx, leaseID) } else { if ret.Get(0) != nil { @@ -139,7 +139,7 @@ func (_m *MetalLBClient) GetIPAddressStatusForLease(ctx context.Context, leaseID } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(ctx, leaseID) } else { r1 = ret.Error(1) @@ -155,14 +155,14 @@ type MetalLBClient_GetIPAddressStatusForLease_Call struct { // GetIPAddressStatusForLease is a helper method to define mock.On call // - ctx context.Context -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *MetalLBClient_Expecter) GetIPAddressStatusForLease(ctx interface{}, leaseID interface{}) *MetalLBClient_GetIPAddressStatusForLease_Call { return &MetalLBClient_GetIPAddressStatusForLease_Call{Call: _e.mock.On("GetIPAddressStatusForLease", ctx, leaseID)} } -func (_c *MetalLBClient_GetIPAddressStatusForLease_Call) Run(run func(ctx context.Context, leaseID marketv1beta3.LeaseID)) *MetalLBClient_GetIPAddressStatusForLease_Call { +func (_c *MetalLBClient_GetIPAddressStatusForLease_Call) Run(run func(ctx context.Context, leaseID v1beta4.LeaseID)) *MetalLBClient_GetIPAddressStatusForLease_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -172,7 +172,7 @@ func (_c *MetalLBClient_GetIPAddressStatusForLease_Call) Return(_a0 []v1beta3.IP return _c } -func (_c *MetalLBClient_GetIPAddressStatusForLease_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) ([]v1beta3.IPLeaseState, error)) *MetalLBClient_GetIPAddressStatusForLease_Call { +func (_c *MetalLBClient_GetIPAddressStatusForLease_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) ([]v1beta3.IPLeaseState, error)) *MetalLBClient_GetIPAddressStatusForLease_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/read_client.go b/cluster/mocks/read_client.go index ca3fa3491..1e4ba2721 100644 --- a/cluster/mocks/read_client.go +++ b/cluster/mocks/read_client.go @@ -5,10 +5,10 @@ package mocks import ( context "context" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + v1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" mock "github.com/stretchr/testify/mock" - v1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" v2beta2 "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2" ) @@ -81,15 +81,15 @@ func (_c *ReadClient_AllHostnames_Call) RunAndReturn(run func(context.Context) ( } // ForwardedPortStatus provides a mock function with given fields: _a0, _a1 -func (_m *ReadClient) ForwardedPortStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error) { +func (_m *ReadClient) ForwardedPortStatus(_a0 context.Context, _a1 v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error) { ret := _m.Called(_a0, _a1) var r0 map[string][]v1beta3.ForwardedPortStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) map[string][]v1beta3.ForwardedPortStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) map[string][]v1beta3.ForwardedPortStatus); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -97,7 +97,7 @@ func (_m *ReadClient) ForwardedPortStatus(_a0 context.Context, _a1 marketv1beta3 } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -113,14 +113,14 @@ type ReadClient_ForwardedPortStatus_Call struct { // ForwardedPortStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *ReadClient_Expecter) ForwardedPortStatus(_a0 interface{}, _a1 interface{}) *ReadClient_ForwardedPortStatus_Call { return &ReadClient_ForwardedPortStatus_Call{Call: _e.mock.On("ForwardedPortStatus", _a0, _a1)} } -func (_c *ReadClient_ForwardedPortStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *ReadClient_ForwardedPortStatus_Call { +func (_c *ReadClient_ForwardedPortStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *ReadClient_ForwardedPortStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -130,21 +130,21 @@ func (_c *ReadClient_ForwardedPortStatus_Call) Return(_a0 map[string][]v1beta3.F return _c } -func (_c *ReadClient_ForwardedPortStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)) *ReadClient_ForwardedPortStatus_Call { +func (_c *ReadClient_ForwardedPortStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (map[string][]v1beta3.ForwardedPortStatus, error)) *ReadClient_ForwardedPortStatus_Call { _c.Call.Return(run) return _c } // GetDeclaredIPs provides a mock function with given fields: ctx, leaseID -func (_m *ReadClient) GetDeclaredIPs(ctx context.Context, leaseID marketv1beta3.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error) { +func (_m *ReadClient) GetDeclaredIPs(ctx context.Context, leaseID v1beta4.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error) { ret := _m.Called(ctx, leaseID) var r0 []v2beta2.ProviderLeasedIPSpec var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error)); ok { return rf(ctx, leaseID) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) []v2beta2.ProviderLeasedIPSpec); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) []v2beta2.ProviderLeasedIPSpec); ok { r0 = rf(ctx, leaseID) } else { if ret.Get(0) != nil { @@ -152,7 +152,7 @@ func (_m *ReadClient) GetDeclaredIPs(ctx context.Context, leaseID marketv1beta3. } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(ctx, leaseID) } else { r1 = ret.Error(1) @@ -168,14 +168,14 @@ type ReadClient_GetDeclaredIPs_Call struct { // GetDeclaredIPs is a helper method to define mock.On call // - ctx context.Context -// - leaseID marketv1beta3.LeaseID +// - leaseID v1beta4.LeaseID func (_e *ReadClient_Expecter) GetDeclaredIPs(ctx interface{}, leaseID interface{}) *ReadClient_GetDeclaredIPs_Call { return &ReadClient_GetDeclaredIPs_Call{Call: _e.mock.On("GetDeclaredIPs", ctx, leaseID)} } -func (_c *ReadClient_GetDeclaredIPs_Call) Run(run func(ctx context.Context, leaseID marketv1beta3.LeaseID)) *ReadClient_GetDeclaredIPs_Call { +func (_c *ReadClient_GetDeclaredIPs_Call) Run(run func(ctx context.Context, leaseID v1beta4.LeaseID)) *ReadClient_GetDeclaredIPs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -185,7 +185,7 @@ func (_c *ReadClient_GetDeclaredIPs_Call) Return(_a0 []v2beta2.ProviderLeasedIPS return _c } -func (_c *ReadClient_GetDeclaredIPs_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error)) *ReadClient_GetDeclaredIPs_Call { +func (_c *ReadClient_GetDeclaredIPs_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) ([]v2beta2.ProviderLeasedIPSpec, error)) *ReadClient_GetDeclaredIPs_Call { _c.Call.Return(run) return _c } @@ -245,28 +245,28 @@ func (_c *ReadClient_GetHostnameDeploymentConnections_Call) RunAndReturn(run fun } // GetManifestGroup provides a mock function with given fields: _a0, _a1 -func (_m *ReadClient) GetManifestGroup(_a0 context.Context, _a1 marketv1beta3.LeaseID) (bool, v2beta2.ManifestGroup, error) { +func (_m *ReadClient) GetManifestGroup(_a0 context.Context, _a1 v1beta4.LeaseID) (bool, v2beta2.ManifestGroup, error) { ret := _m.Called(_a0, _a1) var r0 bool var r1 v2beta2.ManifestGroup var r2 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (bool, v2beta2.ManifestGroup, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (bool, v2beta2.ManifestGroup, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) bool); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) bool); ok { r0 = rf(_a0, _a1) } else { r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) v2beta2.ManifestGroup); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) v2beta2.ManifestGroup); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Get(1).(v2beta2.ManifestGroup) } - if rf, ok := ret.Get(2).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(2).(func(context.Context, v1beta4.LeaseID) error); ok { r2 = rf(_a0, _a1) } else { r2 = ret.Error(2) @@ -282,14 +282,14 @@ type ReadClient_GetManifestGroup_Call struct { // GetManifestGroup is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *ReadClient_Expecter) GetManifestGroup(_a0 interface{}, _a1 interface{}) *ReadClient_GetManifestGroup_Call { return &ReadClient_GetManifestGroup_Call{Call: _e.mock.On("GetManifestGroup", _a0, _a1)} } -func (_c *ReadClient_GetManifestGroup_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *ReadClient_GetManifestGroup_Call { +func (_c *ReadClient_GetManifestGroup_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *ReadClient_GetManifestGroup_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -299,21 +299,21 @@ func (_c *ReadClient_GetManifestGroup_Call) Return(_a0 bool, _a1 v2beta2.Manifes return _c } -func (_c *ReadClient_GetManifestGroup_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (bool, v2beta2.ManifestGroup, error)) *ReadClient_GetManifestGroup_Call { +func (_c *ReadClient_GetManifestGroup_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (bool, v2beta2.ManifestGroup, error)) *ReadClient_GetManifestGroup_Call { _c.Call.Return(run) return _c } // LeaseEvents provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *ReadClient) LeaseEvents(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool) (v1beta3.EventsWatcher, error) { +func (_m *ReadClient) LeaseEvents(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool) (v1beta3.EventsWatcher, error) { ret := _m.Called(_a0, _a1, _a2, _a3) var r0 v1beta3.EventsWatcher var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool) (v1beta3.EventsWatcher, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool) (v1beta3.EventsWatcher, error)); ok { return rf(_a0, _a1, _a2, _a3) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool) v1beta3.EventsWatcher); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool) v1beta3.EventsWatcher); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { if ret.Get(0) != nil { @@ -321,7 +321,7 @@ func (_m *ReadClient) LeaseEvents(_a0 context.Context, _a1 marketv1beta3.LeaseID } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string, bool) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string, bool) error); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { r1 = ret.Error(1) @@ -337,16 +337,16 @@ type ReadClient_LeaseEvents_Call struct { // LeaseEvents is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string // - _a3 bool func (_e *ReadClient_Expecter) LeaseEvents(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *ReadClient_LeaseEvents_Call { return &ReadClient_LeaseEvents_Call{Call: _e.mock.On("LeaseEvents", _a0, _a1, _a2, _a3)} } -func (_c *ReadClient_LeaseEvents_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool)) *ReadClient_LeaseEvents_Call { +func (_c *ReadClient_LeaseEvents_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool)) *ReadClient_LeaseEvents_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(bool)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(bool)) }) return _c } @@ -356,21 +356,21 @@ func (_c *ReadClient_LeaseEvents_Call) Return(_a0 v1beta3.EventsWatcher, _a1 err return _c } -func (_c *ReadClient_LeaseEvents_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, bool) (v1beta3.EventsWatcher, error)) *ReadClient_LeaseEvents_Call { +func (_c *ReadClient_LeaseEvents_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, bool) (v1beta3.EventsWatcher, error)) *ReadClient_LeaseEvents_Call { _c.Call.Return(run) return _c } // LeaseLogs provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 -func (_m *ReadClient) LeaseLogs(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool, _a4 *int64) ([]*v1beta3.ServiceLog, error) { +func (_m *ReadClient) LeaseLogs(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool, _a4 *int64) ([]*v1beta3.ServiceLog, error) { ret := _m.Called(_a0, _a1, _a2, _a3, _a4) var r0 []*v1beta3.ServiceLog var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)); ok { return rf(_a0, _a1, _a2, _a3, _a4) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) []*v1beta3.ServiceLog); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) []*v1beta3.ServiceLog); ok { r0 = rf(_a0, _a1, _a2, _a3, _a4) } else { if ret.Get(0) != nil { @@ -378,7 +378,7 @@ func (_m *ReadClient) LeaseLogs(_a0 context.Context, _a1 marketv1beta3.LeaseID, } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string, bool, *int64) error); ok { r1 = rf(_a0, _a1, _a2, _a3, _a4) } else { r1 = ret.Error(1) @@ -394,7 +394,7 @@ type ReadClient_LeaseLogs_Call struct { // LeaseLogs is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string // - _a3 bool // - _a4 *int64 @@ -402,9 +402,9 @@ func (_e *ReadClient_Expecter) LeaseLogs(_a0 interface{}, _a1 interface{}, _a2 i return &ReadClient_LeaseLogs_Call{Call: _e.mock.On("LeaseLogs", _a0, _a1, _a2, _a3, _a4)} } -func (_c *ReadClient_LeaseLogs_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string, _a3 bool, _a4 *int64)) *ReadClient_LeaseLogs_Call { +func (_c *ReadClient_LeaseLogs_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string, _a3 bool, _a4 *int64)) *ReadClient_LeaseLogs_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string), args[3].(bool), args[4].(*int64)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(bool), args[4].(*int64)) }) return _c } @@ -414,21 +414,21 @@ func (_c *ReadClient_LeaseLogs_Call) Return(_a0 []*v1beta3.ServiceLog, _a1 error return _c } -func (_c *ReadClient_LeaseLogs_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)) *ReadClient_LeaseLogs_Call { +func (_c *ReadClient_LeaseLogs_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, bool, *int64) ([]*v1beta3.ServiceLog, error)) *ReadClient_LeaseLogs_Call { _c.Call.Return(run) return _c } // LeaseStatus provides a mock function with given fields: _a0, _a1 -func (_m *ReadClient) LeaseStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error) { +func (_m *ReadClient) LeaseStatus(_a0 context.Context, _a1 v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error) { ret := _m.Called(_a0, _a1) var r0 map[string]*v1beta3.ServiceStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID) map[string]*v1beta3.ServiceStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID) map[string]*v1beta3.ServiceStatus); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { @@ -436,7 +436,7 @@ func (_m *ReadClient) LeaseStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -452,14 +452,14 @@ type ReadClient_LeaseStatus_Call struct { // LeaseStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID func (_e *ReadClient_Expecter) LeaseStatus(_a0 interface{}, _a1 interface{}) *ReadClient_LeaseStatus_Call { return &ReadClient_LeaseStatus_Call{Call: _e.mock.On("LeaseStatus", _a0, _a1)} } -func (_c *ReadClient_LeaseStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID)) *ReadClient_LeaseStatus_Call { +func (_c *ReadClient_LeaseStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID)) *ReadClient_LeaseStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID)) }) return _c } @@ -469,7 +469,7 @@ func (_c *ReadClient_LeaseStatus_Call) Return(_a0 map[string]*v1beta3.ServiceSta return _c } -func (_c *ReadClient_LeaseStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID) (map[string]*v1beta3.ServiceStatus, error)) *ReadClient_LeaseStatus_Call { +func (_c *ReadClient_LeaseStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID) (map[string]*v1beta3.ServiceStatus, error)) *ReadClient_LeaseStatus_Call { _c.Call.Return(run) return _c } @@ -583,15 +583,15 @@ func (_c *ReadClient_ObserveIPState_Call) RunAndReturn(run func(context.Context) } // ServiceStatus provides a mock function with given fields: _a0, _a1, _a2 -func (_m *ReadClient) ServiceStatus(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string) (*v1beta3.ServiceStatus, error) { +func (_m *ReadClient) ServiceStatus(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string) (*v1beta3.ServiceStatus, error) { ret := _m.Called(_a0, _a1, _a2) var r0 *v1beta3.ServiceStatus var r1 error - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string) (*v1beta3.ServiceStatus, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string) (*v1beta3.ServiceStatus, error)); ok { return rf(_a0, _a1, _a2) } - if rf, ok := ret.Get(0).(func(context.Context, marketv1beta3.LeaseID, string) *v1beta3.ServiceStatus); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string) *v1beta3.ServiceStatus); ok { r0 = rf(_a0, _a1, _a2) } else { if ret.Get(0) != nil { @@ -599,7 +599,7 @@ func (_m *ReadClient) ServiceStatus(_a0 context.Context, _a1 marketv1beta3.Lease } } - if rf, ok := ret.Get(1).(func(context.Context, marketv1beta3.LeaseID, string) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, v1beta4.LeaseID, string) error); ok { r1 = rf(_a0, _a1, _a2) } else { r1 = ret.Error(1) @@ -615,15 +615,15 @@ type ReadClient_ServiceStatus_Call struct { // ServiceStatus is a helper method to define mock.On call // - _a0 context.Context -// - _a1 marketv1beta3.LeaseID +// - _a1 v1beta4.LeaseID // - _a2 string func (_e *ReadClient_Expecter) ServiceStatus(_a0 interface{}, _a1 interface{}, _a2 interface{}) *ReadClient_ServiceStatus_Call { return &ReadClient_ServiceStatus_Call{Call: _e.mock.On("ServiceStatus", _a0, _a1, _a2)} } -func (_c *ReadClient_ServiceStatus_Call) Run(run func(_a0 context.Context, _a1 marketv1beta3.LeaseID, _a2 string)) *ReadClient_ServiceStatus_Call { +func (_c *ReadClient_ServiceStatus_Call) Run(run func(_a0 context.Context, _a1 v1beta4.LeaseID, _a2 string)) *ReadClient_ServiceStatus_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(marketv1beta3.LeaseID), args[2].(string)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string)) }) return _c } @@ -633,7 +633,7 @@ func (_c *ReadClient_ServiceStatus_Call) Return(_a0 *v1beta3.ServiceStatus, _a1 return _c } -func (_c *ReadClient_ServiceStatus_Call) RunAndReturn(run func(context.Context, marketv1beta3.LeaseID, string) (*v1beta3.ServiceStatus, error)) *ReadClient_ServiceStatus_Call { +func (_c *ReadClient_ServiceStatus_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string) (*v1beta3.ServiceStatus, error)) *ReadClient_ServiceStatus_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/reservation.go b/cluster/mocks/reservation.go index be5340911..6dd7149a0 100644 --- a/cluster/mocks/reservation.go +++ b/cluster/mocks/reservation.go @@ -4,9 +4,9 @@ package mocks import ( deploymentv1beta3 "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - marketv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" - mock "github.com/stretchr/testify/mock" + + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // Reservation is an autogenerated mock type for the Reservation type @@ -106,15 +106,58 @@ func (_c *Reservation_ClusterParams_Call) RunAndReturn(run func() interface{}) * return _c } +// GetAllocatedResources provides a mock function with given fields: +func (_m *Reservation) GetAllocatedResources() deploymentv1beta3.ResourceUnits { + ret := _m.Called() + + var r0 deploymentv1beta3.ResourceUnits + if rf, ok := ret.Get(0).(func() deploymentv1beta3.ResourceUnits); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(deploymentv1beta3.ResourceUnits) + } + } + + return r0 +} + +// Reservation_GetAllocatedResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedResources' +type Reservation_GetAllocatedResources_Call struct { + *mock.Call +} + +// GetAllocatedResources is a helper method to define mock.On call +func (_e *Reservation_Expecter) GetAllocatedResources() *Reservation_GetAllocatedResources_Call { + return &Reservation_GetAllocatedResources_Call{Call: _e.mock.On("GetAllocatedResources")} +} + +func (_c *Reservation_GetAllocatedResources_Call) Run(run func()) *Reservation_GetAllocatedResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Reservation_GetAllocatedResources_Call) Return(_a0 deploymentv1beta3.ResourceUnits) *Reservation_GetAllocatedResources_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Reservation_GetAllocatedResources_Call) RunAndReturn(run func() deploymentv1beta3.ResourceUnits) *Reservation_GetAllocatedResources_Call { + _c.Call.Return(run) + return _c +} + // OrderID provides a mock function with given fields: -func (_m *Reservation) OrderID() marketv1beta3.OrderID { +func (_m *Reservation) OrderID() v1beta4.OrderID { ret := _m.Called() - var r0 marketv1beta3.OrderID - if rf, ok := ret.Get(0).(func() marketv1beta3.OrderID); ok { + var r0 v1beta4.OrderID + if rf, ok := ret.Get(0).(func() v1beta4.OrderID); ok { r0 = rf() } else { - r0 = ret.Get(0).(marketv1beta3.OrderID) + r0 = ret.Get(0).(v1beta4.OrderID) } return r0 @@ -137,12 +180,12 @@ func (_c *Reservation_OrderID_Call) Run(run func()) *Reservation_OrderID_Call { return _c } -func (_c *Reservation_OrderID_Call) Return(_a0 marketv1beta3.OrderID) *Reservation_OrderID_Call { +func (_c *Reservation_OrderID_Call) Return(_a0 v1beta4.OrderID) *Reservation_OrderID_Call { _c.Call.Return(_a0) return _c } -func (_c *Reservation_OrderID_Call) RunAndReturn(run func() marketv1beta3.OrderID) *Reservation_OrderID_Call { +func (_c *Reservation_OrderID_Call) RunAndReturn(run func() v1beta4.OrderID) *Reservation_OrderID_Call { _c.Call.Return(run) return _c } diff --git a/cluster/mocks/reservation_group.go b/cluster/mocks/reservation_group.go index 0df96d31e..6735d7595 100644 --- a/cluster/mocks/reservation_group.go +++ b/cluster/mocks/reservation_group.go @@ -63,6 +63,49 @@ func (_c *ReservationGroup_ClusterParams_Call) RunAndReturn(run func() interface return _c } +// GetAllocatedResources provides a mock function with given fields: +func (_m *ReservationGroup) GetAllocatedResources() deploymentv1beta3.ResourceUnits { + ret := _m.Called() + + var r0 deploymentv1beta3.ResourceUnits + if rf, ok := ret.Get(0).(func() deploymentv1beta3.ResourceUnits); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(deploymentv1beta3.ResourceUnits) + } + } + + return r0 +} + +// ReservationGroup_GetAllocatedResources_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllocatedResources' +type ReservationGroup_GetAllocatedResources_Call struct { + *mock.Call +} + +// GetAllocatedResources is a helper method to define mock.On call +func (_e *ReservationGroup_Expecter) GetAllocatedResources() *ReservationGroup_GetAllocatedResources_Call { + return &ReservationGroup_GetAllocatedResources_Call{Call: _e.mock.On("GetAllocatedResources")} +} + +func (_c *ReservationGroup_GetAllocatedResources_Call) Run(run func()) *ReservationGroup_GetAllocatedResources_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *ReservationGroup_GetAllocatedResources_Call) Return(_a0 deploymentv1beta3.ResourceUnits) *ReservationGroup_GetAllocatedResources_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *ReservationGroup_GetAllocatedResources_Call) RunAndReturn(run func() deploymentv1beta3.ResourceUnits) *ReservationGroup_GetAllocatedResources_Call { + _c.Call.Return(run) + return _c +} + // Resources provides a mock function with given fields: func (_m *ReservationGroup) Resources() deploymentv1beta3.ResourceGroup { ret := _m.Called() diff --git a/cluster/mocks/service.go b/cluster/mocks/service.go index 348a8d2e3..6abc903e9 100644 --- a/cluster/mocks/service.go +++ b/cluster/mocks/service.go @@ -10,9 +10,9 @@ import ( types "github.com/cosmos/cosmos-sdk/types" - typesv1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" + v1beta3 "github.com/akash-network/provider/cluster/types/v1beta3" - v1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + v1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" v2beta2 "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2" ) @@ -115,14 +115,14 @@ func (_c *Service_Done_Call) RunAndReturn(run func() <-chan struct{}) *Service_D } // FindActiveLease provides a mock function with given fields: ctx, owner, dseq, gseq -func (_m *Service) FindActiveLease(ctx context.Context, owner types.Address, dseq uint64, gseq uint32) (bool, v1beta3.LeaseID, v2beta2.ManifestGroup, error) { +func (_m *Service) FindActiveLease(ctx context.Context, owner types.Address, dseq uint64, gseq uint32) (bool, v1beta4.LeaseID, v2beta2.ManifestGroup, error) { ret := _m.Called(ctx, owner, dseq, gseq) var r0 bool - var r1 v1beta3.LeaseID + var r1 v1beta4.LeaseID var r2 v2beta2.ManifestGroup var r3 error - if rf, ok := ret.Get(0).(func(context.Context, types.Address, uint64, uint32) (bool, v1beta3.LeaseID, v2beta2.ManifestGroup, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, types.Address, uint64, uint32) (bool, v1beta4.LeaseID, v2beta2.ManifestGroup, error)); ok { return rf(ctx, owner, dseq, gseq) } if rf, ok := ret.Get(0).(func(context.Context, types.Address, uint64, uint32) bool); ok { @@ -131,10 +131,10 @@ func (_m *Service) FindActiveLease(ctx context.Context, owner types.Address, dse r0 = ret.Get(0).(bool) } - if rf, ok := ret.Get(1).(func(context.Context, types.Address, uint64, uint32) v1beta3.LeaseID); ok { + if rf, ok := ret.Get(1).(func(context.Context, types.Address, uint64, uint32) v1beta4.LeaseID); ok { r1 = rf(ctx, owner, dseq, gseq) } else { - r1 = ret.Get(1).(v1beta3.LeaseID) + r1 = ret.Get(1).(v1beta4.LeaseID) } if rf, ok := ret.Get(2).(func(context.Context, types.Address, uint64, uint32) v2beta2.ManifestGroup); ok { @@ -173,26 +173,26 @@ func (_c *Service_FindActiveLease_Call) Run(run func(ctx context.Context, owner return _c } -func (_c *Service_FindActiveLease_Call) Return(_a0 bool, _a1 v1beta3.LeaseID, _a2 v2beta2.ManifestGroup, _a3 error) *Service_FindActiveLease_Call { +func (_c *Service_FindActiveLease_Call) Return(_a0 bool, _a1 v1beta4.LeaseID, _a2 v2beta2.ManifestGroup, _a3 error) *Service_FindActiveLease_Call { _c.Call.Return(_a0, _a1, _a2, _a3) return _c } -func (_c *Service_FindActiveLease_Call) RunAndReturn(run func(context.Context, types.Address, uint64, uint32) (bool, v1beta3.LeaseID, v2beta2.ManifestGroup, error)) *Service_FindActiveLease_Call { +func (_c *Service_FindActiveLease_Call) RunAndReturn(run func(context.Context, types.Address, uint64, uint32) (bool, v1beta4.LeaseID, v2beta2.ManifestGroup, error)) *Service_FindActiveLease_Call { _c.Call.Return(run) return _c } // HostnameService provides a mock function with given fields: -func (_m *Service) HostnameService() typesv1beta3.HostnameServiceClient { +func (_m *Service) HostnameService() v1beta3.HostnameServiceClient { ret := _m.Called() - var r0 typesv1beta3.HostnameServiceClient - if rf, ok := ret.Get(0).(func() typesv1beta3.HostnameServiceClient); ok { + var r0 v1beta3.HostnameServiceClient + if rf, ok := ret.Get(0).(func() v1beta3.HostnameServiceClient); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(typesv1beta3.HostnameServiceClient) + r0 = ret.Get(0).(v1beta3.HostnameServiceClient) } } @@ -216,12 +216,12 @@ func (_c *Service_HostnameService_Call) Run(run func()) *Service_HostnameService return _c } -func (_c *Service_HostnameService_Call) Return(_a0 typesv1beta3.HostnameServiceClient) *Service_HostnameService_Call { +func (_c *Service_HostnameService_Call) Return(_a0 v1beta3.HostnameServiceClient) *Service_HostnameService_Call { _c.Call.Return(_a0) return _c } -func (_c *Service_HostnameService_Call) RunAndReturn(run func() typesv1beta3.HostnameServiceClient) *Service_HostnameService_Call { +func (_c *Service_HostnameService_Call) RunAndReturn(run func() v1beta3.HostnameServiceClient) *Service_HostnameService_Call { _c.Call.Return(run) return _c } @@ -270,23 +270,23 @@ func (_c *Service_Ready_Call) RunAndReturn(run func() <-chan struct{}) *Service_ } // Reserve provides a mock function with given fields: _a0, _a1 -func (_m *Service) Reserve(_a0 v1beta3.OrderID, _a1 deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error) { +func (_m *Service) Reserve(_a0 v1beta4.OrderID, _a1 deploymentv1beta3.ResourceGroup) (v1beta3.Reservation, error) { ret := _m.Called(_a0, _a1) - var r0 typesv1beta3.Reservation + var r0 v1beta3.Reservation var r1 error - if rf, ok := ret.Get(0).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error)); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID, deploymentv1beta3.ResourceGroup) (v1beta3.Reservation, error)); ok { return rf(_a0, _a1) } - if rf, ok := ret.Get(0).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) typesv1beta3.Reservation); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID, deploymentv1beta3.ResourceGroup) v1beta3.Reservation); ok { r0 = rf(_a0, _a1) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(typesv1beta3.Reservation) + r0 = ret.Get(0).(v1beta3.Reservation) } } - if rf, ok := ret.Get(1).(func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) error); ok { + if rf, ok := ret.Get(1).(func(v1beta4.OrderID, deploymentv1beta3.ResourceGroup) error); ok { r1 = rf(_a0, _a1) } else { r1 = ret.Error(1) @@ -301,43 +301,43 @@ type Service_Reserve_Call struct { } // Reserve is a helper method to define mock.On call -// - _a0 v1beta3.OrderID +// - _a0 v1beta4.OrderID // - _a1 deploymentv1beta3.ResourceGroup func (_e *Service_Expecter) Reserve(_a0 interface{}, _a1 interface{}) *Service_Reserve_Call { return &Service_Reserve_Call{Call: _e.mock.On("Reserve", _a0, _a1)} } -func (_c *Service_Reserve_Call) Run(run func(_a0 v1beta3.OrderID, _a1 deploymentv1beta3.ResourceGroup)) *Service_Reserve_Call { +func (_c *Service_Reserve_Call) Run(run func(_a0 v1beta4.OrderID, _a1 deploymentv1beta3.ResourceGroup)) *Service_Reserve_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(v1beta3.OrderID), args[1].(deploymentv1beta3.ResourceGroup)) + run(args[0].(v1beta4.OrderID), args[1].(deploymentv1beta3.ResourceGroup)) }) return _c } -func (_c *Service_Reserve_Call) Return(_a0 typesv1beta3.Reservation, _a1 error) *Service_Reserve_Call { +func (_c *Service_Reserve_Call) Return(_a0 v1beta3.Reservation, _a1 error) *Service_Reserve_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Service_Reserve_Call) RunAndReturn(run func(v1beta3.OrderID, deploymentv1beta3.ResourceGroup) (typesv1beta3.Reservation, error)) *Service_Reserve_Call { +func (_c *Service_Reserve_Call) RunAndReturn(run func(v1beta4.OrderID, deploymentv1beta3.ResourceGroup) (v1beta3.Reservation, error)) *Service_Reserve_Call { _c.Call.Return(run) return _c } // Status provides a mock function with given fields: _a0 -func (_m *Service) Status(_a0 context.Context) (*typesv1beta3.Status, error) { +func (_m *Service) Status(_a0 context.Context) (*v1beta3.Status, error) { ret := _m.Called(_a0) - var r0 *typesv1beta3.Status + var r0 *v1beta3.Status var r1 error - if rf, ok := ret.Get(0).(func(context.Context) (*typesv1beta3.Status, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) (*v1beta3.Status, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(context.Context) *typesv1beta3.Status); ok { + if rf, ok := ret.Get(0).(func(context.Context) *v1beta3.Status); ok { r0 = rf(_a0) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*typesv1beta3.Status) + r0 = ret.Get(0).(*v1beta3.Status) } } @@ -368,22 +368,22 @@ func (_c *Service_Status_Call) Run(run func(_a0 context.Context)) *Service_Statu return _c } -func (_c *Service_Status_Call) Return(_a0 *typesv1beta3.Status, _a1 error) *Service_Status_Call { +func (_c *Service_Status_Call) Return(_a0 *v1beta3.Status, _a1 error) *Service_Status_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Service_Status_Call) RunAndReturn(run func(context.Context) (*typesv1beta3.Status, error)) *Service_Status_Call { +func (_c *Service_Status_Call) RunAndReturn(run func(context.Context) (*v1beta3.Status, error)) *Service_Status_Call { _c.Call.Return(run) return _c } // TransferHostname provides a mock function with given fields: ctx, leaseID, hostname, serviceName, externalPort -func (_m *Service) TransferHostname(ctx context.Context, leaseID v1beta3.LeaseID, hostname string, serviceName string, externalPort uint32) error { +func (_m *Service) TransferHostname(ctx context.Context, leaseID v1beta4.LeaseID, hostname string, serviceName string, externalPort uint32) error { ret := _m.Called(ctx, leaseID, hostname, serviceName, externalPort) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, v1beta3.LeaseID, string, string, uint32) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, v1beta4.LeaseID, string, string, uint32) error); ok { r0 = rf(ctx, leaseID, hostname, serviceName, externalPort) } else { r0 = ret.Error(0) @@ -399,7 +399,7 @@ type Service_TransferHostname_Call struct { // TransferHostname is a helper method to define mock.On call // - ctx context.Context -// - leaseID v1beta3.LeaseID +// - leaseID v1beta4.LeaseID // - hostname string // - serviceName string // - externalPort uint32 @@ -407,9 +407,9 @@ func (_e *Service_Expecter) TransferHostname(ctx interface{}, leaseID interface{ return &Service_TransferHostname_Call{Call: _e.mock.On("TransferHostname", ctx, leaseID, hostname, serviceName, externalPort)} } -func (_c *Service_TransferHostname_Call) Run(run func(ctx context.Context, leaseID v1beta3.LeaseID, hostname string, serviceName string, externalPort uint32)) *Service_TransferHostname_Call { +func (_c *Service_TransferHostname_Call) Run(run func(ctx context.Context, leaseID v1beta4.LeaseID, hostname string, serviceName string, externalPort uint32)) *Service_TransferHostname_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(v1beta3.LeaseID), args[2].(string), args[3].(string), args[4].(uint32)) + run(args[0].(context.Context), args[1].(v1beta4.LeaseID), args[2].(string), args[3].(string), args[4].(uint32)) }) return _c } @@ -419,17 +419,17 @@ func (_c *Service_TransferHostname_Call) Return(_a0 error) *Service_TransferHost return _c } -func (_c *Service_TransferHostname_Call) RunAndReturn(run func(context.Context, v1beta3.LeaseID, string, string, uint32) error) *Service_TransferHostname_Call { +func (_c *Service_TransferHostname_Call) RunAndReturn(run func(context.Context, v1beta4.LeaseID, string, string, uint32) error) *Service_TransferHostname_Call { _c.Call.Return(run) return _c } // Unreserve provides a mock function with given fields: _a0 -func (_m *Service) Unreserve(_a0 v1beta3.OrderID) error { +func (_m *Service) Unreserve(_a0 v1beta4.OrderID) error { ret := _m.Called(_a0) var r0 error - if rf, ok := ret.Get(0).(func(v1beta3.OrderID) error); ok { + if rf, ok := ret.Get(0).(func(v1beta4.OrderID) error); ok { r0 = rf(_a0) } else { r0 = ret.Error(0) @@ -444,14 +444,14 @@ type Service_Unreserve_Call struct { } // Unreserve is a helper method to define mock.On call -// - _a0 v1beta3.OrderID +// - _a0 v1beta4.OrderID func (_e *Service_Expecter) Unreserve(_a0 interface{}) *Service_Unreserve_Call { return &Service_Unreserve_Call{Call: _e.mock.On("Unreserve", _a0)} } -func (_c *Service_Unreserve_Call) Run(run func(_a0 v1beta3.OrderID)) *Service_Unreserve_Call { +func (_c *Service_Unreserve_Call) Run(run func(_a0 v1beta4.OrderID)) *Service_Unreserve_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(v1beta3.OrderID)) + run(args[0].(v1beta4.OrderID)) }) return _c } @@ -461,7 +461,7 @@ func (_c *Service_Unreserve_Call) Return(_a0 error) *Service_Unreserve_Call { return _c } -func (_c *Service_Unreserve_Call) RunAndReturn(run func(v1beta3.OrderID) error) *Service_Unreserve_Call { +func (_c *Service_Unreserve_Call) RunAndReturn(run func(v1beta4.OrderID) error) *Service_Unreserve_Call { _c.Call.Return(run) return _c } diff --git a/cluster/monitor.go b/cluster/monitor.go index 5a4e8e2ad..745a4ee1f 100644 --- a/cluster/monitor.go +++ b/cluster/monitor.go @@ -11,7 +11,7 @@ import ( "github.com/boz/go-lifecycle" "github.com/tendermint/tendermint/libs/log" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" "github.com/akash-network/node/util/runner" diff --git a/cluster/operatorclients/ip_operator_client.go b/cluster/operatorclients/ip_operator_client.go index 47ff481b7..2f17e1b11 100644 --- a/cluster/operatorclients/ip_operator_client.go +++ b/cluster/operatorclients/ip_operator_client.go @@ -15,7 +15,7 @@ import ( "github.com/tendermint/tendermint/libs/log" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clusterutil "github.com/akash-network/provider/cluster/util" ipoptypes "github.com/akash-network/provider/operator/ipoperator/types" diff --git a/cluster/reservation.go b/cluster/reservation.go index 8ad47f4b9..a0abeb04c 100644 --- a/cluster/reservation.go +++ b/cluster/reservation.go @@ -2,7 +2,7 @@ package cluster import ( dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" atypes "github.com/akash-network/akash-api/go/node/types/v1beta3" ctypes "github.com/akash-network/provider/cluster/types/v1beta3" @@ -40,6 +40,10 @@ func (r *reservation) SetAllocatedResources(val dtypes.ResourceUnits) { r.adjustedResources = val } +func (r *reservation) GetAllocatedResources() dtypes.ResourceUnits { + return r.adjustedResources +} + func (r *reservation) SetClusterParams(val interface{}) { r.clusterParams = val } diff --git a/cluster/service.go b/cluster/service.go index cbf2012c3..25fa36274 100644 --- a/cluster/service.go +++ b/cluster/service.go @@ -13,7 +13,7 @@ import ( "github.com/tendermint/tendermint/libs/log" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" "github.com/akash-network/provider/cluster/operatorclients" diff --git a/cluster/types/v1beta3/deployment.go b/cluster/types/v1beta3/deployment.go index cb65632e3..8d59cba31 100644 --- a/cluster/types/v1beta3/deployment.go +++ b/cluster/types/v1beta3/deployment.go @@ -2,7 +2,7 @@ package v1beta3 import ( maniv2beta2 "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // IDeployment interface defined with LeaseID and ManifestGroup methods diff --git a/cluster/types/v1beta3/directives.go b/cluster/types/v1beta3/directives.go index 2bef3d1a1..2da63f02d 100644 --- a/cluster/types/v1beta3/directives.go +++ b/cluster/types/v1beta3/directives.go @@ -2,7 +2,7 @@ package v1beta3 import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type ConnectHostnameToDeploymentDirective struct { diff --git a/cluster/types/v1beta3/hostname.go b/cluster/types/v1beta3/hostname.go index bc9ec27b6..fd16e5288 100644 --- a/cluster/types/v1beta3/hostname.go +++ b/cluster/types/v1beta3/hostname.go @@ -1,7 +1,7 @@ package v1beta3 import ( - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type LeaseIDHostnameConnection interface { diff --git a/cluster/types/v1beta3/interfaces.go b/cluster/types/v1beta3/interfaces.go index 07c979249..3f302809a 100644 --- a/cluster/types/v1beta3/interfaces.go +++ b/cluster/types/v1beta3/interfaces.go @@ -6,7 +6,7 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" mani "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) //go:generate mockery --name HostnameServiceClient --output ../../mocks diff --git a/cluster/types/v1beta3/ip.go b/cluster/types/v1beta3/ip.go index 376b402c5..d78192b5f 100644 --- a/cluster/types/v1beta3/ip.go +++ b/cluster/types/v1beta3/ip.go @@ -2,7 +2,7 @@ package v1beta3 import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type IPResourceEvent interface { diff --git a/cluster/types/v1beta3/reservation.go b/cluster/types/v1beta3/reservation.go index d13958eeb..cbe2b6009 100644 --- a/cluster/types/v1beta3/reservation.go +++ b/cluster/types/v1beta3/reservation.go @@ -2,13 +2,14 @@ package v1beta3 import ( dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) //go:generate mockery --name ReservationGroup --output ../../mocks type ReservationGroup interface { Resources() dtypes.ResourceGroup SetAllocatedResources(dtypes.ResourceUnits) + GetAllocatedResources() dtypes.ResourceUnits SetClusterParams(interface{}) ClusterParams() interface{} } diff --git a/cluster/util/ip_sharing_key.go b/cluster/util/ip_sharing_key.go index 91db78f42..df65079de 100644 --- a/cluster/util/ip_sharing_key.go +++ b/cluster/util/ip_sharing_key.go @@ -8,7 +8,7 @@ import ( "regexp" "strings" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) var allowedIPEndpointNameRegex = regexp.MustCompile(`^[a-z\d\-]+$`) diff --git a/cluster/util/lease_id_to_namespace.go b/cluster/util/lease_id_to_namespace.go index e66ad453f..6201a378d 100644 --- a/cluster/util/lease_id_to_namespace.go +++ b/cluster/util/lease_id_to_namespace.go @@ -5,7 +5,7 @@ import ( "encoding/base32" "strings" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // LeaseIDToNamespace generates a unique sha256 sum for identifying a provider's object name. diff --git a/cmd/provider-services/cmd/helpers.go b/cmd/provider-services/cmd/helpers.go index 6139df40d..de1e90945 100644 --- a/cmd/provider-services/cmd/helpers.go +++ b/cmd/provider-services/cmd/helpers.go @@ -14,7 +14,7 @@ import ( "github.com/spf13/pflag" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/app" akashclient "github.com/akash-network/node/client" ) diff --git a/cmd/provider-services/cmd/leaseEvents.go b/cmd/provider-services/cmd/leaseEvents.go index bd0b29203..7235e5fba 100644 --- a/cmd/provider-services/cmd/leaseEvents.go +++ b/cmd/provider-services/cmd/leaseEvents.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" akashclient "github.com/akash-network/node/client" cmdcommon "github.com/akash-network/node/cmd/common" cutils "github.com/akash-network/node/x/cert/utils" diff --git a/cmd/provider-services/cmd/leaseLogs.go b/cmd/provider-services/cmd/leaseLogs.go index 409f97521..fcfa2f969 100644 --- a/cmd/provider-services/cmd/leaseLogs.go +++ b/cmd/provider-services/cmd/leaseLogs.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" akashclient "github.com/akash-network/node/client" cmdcommon "github.com/akash-network/node/cmd/common" cutils "github.com/akash-network/node/x/cert/utils" diff --git a/cmd/provider-services/cmd/migrate.go b/cmd/provider-services/cmd/migrate.go index 21e606589..aa2c879aa 100644 --- a/cmd/provider-services/cmd/migrate.go +++ b/cmd/provider-services/cmd/migrate.go @@ -2,8 +2,6 @@ package cmd import ( "github.com/spf13/cobra" - - "github.com/akash-network/provider/cmd/provider-services/cmd/migrate/v2beta2" ) func migrate() *cobra.Command { @@ -11,7 +9,5 @@ func migrate() *cobra.Command { Use: "migrate", } - cmd.AddCommand(v2beta2.MigrateCmd()) - return cmd } diff --git a/cmd/provider-services/cmd/migrate/v2beta2/migrate.go b/cmd/provider-services/cmd/migrate/v2beta2/migrate.go deleted file mode 100644 index 7f0860269..000000000 --- a/cmd/provider-services/cmd/migrate/v2beta2/migrate.go +++ /dev/null @@ -1,808 +0,0 @@ -package v2beta2 - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "os" - "os/exec" - "path" - "strings" - "time" - - "github.com/spf13/cobra" - "github.com/spf13/viper" - "github.com/theckman/yacspin" - kubeErrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/util/homedir" - - sdkclient "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/types/query" - - dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" - mmigrate "github.com/akash-network/akash-api/go/node/market/v1beta3/migrate" - - "github.com/akash-network/node/client" - "github.com/akash-network/node/util/cli" - - "github.com/akash-network/provider/cluster/kube/clientcommon" - cmdutil "github.com/akash-network/provider/cmd/provider-services/cmd/util" - "github.com/akash-network/provider/pkg/apis/akash.network/v2beta1" - "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2" - v2beta2migrate "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2/migrate" - akashclient "github.com/akash-network/provider/pkg/client/clientset/versioned" -) - -const ( - flagDryRun = "crd-dry-run" - flagCrdBackupPath = "crd-backup-path" - flagCrdRestoreOnly = "crd-restore-only" - flagCrdBackupOnly = "crd-backup-only" - flagCleanDanglingLeases = "clean-dangling" - FlagKubeConfig = "kubeconfig" - FlagK8sManifestNS = "k8s-manifest-ns" - flagCrdOld = "crd-v2beta1" - flagCrdNew = "crd-v2beta2" -) - -func MigrateCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "v2beta2", - RunE: func(cmd *cobra.Command, args []string) error { - return doMigrateCRDs(cmd.Context(), cmd) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - cmd.Flags().String(FlagK8sManifestNS, "lease", "Cluster manifest namespace") - if err := viper.BindPFlag(FlagK8sManifestNS, cmd.Flags().Lookup(FlagK8sManifestNS)); err != nil { - return nil - } - - cmd.Flags().String(FlagKubeConfig, path.Join(homedir.HomeDir(), ".kube", "config"), "kubernetes configuration file path") - if err := viper.BindPFlag(FlagKubeConfig, cmd.Flags().Lookup(FlagKubeConfig)); err != nil { - return nil - } - - cmd.Flags().String(flagCrdBackupPath, "./", "path to backup CRDs") - if err := viper.BindPFlag(flagCrdBackupPath, cmd.Flags().Lookup(flagCrdBackupPath)); err != nil { - return nil - } - - cmd.Flags().Bool(flagCrdRestoreOnly, false, "proceed to restore step without making current backup") - if err := viper.BindPFlag(flagCrdRestoreOnly, cmd.Flags().Lookup(flagCrdRestoreOnly)); err != nil { - return nil - } - - cmd.Flags().Bool(flagCrdBackupOnly, false, "just create backup of the current CRDs") - if err := viper.BindPFlag(flagCrdBackupOnly, cmd.Flags().Lookup(flagCrdBackupOnly)); err != nil { - return nil - } - - cmd.Flags().Bool(flagDryRun, true, "patch CRDs and save them as files. this does not delete CRDs from cluster") - if err := viper.BindPFlag(flagDryRun, cmd.Flags().Lookup(flagDryRun)); err != nil { - return nil - } - - cmd.Flags().Bool(flagCleanDanglingLeases, false, "clean dangling leases") - if err := viper.BindPFlag(flagCleanDanglingLeases, cmd.Flags().Lookup(flagCleanDanglingLeases)); err != nil { - return nil - } - - cmd.Flags().String(flagCrdOld, "", "path or URL to pre-upgrade CRD") - if err := viper.BindPFlag(flagCrdOld, cmd.Flags().Lookup(flagCrdOld)); err != nil { - return nil - } - - cmd.Flags().String(flagCrdNew, "", "path or URL to post-upgrade CRD") - if err := viper.BindPFlag(flagCrdNew, cmd.Flags().Lookup(flagCrdNew)); err != nil { - return nil - } - - _ = cmd.MarkFlagRequired(flagCrdNew) - - return cmd -} - -func queryActiveLeases(ctx context.Context, cctx sdkclient.Context) (map[mtypes.LeaseID]dtypes.GroupSpec, error) { - aclient := client.NewQueryClientFromCtx(cctx) - - activeLeases := make(map[mtypes.LeaseID]dtypes.GroupSpec) - - var pkey []byte - - for { - var pgn *query.PageRequest - if pkey != nil { - pgn = &query.PageRequest{ - Key: pkey, - } - } - - lresp, err := aclient.Leases(ctx, &mtypes.QueryLeasesRequest{ - Filters: mtypes.LeaseFilters{ - Provider: cctx.FromAddress.String(), - State: mtypes.LeaseActive.String(), - }, - Pagination: pgn, - }) - if err != nil { - if err != nil { - return nil, err - } - } - - for _, lease := range lresp.Leases { - lid := lease.Lease.LeaseID - - order, err := aclient.Order(ctx, &mtypes.QueryOrderRequest{ID: lid.OrderID()}) - if err != nil { - fmt.Printf("couldn't query order for lease [%s]: %s", lid, err.Error()) - continue - } - - activeLeases[lease.Lease.LeaseID] = order.Order.Spec - } - - if pg := lresp.Pagination; pg != nil && len(pg.NextKey) > 0 { - pkey = pg.NextKey - } else { - break - } - } - - return activeLeases, nil -} - -func doMigrateCRDs(ctx context.Context, cmd *cobra.Command) (err error) { - var spinner *yacspin.Spinner - - defer func() { - if spinner != nil && spinner.Status() == yacspin.SpinnerRunning { - if err != nil { - spinner.StopFailMessage(fmt.Sprintf("failed with error: %s", err.Error())) - _ = spinner.StopFail() - } else { - _ = spinner.Stop() - } - } - }() - - ycfg := yacspin.Config{ - Frequency: 100 * time.Millisecond, - CharSet: yacspin.CharSets[52], - ColorAll: true, - Prefix: "", - Suffix: " ", - SuffixAutoColon: true, - StopCharacter: "✓", - StopFailCharacter: "✗", - StopColors: []string{"fgGreen"}, - StopFailColors: []string{"fgRed"}, - } - - spinner, err = yacspin.New(ycfg) - if err != nil { - return err - } - - cmd.SilenceErrors = true - - cctx, err := sdkclient.GetClientTxContext(cmd) - if err != nil { - return fmt.Errorf("couldn't initialize query context: %w", err) - } - - ns := viper.GetString(FlagK8sManifestNS) - kubeConfig := viper.GetString(FlagKubeConfig) - backupPath := path.Dir(viper.GetString(flagCrdBackupPath)) + "/crds/v2beta1" - dryrunPath := path.Dir(viper.GetString(flagCrdBackupPath)) + "/crds/v2beta2" - - manifestsBackupPath := backupPath + "/manifests" - hostsBackupPath := backupPath + "/hosts" - ipsBackupPath := backupPath + "/ips" - - manifestsDryRunPath := dryrunPath + "/manifests" - hostsDryRunPath := dryrunPath + "/hosts" - ipsDryRunPath := dryrunPath + "/ips" - - restoreOnly := viper.GetBool(flagCrdRestoreOnly) - backupOnly := viper.GetBool(flagCrdBackupOnly) - dryRun := viper.GetBool(flagDryRun) - // cleanDanglingLeases := viper.GetBool(flagCleanDanglingLeases) - - if !isKubectlAvail() { - return errors.New("kubectl has not been found. install to proceed") // nolint goerr113 - } - - config, err := clientcommon.OpenKubeConfig(kubeConfig, cmdutil.OpenLogger().With("cmp", "migrator")) - if err != nil { - return err - } - - if err != nil { - return fmt.Errorf("kube: error building config flags: %w", err) - } - - spinner.Message("loading CRDs") - spinner.StopMessage("loaded CRDs") - spinner.StopFailMessage("failed to load CRDs") - - _ = spinner.Start() - crdOld, err := readOrDownload(viper.GetString(flagCrdOld)) - if err != nil { - return err - } - - crdNew, err := readOrDownload(viper.GetString(flagCrdNew)) - if err != nil { - return err - } - - _ = spinner.Stop() - - ac, err := akashclient.NewForConfig(config) - if err != nil { - return fmt.Errorf("kube: error creating manifest client: %w", err) - } - - spinner.Message(fmt.Sprintf("loading active leases for provider \"%s\"", cctx.FromAddress)) - spinner.StopMessage(fmt.Sprintf("loaded active leases for provider \"%s\"", cctx.FromAddress)) - _ = spinner.Start() - - activeLeases, err := queryActiveLeases(cmd.Context(), cctx) - if err != nil { - return err - } - _ = spinner.Stop() - - var oldMani []v2beta1.Manifest - var oldHosts []v2beta1.ProviderHost - var oldIPs []v2beta1.ProviderLeasedIP - - if dryRun { - isEmpty, err := isDirEmpty(manifestsDryRunPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - - if isEmpty { - isEmpty, err = isDirEmpty(hostsDryRunPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - } - - if isEmpty { - isEmpty, err = isDirEmpty(ipsDryRunPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - } - - var yes bool - - if !isEmpty && !restoreOnly { - yes, err = cli.GetConfirmation(cmd, "previous dry run already present. \"y\" to override. \"N\" to exit") - if err != nil { - return err - } - - if yes { - _ = os.RemoveAll(backupPath) - } else { - return nil - } - } - } - - if !restoreOnly { - isEmpty, err := isDirEmpty(manifestsBackupPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - - if isEmpty { - isEmpty, err = isDirEmpty(hostsBackupPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - } - - if isEmpty { - isEmpty, err = isDirEmpty(ipsBackupPath) - if os.IsNotExist(err) { - isEmpty = true - } else if err != nil { - return err - } - } - - yes := true - - if !isEmpty { - yes, err = cli.GetConfirmation(cmd, "backup already present. \"y\" to remove. \"N\" jump to restore. Ctrl+C exit") - if err != nil { - return err - } - - if yes { - _ = os.RemoveAll(backupPath) - } - } - - if yes { - spinner.Message("loading CRDs") - spinner.StopMessage("loaded CRDs") - _ = spinner.Start() - mList, err := ac.AkashV2beta1().Manifests(ns).List(ctx, metav1.ListOptions{}) - if err != nil { - return err - } - - hList, err := ac.AkashV2beta1().ProviderHosts(ns).List(ctx, metav1.ListOptions{}) - if err != nil { - return err - } - - iList, err := ac.AkashV2beta1().ProviderLeasedIPs(ns).List(ctx, metav1.ListOptions{}) - if err != nil { - return err - } - - _ = spinner.Stop() - - if len(mList.Items) == 0 && len(hList.Items) == 0 && len(iList.Items) == 0 { - fmt.Println("no v2beta1 objects found. nothing to backup") - return nil - } - - oldMani = mList.Items - oldHosts = hList.Items - oldIPs = iList.Items - - if len(mList.Items) > 0 { - spinner.Message("backup manifests") - spinner.StopMessage(fmt.Sprintf("backup manifests DONE: %d", len(mList.Items))) - - _ = spinner.Start() - _ = os.MkdirAll(manifestsBackupPath, 0755) - for i := range oldMani { - data, _ := json.MarshalIndent(&oldMani[i], "", " ") - if err = backupObject(manifestsBackupPath+"/"+oldMani[i].Name+".yaml", data); err != nil { - return err - } - - if backupOnly || !dryRun { - _ = ac.AkashV2beta1().Manifests(ns).Delete(ctx, oldMani[i].Name, metav1.DeleteOptions{}) - } - } - _ = spinner.Stop() - } - - if len(hList.Items) > 0 { - spinner.Message("backup providers hosts") - spinner.StopMessage(fmt.Sprintf("backup providers hosts DONE: %d", len(hList.Items))) - - _ = spinner.Start() - _ = os.MkdirAll(hostsBackupPath, 0755) - for i := range oldHosts { - data, _ := json.MarshalIndent(&oldHosts[i], "", " ") - if err = backupObject(hostsBackupPath+"/"+oldHosts[i].Name+".yaml", data); err != nil { - return err - } - - if backupOnly || !dryRun { - _ = ac.AkashV2beta1().ProviderHosts(ns).Delete(ctx, oldHosts[i].Name, metav1.DeleteOptions{}) - } - } - _ = spinner.Stop() - } - - if len(iList.Items) > 0 { - spinner.Message("backup IP addresses") - spinner.StopMessage(fmt.Sprintf("backup IP addresses DONE: %d", len(iList.Items))) - - _ = spinner.Start() - - _ = os.MkdirAll(ipsBackupPath, 0755) - for i := range oldIPs { - data, _ := json.MarshalIndent(&oldIPs[i], "", " ") - if err = backupObject(ipsBackupPath+"/"+oldIPs[i].Name+".yaml", data); err != nil { - return err - } - - if backupOnly || !dryRun { - _ = ac.AkashV2beta1().ProviderLeasedIPs(ns).Delete(ctx, oldIPs[i].Name, metav1.DeleteOptions{}) - } - } - _ = spinner.Stop() - } - } - } - - if len(oldMani) == 0 { - oldMani, err = loadObjects[v2beta1.Manifest](manifestsBackupPath) - if err != nil { - return err - } - } - - if len(oldHosts) == 0 { - oldHosts, err = loadObjects[v2beta1.ProviderHost](hostsBackupPath) - if err != nil { - return err - } - } - - if len(oldIPs) == 0 { - oldIPs, err = loadObjects[v2beta1.ProviderLeasedIP](ipsBackupPath) - if err != nil { - return err - } - } - - if !dryRun { - spinner.Message("applying CRDs") - spinner.StopMessage("applied CRDs") - spinner.StopFailMessage("failed to apply CRDs") - - _ = spinner.Start() - - _ = kubectl(cmd, "delete", string(crdOld), kubeConfig) - - if err = kubectl(cmd, "apply", string(crdNew), kubeConfig); err != nil { - return err - } - - _ = spinner.Stop() - } - - if len(oldMani) > 0 { - spinner.Message("migrating manifests to v2beta2") - spinner.StopMessage("migrated manifests to v2beta2") - spinner.StopFailMessage("some v2beta manifests may have failed") - - _ = spinner.Start() - - var errs []error - for _, mani := range oldMani { - olid, _ := mani.Spec.LeaseID.ToAkash() - nlid := mmigrate.LeaseIDFromV1beta2(olid) - - gspec, exists := activeLeases[nlid] - if !exists { - continue - } - - nmani := &v2beta2.Manifest{ - TypeMeta: metav1.TypeMeta{ - Kind: "Manifest", - APIVersion: "akash.network/v2beta2", - }, - ObjectMeta: metav1.ObjectMeta{ - Namespace: ns, - Name: mani.Name, - Labels: mani.Labels, - }, - } - - nmani.Spec, err = v2beta2migrate.ManifestSpecFromV2beta1(gspec.Resources, mani.Spec) - if err != nil { - errs = append(errs, err) - } else { - if dryRun { - _ = os.MkdirAll(manifestsDryRunPath, 0755) - data, _ := json.MarshalIndent(nmani, "", " ") - if err = backupObject(manifestsDryRunPath+"/"+nmani.Name+".yaml", data); err != nil { - return err - } - } else { - // double check this manifest not present in the new api - _, err = ac.AkashV2beta2().Manifests(ns).Get(ctx, mani.Name, metav1.GetOptions{}) - if err != nil && !kubeErrors.IsNotFound(err) { - fmt.Printf("unable to check presence of \"%s\" manifest. still trying to migrate. %s\n", mani.Name, err.Error()) - } - - if _, err = ac.AkashV2beta2().Manifests(ns).Create(ctx, nmani, metav1.CreateOptions{}); err != nil { - errs = append(errs, err) - } - } - } - } - - if len(errs) == 0 { - _ = spinner.Stop() - } else { - _ = spinner.StopFail() - - fmt.Printf("some manifest migrations have failed:\n") - for _, e := range errs { - fmt.Printf("\t%s\n", e.Error()) - } - } - } - - if len(oldHosts) > 0 { - spinner.Message("migrating hosts to v2beta2") - spinner.StopMessage("migrated hosts to v2beta2") - spinner.StopFailMessage("failed migrate to hosts to v2beta2") - - _ = spinner.Start() - - var errs []error - for _, host := range oldHosts { - nlid := mtypes.LeaseID{ - Owner: host.Spec.Owner, - DSeq: host.Spec.Dseq, - GSeq: host.Spec.Oseq, - OSeq: host.Spec.Gseq, - Provider: host.Spec.Provider, - } - - _, exists := activeLeases[nlid] - if !exists { - continue - } - - nhost := &v2beta2.ProviderHost{ - TypeMeta: metav1.TypeMeta{ - Kind: "ProviderHost", - APIVersion: "akash.network/v2beta2", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: host.Name, - Namespace: ns, - }, - } - - nhost.Labels = host.Labels - nhost.Spec = v2beta2migrate.ProviderHostsSpecFromV2beta1(host.Spec) - - if dryRun { - _ = os.MkdirAll(hostsDryRunPath, 0755) - data, _ := json.MarshalIndent(nhost, "", " ") - if err = backupObject(hostsDryRunPath+"/"+nhost.Name+".yaml", data); err != nil { - return err - } - } else { - // double check this manifest not present in the new api - _, err = ac.AkashV2beta2().ProviderHosts(ns).Get(ctx, host.Name, metav1.GetOptions{}) - if err != nil && !kubeErrors.IsNotFound(err) { - fmt.Printf("unable to check presence of \"%s\" provider hosts. still trying to migrate. %s\n", host.Name, err.Error()) - } - - if _, err = ac.AkashV2beta2().ProviderHosts(ns).Create(ctx, nhost, metav1.CreateOptions{}); err != nil { - errs = append(errs, err) - } - } - } - - if len(errs) == 0 { - _ = spinner.Stop() - } else { - _ = spinner.StopFail() - - fmt.Printf("some provider hosts migrations have failed:\n") - for _, e := range errs { - fmt.Printf("\t%s\n", e.Error()) - } - } - } - - if len(oldIPs) > 0 { - spinner.Message("migrating IP addresses to v2beta2") - spinner.StopMessage("migrated IP addresses to v2beta2") - spinner.StopFailMessage("failed to migrate IP addresses to v2beta2") - - _ = spinner.Start() - - var errs []error - - for _, host := range oldIPs { - olid, _ := host.Spec.LeaseID.ToAkash() - nlid := mmigrate.LeaseIDFromV1beta2(olid) - - _, exists := activeLeases[nlid] - if !exists { - continue - } - - nIPs := &v2beta2.ProviderLeasedIP{ - TypeMeta: metav1.TypeMeta{ - Kind: "ProviderLeasedIP", - APIVersion: "akash.network/v2beta2", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: host.Name, - Namespace: ns, - }, - } - - nIPs.Labels = host.Labels - nIPs.Spec = v2beta2migrate.ProviderIPsSpecFromV2beta1(host.Spec) - - if dryRun { - _ = os.MkdirAll(ipsDryRunPath, 0755) - data, _ := json.MarshalIndent(nIPs, "", " ") - if err = backupObject(ipsDryRunPath+"/"+nIPs.Name+".yaml", data); err != nil { - return err - } - } else { - // double check this manifest not present in the new api - _, err = ac.AkashV2beta2().ProviderLeasedIPs(ns).Get(ctx, host.Name, metav1.GetOptions{}) - if err != nil && !kubeErrors.IsNotFound(err) { - fmt.Printf("unable to check presence of \"%s\" leased IPs. still trying to migrate. %s\n", host.Name, err.Error()) - } - - if _, err = ac.AkashV2beta2().ProviderLeasedIPs(ns).Create(ctx, nIPs, metav1.CreateOptions{}); err != nil { - errs = append(errs, err) - } - } - } - - if len(errs) == 0 { - _ = spinner.Stop() - } else { - _ = spinner.StopFail() - - fmt.Printf("some IP address migrations have failed:\n") - for _, e := range errs { - fmt.Printf("\t%s\n", e.Error()) - } - } - } - - return nil -} - -func isDirEmpty(name string) (bool, error) { - f, err := os.Open(name) - if err != nil { - return false, err - } - defer func() { - _ = f.Close() - }() - - // read in ONLY one file - _, err = f.Readdir(1) - - // and if the file is EOF... well, the dir is empty. - if err == io.EOF { - return true, nil - } - - return false, nil -} - -func backupObject(path string, data []byte) error { - fl, err := os.Create(path) - if err != nil { - return err - } - - defer func() { - _ = fl.Close() - }() - - _, err = fl.Write(data) - if err != nil { - return err - } - - return nil -} - -func loadObjects[C v2beta1.Manifest | v2beta1.ProviderHost | v2beta1.ProviderLeasedIP](path string) ([]C, error) { - files, err := os.ReadDir(path) - if err != nil && !errors.Is(err, os.ErrNotExist) { - return nil, err - } - - var res []C - - for _, fl := range files { - if fl.IsDir() || !strings.HasSuffix(fl.Name(), ".yaml") { - continue - } - - obj := *new(C) - - if err = readObject(path+"/"+fl.Name(), &obj); err == nil { - res = append(res, obj) - } else { - fmt.Printf("error reading provider hosts from \"%s\". %s", fl.Name(), err.Error()) - } - } - - return res, nil -} - -func readObject(path string, obj interface{}) error { - fl, err := os.Open(path) - if err != nil { - return err - } - defer func() { - _ = fl.Close() - }() - - data, err := io.ReadAll(fl) - if err != nil { - return err - } - - if err = json.Unmarshal(data, &obj); err != nil { - return err - } - - return nil -} - -func isKubectlAvail() bool { - _, err := exec.LookPath("kubectl") - return err == nil -} - -func kubectl(cmd *cobra.Command, command, content string, kubeconfig string) error { - exe := exec.CommandContext(cmd.Context(), "kubectl", command, "-f", "-") - - exe.Stdin = bytes.NewBufferString(content) - exe.Stdout = cmd.OutOrStdout() - exe.Stderr = cmd.ErrOrStderr() - - if len(kubeconfig) != 0 { - exe.Env = []string{ - "KUBECONFIG=" + kubeconfig, - } - } - - return exe.Run() -} - -func readOrDownload(path string) ([]byte, error) { - var stream io.ReadCloser - - defer func() { - if stream != nil { - _ = stream.Close() - } - }() - - if strings.HasPrefix(path, "http") { - resp, err := http.Get(path) // nolint: gosec - if err != nil { - return nil, err - } - - stream = resp.Body - } else { - fl, err := os.Open(path) - if err != nil { - return nil, err - } - - stream = fl - } - - return io.ReadAll(stream) -} diff --git a/cmd/provider-services/cmd/run.go b/cmd/provider-services/cmd/run.go index 935aae0ef..b81f2f07f 100644 --- a/cmd/provider-services/cmd/run.go +++ b/cmd/provider-services/cmd/run.go @@ -25,7 +25,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ctypes "github.com/akash-network/akash-api/go/node/cert/v1beta3" - mparams "github.com/akash-network/akash-api/go/node/market/v1beta3" + mparams "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" "github.com/akash-network/node/client" "github.com/akash-network/node/cmd/common" diff --git a/config.go b/config.go index 63cf9721c..808a2e194 100644 --- a/config.go +++ b/config.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/akash-api/go/node/types/constants" types "github.com/akash-network/akash-api/go/node/types/v1beta3" diff --git a/event/events.go b/event/events.go index 93c2c53a2..b294a913e 100644 --- a/event/events.go +++ b/event/events.go @@ -5,7 +5,7 @@ import ( mani "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) // LeaseWon is the data structure that includes leaseID, group and price diff --git a/gateway/rest/client.go b/gateway/rest/client.go index 8ea373a10..2cdaaa66c 100644 --- a/gateway/rest/client.go +++ b/gateway/rest/client.go @@ -27,8 +27,9 @@ import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" ctypes "github.com/akash-network/akash-api/go/node/cert/v1beta3" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" + akashclient "github.com/akash-network/node/client" cutils "github.com/akash-network/node/x/cert/utils" diff --git a/gateway/rest/client_shell.go b/gateway/rest/client_shell.go index 278c247fa..c1232d7fe 100644 --- a/gateway/rest/client_shell.go +++ b/gateway/rest/client_shell.go @@ -14,7 +14,7 @@ import ( "github.com/gorilla/websocket" "k8s.io/client-go/tools/remotecommand" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/util/wsutil" ) diff --git a/gateway/rest/integration_test.go b/gateway/rest/integration_test.go index cc74d1d1c..c7ee5fe1c 100644 --- a/gateway/rest/integration_test.go +++ b/gateway/rest/integration_test.go @@ -14,8 +14,9 @@ import ( akashmanifest "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" providertypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" + qmock "github.com/akash-network/node/client/mocks" "github.com/akash-network/node/testutil" @@ -341,7 +342,15 @@ func createMocks() integrationMocks { } } -func withServer(t testing.TB, addr sdk.Address, pclient provider.Client, qclient *qmock.QueryClient, certs []tls.Certificate, ipoc operatorclients.IPOperatorClient, fn func(string)) { +func withServer( + t testing.TB, + addr sdk.Address, + pclient provider.Client, + qclient *qmock.QueryClient, + certs []tls.Certificate, + ipoc operatorclients.IPOperatorClient, + fn func(string), +) { t.Helper() router := newRouter(testutil.Logger(t), addr, pclient, ipoc, map[interface{}]interface{}{}) diff --git a/gateway/rest/middleware.go b/gateway/rest/middleware.go index 179ad46d3..6848d8560 100644 --- a/gateway/rest/middleware.go +++ b/gateway/rest/middleware.go @@ -16,7 +16,7 @@ import ( "github.com/tendermint/tendermint/libs/log" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" mquery "github.com/akash-network/node/x/market/query" ) diff --git a/gateway/rest/path.go b/gateway/rest/path.go index 7b6309eba..175b6769e 100644 --- a/gateway/rest/path.go +++ b/gateway/rest/path.go @@ -3,7 +3,7 @@ package rest import ( "fmt" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) const ( diff --git a/gateway/rest/router.go b/gateway/rest/router.go index d0f5afbe6..f9117aba0 100644 --- a/gateway/rest/router.go +++ b/gateway/rest/router.go @@ -30,7 +30,7 @@ import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" manifestValidation "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/util/wsutil" "github.com/akash-network/provider" diff --git a/gateway/rest/router_migrate_test.go b/gateway/rest/router_migrate_test.go index cd0a82801..2a4544942 100644 --- a/gateway/rest/router_migrate_test.go +++ b/gateway/rest/router_migrate_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" crd "github.com/akash-network/provider/pkg/apis/akash.network/v2beta2" diff --git a/gateway/rest/router_test.go b/gateway/rest/router_test.go index 77c388d08..d1179ab71 100644 --- a/gateway/rest/router_test.go +++ b/gateway/rest/router_test.go @@ -21,8 +21,9 @@ import ( manifestValidation "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" + qmock "github.com/akash-network/node/client/mocks" "github.com/akash-network/node/sdl" "github.com/akash-network/node/testutil" @@ -122,7 +123,7 @@ func testCertHelper(t *testing.T, test *routerTest) { test.pmclient.On( "Submit", mock.Anything, - mock.AnythingOfType("types.DeploymentID"), + mock.AnythingOfType("dtypes.DeploymentID"), mock.AnythingOfType("v2beta2.Manifest"), ).Return(nil) diff --git a/go.mod b/go.mod index 2fd3a0244..a9e5eff12 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module github.com/akash-network/provider go 1.21 require ( - github.com/akash-network/akash-api v0.0.31 - github.com/akash-network/node v0.26.2 + github.com/akash-network/akash-api v0.0.32 + github.com/akash-network/node v0.28.1-rc0 github.com/avast/retry-go/v4 v4.5.0 github.com/boz/go-lifecycle v0.1.1 github.com/cosmos/cosmos-sdk v0.45.16 @@ -28,7 +28,6 @@ require ( github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 github.com/tendermint/tendermint v0.34.27 - github.com/theckman/yacspin v0.13.12 go.uber.org/zap v1.24.0 golang.org/x/sync v0.3.0 gopkg.in/yaml.v3 v3.0.1 @@ -226,6 +225,7 @@ require ( github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tendermint/tm-db v0.6.7 // indirect + github.com/theckman/yacspin v0.13.12 // indirect github.com/tidwall/btree v1.5.0 // indirect github.com/zondax/hid v0.9.1 // indirect github.com/zondax/ledger-go v0.14.1 // indirect diff --git a/go.sum b/go.sum index 32098462d..9dc34854d 100644 --- a/go.sum +++ b/go.sum @@ -200,16 +200,16 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akash-network/akash-api v0.0.31 h1:2U2f7vN2eyLbSV7ombWyXnsFZ2ZfE4brjSMq46hkL3k= -github.com/akash-network/akash-api v0.0.31/go.mod h1:pW5NnJNhxynCOUGEcgxa338GSU2qzMkpn3MMYcAY6O4= +github.com/akash-network/akash-api v0.0.32 h1:YkvFWUyyK6WKsERAcWCxWoIDXFQLLioTZ5iVI6Bvbv4= +github.com/akash-network/akash-api v0.0.32/go.mod h1:pW5NnJNhxynCOUGEcgxa338GSU2qzMkpn3MMYcAY6O4= github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0= github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo= github.com/akash-network/ledger-go v0.14.3/go.mod h1:NfsjfFvno9Kaq6mfpsKz4sqjnAVVEsVsnBJfKB4ueAs= github.com/akash-network/ledger-go/cosmos v0.14.3 h1:bEI9jLHM+Lm55idi4RfJlDez4/rVJs7E1MT0U2whYqI= github.com/akash-network/ledger-go/cosmos v0.14.3/go.mod h1:SjAfheQTE4rWk0ir+wjbOWxwj8nc8E4AZ08NdsvYG24= -github.com/akash-network/node v0.26.2 h1:BfXS7hmgxmOeacBDbhl9oaKwj1z6s8Fw93F/4zO/+z8= -github.com/akash-network/node v0.26.2/go.mod h1:8ITKkFCowLQJnRNhagw1ELP41Ph7801dOiCfBNqThuI= +github.com/akash-network/node v0.28.1-rc0 h1:0m/Fe5IPpoZfuUlzB2p70G3aDzqdokffHVcSHpMmy6I= +github.com/akash-network/node v0.28.1-rc0/go.mod h1:YUweWsT+Ji/Ae4fkBkyIqubebE4EiWWsrfKzgv/aC0w= github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= diff --git a/integration/app_test.go b/integration/app_test.go index 8b925feb7..5cb5ec4d1 100644 --- a/integration/app_test.go +++ b/integration/app_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/sdl" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" diff --git a/integration/container2container_test.go b/integration/container2container_test.go index 3d1fae794..5dc095159 100644 --- a/integration/container2container_test.go +++ b/integration/container2container_test.go @@ -10,7 +10,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/customcurrency_test.go b/integration/customcurrency_test.go index 379c22c1f..72b7a2ad9 100644 --- a/integration/customcurrency_test.go +++ b/integration/customcurrency_test.go @@ -16,7 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/deployment_update_test.go b/integration/deployment_update_test.go index 5b550537a..071a66137 100644 --- a/integration/deployment_update_test.go +++ b/integration/deployment_update_test.go @@ -14,7 +14,7 @@ import ( sdktest "github.com/cosmos/cosmos-sdk/testutil" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/e2e_test.go b/integration/e2e_test.go index babb2e50e..0bb45886a 100644 --- a/integration/e2e_test.go +++ b/integration/e2e_test.go @@ -31,7 +31,7 @@ import ( bankcli "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/provider/v1beta3" ttypes "github.com/akash-network/akash-api/go/node/take/v1beta3" diff --git a/integration/escrow_monitor_test.go b/integration/escrow_monitor_test.go index 55e8f6daa..b3ef30c27 100644 --- a/integration/escrow_monitor_test.go +++ b/integration/escrow_monitor_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/ipaddress_test.go b/integration/ipaddress_test.go index 522d45e75..29885075d 100644 --- a/integration/ipaddress_test.go +++ b/integration/ipaddress_test.go @@ -16,7 +16,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/migrate_hostname_test.go b/integration/migrate_hostname_test.go index 8bb9e6e24..b8fb48988 100644 --- a/integration/migrate_hostname_test.go +++ b/integration/migrate_hostname_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/node_port_test.go b/integration/node_port_test.go index 5c73ff776..e2504c23d 100644 --- a/integration/node_port_test.go +++ b/integration/node_port_test.go @@ -15,7 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/integration/persistentstorage_test.go b/integration/persistentstorage_test.go index 7901cb15d..23af0795b 100644 --- a/integration/persistentstorage_test.go +++ b/integration/persistentstorage_test.go @@ -16,7 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clitestutil "github.com/akash-network/node/testutil/cli" deploycli "github.com/akash-network/node/x/deployment/client/cli" mcli "github.com/akash-network/node/x/market/client/cli" diff --git a/make/init.mk b/make/init.mk index 3e44900cc..182b1e448 100644 --- a/make/init.mk +++ b/make/init.mk @@ -57,7 +57,7 @@ $(error "No realpath in $(PATH), consider installing") endif BINS := $(PROVIDER_SERVICES) akash -SEMVER := $(ROOT_DIR)/script/semver.sh +SEMVER := $(ROOT_DIR)/script/semver.sh __local_go := $(shell GOTOOLCHAIN=local go version | cut -d ' ' -f 3 | sed 's/go*//' | tr -d '\n') __is_local_go_satisfies := $(shell $(SEMVER) compare "v$(__local_go)" "v1.20.7"; echo $?) diff --git a/make/setup-cache.mk b/make/setup-cache.mk index 3d3bbe01c..ea61004b9 100644 --- a/make/setup-cache.mk +++ b/make/setup-cache.mk @@ -33,7 +33,8 @@ akash-rm: ifeq ($(AKASHD_BUILD_FROM_SRC), true) akash: @echo "compiling and installing Akash from local sources" - make -C $(AKASHD_LOCAL_PATH) akash AKASH=$(AP_DEVCACHE_BIN)/akash + $(AP_ROOT)/script/tools.sh build-akash $(AKASHD_LOCAL_PATH) +#make -C $(AKASHD_LOCAL_PATH) akash AKASH=$(AP_DEVCACHE_BIN)/akash else $(AKASHD_VERSION_FILE): $(AP_DEVCACHE) @echo "Installing akash $(AKASHD_VERSION) ..." diff --git a/manifest/manager.go b/manifest/manager.go index 9c3f1496a..e56fecfd0 100644 --- a/manifest/manager.go +++ b/manifest/manager.go @@ -14,7 +14,7 @@ import ( maniv2beta2 "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" "github.com/akash-network/node/util/runner" @@ -330,7 +330,6 @@ func (m *manager) fillAllRequests(response error) { req.ch <- response } m.requests = nil - } func (m *manager) emitReceivedEvents() { diff --git a/manifest/manager_test.go b/manifest/manager_test.go index 3d0637ffb..f2cb3b672 100644 --- a/manifest/manager_test.go +++ b/manifest/manager_test.go @@ -12,7 +12,7 @@ package manifest // dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" // types "github.com/akash-network/akash-api/go/node/deployment/v1beta3" // escrowtypes "github.com/akash-network/akash-api/go/node/escrow/v1beta3" -// mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" +// mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" // ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" // "github.com/akash-network/akash-api/go/sdkutil" // clientMocks "github.com/akash-network/node/client/mocks" diff --git a/manifest/parse.go b/manifest/parse.go index 5e4d84784..70e349ce1 100644 --- a/manifest/parse.go +++ b/manifest/parse.go @@ -5,7 +5,7 @@ import ( "strings" maniv2beta1 "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/google/uuid" ) diff --git a/manifest/service.go b/manifest/service.go index d1511380f..e9171ab71 100644 --- a/manifest/service.go +++ b/manifest/service.go @@ -12,7 +12,7 @@ import ( manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/pubsub" dquery "github.com/akash-network/node/x/deployment/query" diff --git a/manifest/watchdog.go b/manifest/watchdog.go index 316bebae2..0be3c2fc2 100644 --- a/manifest/watchdog.go +++ b/manifest/watchdog.go @@ -9,7 +9,7 @@ import ( "github.com/tendermint/tendermint/libs/log" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/util/runner" "github.com/akash-network/provider/session" diff --git a/manifest/watchdog_test.go b/manifest/watchdog_test.go index 902da530e..adb8a7a33 100644 --- a/manifest/watchdog_test.go +++ b/manifest/watchdog_test.go @@ -10,8 +10,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3" - types "github.com/akash-network/akash-api/go/node/market/v1beta3" + types "github.com/akash-network/akash-api/go/node/market/v1beta4" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" + broadcastmocks "github.com/akash-network/node/client/broadcaster/mocks" clientmocks "github.com/akash-network/node/client/mocks" "github.com/akash-network/node/testutil" @@ -46,6 +47,7 @@ func makeWatchdogTestScaffold(t *testing.T, timeout time.Duration) (*watchdog, * scaffold.client = &clientmocks.Client{} scaffold.client.On("Tx").Return(txClientMock) sess := session.New(testutil.Logger(t), scaffold.client, &scaffold.provider, -1) + require.NotNil(t, sess.Client()) wd := newWatchdog(sess, scaffold.parentCh, scaffold.doneCh, scaffold.leaseID, timeout) diff --git a/operator/hostnameoperator/hostname_operator.go b/operator/hostnameoperator/hostname_operator.go index 46721d022..34827847b 100644 --- a/operator/hostnameoperator/hostname_operator.go +++ b/operator/hostnameoperator/hostname_operator.go @@ -11,7 +11,7 @@ import ( "time" manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/tendermint/tendermint/libs/log" diff --git a/operator/hostnameoperator/hostname_operator_test.go b/operator/hostnameoperator/hostname_operator_test.go index 6e857401b..fe3dd2956 100644 --- a/operator/hostnameoperator/hostname_operator_test.go +++ b/operator/hostnameoperator/hostname_operator_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" "github.com/akash-network/provider/cluster/mocks" diff --git a/operator/hostnameoperator/hostname_operator_types.go b/operator/hostnameoperator/hostname_operator_types.go index 9fa47ff19..6375e4714 100644 --- a/operator/hostnameoperator/hostname_operator_types.go +++ b/operator/hostnameoperator/hostname_operator_types.go @@ -3,7 +3,7 @@ package hostnameoperator import ( "time" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ctypes "github.com/akash-network/provider/cluster/types/v1beta3" ) diff --git a/operator/ipoperator/ip_operator.go b/operator/ipoperator/ip_operator.go index eee9674ec..94f8ed429 100644 --- a/operator/ipoperator/ip_operator.go +++ b/operator/ipoperator/ip_operator.go @@ -22,7 +22,7 @@ import ( kubeErrors "k8s.io/apimachinery/pkg/api/errors" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/provider/cluster" clusterClient "github.com/akash-network/provider/cluster/kube" diff --git a/operator/ipoperator/ip_operator_test.go b/operator/ipoperator/ip_operator_test.go index f6c24e403..2328448e9 100644 --- a/operator/ipoperator/ip_operator_test.go +++ b/operator/ipoperator/ip_operator_test.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" manifest "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" "github.com/akash-network/node/testutil" "github.com/akash-network/provider/cluster/mocks" diff --git a/operator/ipoperator/ip_operator_types.go b/operator/ipoperator/ip_operator_types.go index af6a6a8c9..070c7e44f 100644 --- a/operator/ipoperator/ip_operator_types.go +++ b/operator/ipoperator/ip_operator_types.go @@ -6,7 +6,7 @@ import ( "time" "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ctypes "github.com/akash-network/provider/cluster/types/v1beta3" ) diff --git a/operator/ipoperator/types/delete_reservation_request.go b/operator/ipoperator/types/delete_reservation_request.go index c71562ec7..aba15129d 100644 --- a/operator/ipoperator/types/delete_reservation_request.go +++ b/operator/ipoperator/types/delete_reservation_request.go @@ -1,7 +1,7 @@ package types import ( - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" ) type IPReservationDelete struct { diff --git a/operator/ipoperator/types/reservation_request.go b/operator/ipoperator/types/reservation_request.go index c29772988..4d50b6c78 100644 --- a/operator/ipoperator/types/reservation_request.go +++ b/operator/ipoperator/types/reservation_request.go @@ -1,6 +1,6 @@ package types -import mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" +import mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" type IPReservationRequest struct { OrderID mtypes.OrderID diff --git a/operator/operatorcommon/ignore_list.go b/operator/operatorcommon/ignore_list.go index 70a56cd80..3ffb8bc82 100644 --- a/operator/operatorcommon/ignore_list.go +++ b/operator/operatorcommon/ignore_list.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" clusterutil "github.com/akash-network/provider/cluster/util" ) diff --git a/pkg/apis/akash.network/v2beta1/types.go b/pkg/apis/akash.network/v2beta1/types.go index 5bc0893b4..4c5ee3838 100644 --- a/pkg/apis/akash.network/v2beta1/types.go +++ b/pkg/apis/akash.network/v2beta1/types.go @@ -11,7 +11,7 @@ import ( maniv2beta1 "github.com/akash-network/akash-api/go/manifest/v2beta1" mtypes "github.com/akash-network/akash-api/go/node/market/v1beta2" - mtypesv1beta3 "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypesv1beta4 "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/types/v1beta2" ctypes "github.com/akash-network/provider/cluster/types/v1beta2" @@ -82,7 +82,7 @@ func NewManifest(ns string, lid mtypes.LeaseID, mgroup *ctypes.Group) (*Manifest APIVersion: "akash.network/v1", }, ObjectMeta: metav1.ObjectMeta{ - Name: clusterutil.LeaseIDToNamespace(mtypesv1beta3.LeaseID(lid)), + Name: clusterutil.LeaseIDToNamespace(mtypesv1beta4.LeaseID(lid)), Namespace: ns, }, Spec: ManifestSpec{ diff --git a/pkg/apis/akash.network/v2beta2/manifest.go b/pkg/apis/akash.network/v2beta2/manifest.go index 0ca962ac4..0f8d1cb3e 100644 --- a/pkg/apis/akash.network/v2beta2/manifest.go +++ b/pkg/apis/akash.network/v2beta2/manifest.go @@ -4,7 +4,7 @@ import ( "fmt" mani "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/types/v1beta3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/akash.network/v2beta2/types.go b/pkg/apis/akash.network/v2beta2/types.go index c26c04876..41ca22ef2 100644 --- a/pkg/apis/akash.network/v2beta2/types.go +++ b/pkg/apis/akash.network/v2beta2/types.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" mani "github.com/akash-network/akash-api/go/manifest/v2beta2" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" types "github.com/akash-network/akash-api/go/node/types/v1beta3" ) diff --git a/script/tools.sh b/script/tools.sh index d161470ac..65508cdec 100755 --- a/script/tools.sh +++ b/script/tools.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -x + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" SEMVER=$SCRIPT_DIR/semver.sh @@ -28,6 +30,14 @@ function get_gotoolchain() { } function build_akash() { + dev_cache=${AP_DEVCACHE_BIN} + cd "$1" || exit 1 + export AKASH_ROOT="$1" + source .env + make akash AKASH="${dev_cache}/akash" +} + +function build_akash_docker() { cd "$1" || exit 1 export AKASH_ROOT="$1" source .env @@ -42,4 +52,8 @@ build-akash) shift build_akash "$@" ;; +build-akash-docker) + shift + build_akash_docker "$@" + ;; esac diff --git a/service.go b/service.go index 3aa0bc420..11a4054f9 100644 --- a/service.go +++ b/service.go @@ -282,6 +282,10 @@ func (r *reservation) SetAllocatedResources(val dtypes.ResourceUnits) { r.adjustedResources = val } +func (r *reservation) GetAllocatedResources() dtypes.ResourceUnits { + return r.adjustedResources +} + func (r *reservation) SetClusterParams(val interface{}) { r.clusterParams = val } diff --git a/session/session.go b/session/session.go index c4b081f29..741576a5f 100644 --- a/session/session.go +++ b/session/session.go @@ -4,20 +4,20 @@ import ( "github.com/tendermint/tendermint/libs/log" ptypes "github.com/akash-network/akash-api/go/node/provider/v1beta3" - "github.com/akash-network/node/client" + aclient "github.com/akash-network/node/client" ) // Session interface wraps Log, Client, Provider and ForModule methods type Session interface { Log() log.Logger - Client() client.Client + Client() aclient.Client Provider() *ptypes.Provider ForModule(string) Session CreatedAtBlockHeight() int64 } // New returns new session instance with provided details -func New(log log.Logger, client client.Client, provider *ptypes.Provider, createdAtBlockHeight int64) Session { +func New(log log.Logger, client aclient.Client, provider *ptypes.Provider, createdAtBlockHeight int64) Session { return session{ client: client, provider: provider, @@ -27,7 +27,7 @@ func New(log log.Logger, client client.Client, provider *ptypes.Provider, create } type session struct { - client client.Client + client aclient.Client provider *ptypes.Provider log log.Logger createdAtBlockHeight int64 @@ -37,7 +37,7 @@ func (s session) Log() log.Logger { return s.log } -func (s session) Client() client.Client { +func (s session) Client() aclient.Client { return s.client } diff --git a/testutil/provider/provider.go b/testutil/provider/provider.go index 2e7fc33e6..27a2add9c 100644 --- a/testutil/provider/provider.go +++ b/testutil/provider/provider.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" tmcli "github.com/tendermint/tendermint/libs/cli" - mtypes "github.com/akash-network/akash-api/go/node/market/v1beta3" + mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4" testutilcli "github.com/akash-network/node/testutil/cli" pcmd "github.com/akash-network/provider/cmd/provider-services/cmd" diff --git a/version/version.go b/version/version.go index 05962a1fb..6197541ad 100644 --- a/version/version.go +++ b/version/version.go @@ -30,15 +30,15 @@ import ( ) var ( - // application's name + // Name application's name Name = "" - // application binary name + // AppName application binary name AppName = "" - // application's version string + // Version application's version string Version = "" - // commit + // Commit commit Commit = "" - // build tags + // BuildTags build tags BuildTags = "" )