@@ -13,6 +13,7 @@ import (
13
13
mapi "github.com/akash-network/akash-api/go/manifest/v2beta2"
14
14
dtypes "github.com/akash-network/akash-api/go/node/deployment/v1beta3"
15
15
mtypes "github.com/akash-network/akash-api/go/node/market/v1beta4"
16
+ apclient "github.com/akash-network/akash-api/go/provider/client"
16
17
"github.com/prometheus/client_golang/prometheus"
17
18
"github.com/prometheus/client_golang/prometheus/promauto"
18
19
"github.com/tendermint/tendermint/libs/log"
@@ -801,7 +802,7 @@ func (c *client) LeaseLogs(ctx context.Context, lid mtypes.LeaseID,
801
802
return streams , nil
802
803
}
803
804
804
- func (c * client ) ForwardedPortStatus (ctx context.Context , leaseID mtypes.LeaseID ) (map [string ][]ctypes .ForwardedPortStatus , error ) {
805
+ func (c * client ) ForwardedPortStatus (ctx context.Context , leaseID mtypes.LeaseID ) (map [string ][]apclient .ForwardedPortStatus , error ) {
805
806
settingsI := ctx .Value (builder .SettingsKey )
806
807
if nil == settingsI {
807
808
return nil , kubeclienterrors .ErrNotConfiguredWithSettings
@@ -819,7 +820,7 @@ func (c *client) ForwardedPortStatus(ctx context.Context, leaseID mtypes.LeaseID
819
820
return nil , fmt .Errorf ("%s: %w" , kubeclienterrors .ErrInternalError .Error (), err )
820
821
}
821
822
822
- forwardedPorts := make (map [string ][]ctypes .ForwardedPortStatus )
823
+ forwardedPorts := make (map [string ][]apclient .ForwardedPortStatus )
823
824
824
825
// Search for a Kubernetes service declared as nodeport
825
826
for _ , service := range services .Items {
@@ -828,14 +829,14 @@ func (c *client) ForwardedPortStatus(ctx context.Context, leaseID mtypes.LeaseID
828
829
deploymentName := serviceName [0 : len (serviceName )- len (builder .SuffixForNodePortServiceName )]
829
830
830
831
if 0 != len (service .Spec .Ports ) {
831
- portsForDeployment := make ([]ctypes .ForwardedPortStatus , 0 , len (service .Spec .Ports ))
832
+ portsForDeployment := make ([]apclient .ForwardedPortStatus , 0 , len (service .Spec .Ports ))
832
833
for _ , port := range service .Spec .Ports {
833
834
// Check if the service is exposed via NodePort mechanism in the cluster
834
835
// This is a random port chosen by the cluster when the deployment is created
835
836
nodePort := port .NodePort
836
837
if nodePort > 0 {
837
838
// Record the actual port inside the container that is exposed
838
- v := ctypes .ForwardedPortStatus {
839
+ v := apclient .ForwardedPortStatus {
839
840
Host : settings .ClusterPublicHostname ,
840
841
Port : uint16 (port .TargetPort .IntVal ), // nolint: gosec
841
842
ExternalPort : uint16 (nodePort ), // nolint: gosec
@@ -865,7 +866,7 @@ func (c *client) ForwardedPortStatus(ctx context.Context, leaseID mtypes.LeaseID
865
866
}
866
867
867
868
// LeaseStatus todo: limit number of results and do pagination / streaming
868
- func (c * client ) LeaseStatus (ctx context.Context , lid mtypes.LeaseID ) (map [string ]* ctypes .ServiceStatus , error ) {
869
+ func (c * client ) LeaseStatus (ctx context.Context , lid mtypes.LeaseID ) (map [string ]* apclient .ServiceStatus , error ) {
869
870
settingsI := ctx .Value (builder .SettingsKey )
870
871
if nil == settingsI {
871
872
return nil , kubeclienterrors .ErrNotConfiguredWithSettings
@@ -904,7 +905,7 @@ func (c *client) LeaseStatus(ctx context.Context, lid mtypes.LeaseID) (map[strin
904
905
return serviceStatus , nil
905
906
}
906
907
907
- func (c * client ) ServiceStatus (ctx context.Context , lid mtypes.LeaseID , name string ) (* ctypes .ServiceStatus , error ) {
908
+ func (c * client ) ServiceStatus (ctx context.Context , lid mtypes.LeaseID , name string ) (* apclient .ServiceStatus , error ) {
908
909
if err := c .leaseExists (ctx , lid ); err != nil {
909
910
return nil , err
910
911
}
@@ -919,7 +920,7 @@ func (c *client) ServiceStatus(ctx context.Context, lid mtypes.LeaseID, name str
919
920
return nil , kubeclienterrors .ErrNoManifestForLease
920
921
}
921
922
922
- var result * ctypes .ServiceStatus
923
+ var result * apclient .ServiceStatus
923
924
924
925
var svc * crd.ManifestService
925
926
@@ -959,7 +960,7 @@ func (c *client) ServiceStatus(ctx context.Context, lid mtypes.LeaseID, name str
959
960
return nil , kubeclienterrors .ErrNoDeploymentForLease
960
961
}
961
962
962
- result = & ctypes .ServiceStatus {
963
+ result = & apclient .ServiceStatus {
963
964
Name : deployment .Name ,
964
965
Available : deployment .Status .AvailableReplicas ,
965
966
Total : deployment .Status .Replicas ,
@@ -984,7 +985,7 @@ func (c *client) ServiceStatus(ctx context.Context, lid mtypes.LeaseID, name str
984
985
return nil , kubeclienterrors .ErrNoDeploymentForLease
985
986
}
986
987
987
- result = & ctypes .ServiceStatus {
988
+ result = & apclient .ServiceStatus {
988
989
Name : statefulset .Name ,
989
990
Available : statefulset .Status .CurrentReplicas ,
990
991
Total : statefulset .Status .Replicas ,
@@ -1073,7 +1074,7 @@ func (c *client) leaseExists(ctx context.Context, lid mtypes.LeaseID) error {
1073
1074
return nil
1074
1075
}
1075
1076
1076
- func (c * client ) deploymentsForLease (ctx context.Context , lid mtypes.LeaseID ) (map [string ]* ctypes .ServiceStatus , error ) {
1077
+ func (c * client ) deploymentsForLease (ctx context.Context , lid mtypes.LeaseID ) (map [string ]* apclient .ServiceStatus , error ) {
1077
1078
if err := c .leaseExists (ctx , lid ); err != nil {
1078
1079
return nil , err
1079
1080
}
@@ -1096,11 +1097,11 @@ func (c *client) deploymentsForLease(ctx context.Context, lid mtypes.LeaseID) (m
1096
1097
return nil , fmt .Errorf ("%s: %w" , kubeclienterrors .ErrInternalError .Error (), err )
1097
1098
}
1098
1099
1099
- serviceStatus := make (map [string ]* ctypes .ServiceStatus )
1100
+ serviceStatus := make (map [string ]* apclient .ServiceStatus )
1100
1101
1101
1102
if deployments != nil {
1102
1103
for _ , deployment := range deployments .Items {
1103
- serviceStatus [deployment .Name ] = & ctypes .ServiceStatus {
1104
+ serviceStatus [deployment .Name ] = & apclient .ServiceStatus {
1104
1105
Name : deployment .Name ,
1105
1106
Available : deployment .Status .AvailableReplicas ,
1106
1107
Total : deployment .Status .Replicas ,
@@ -1115,7 +1116,7 @@ func (c *client) deploymentsForLease(ctx context.Context, lid mtypes.LeaseID) (m
1115
1116
1116
1117
if statefulsets != nil {
1117
1118
for _ , statefulset := range statefulsets .Items {
1118
- serviceStatus [statefulset .Name ] = & ctypes .ServiceStatus {
1119
+ serviceStatus [statefulset .Name ] = & apclient .ServiceStatus {
1119
1120
Name : statefulset .Name ,
1120
1121
Available : statefulset .Status .CurrentReplicas ,
1121
1122
Total : statefulset .Status .Replicas ,
0 commit comments