Skip to content

Commit

Permalink
fix(network): adds _get_limits method for cloud routed network.
Browse files Browse the repository at this point in the history
  • Loading branch information
RomilShah committed Apr 20, 2023
1 parent d4847a5 commit 4751307
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions riocli/network/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from rapyuta_io import Client
from rapyuta_io.clients.native_network import NativeNetwork, Parameters as NativeNetworkParameters
from rapyuta_io.clients.routed_network import RoutedNetwork, Parameters as RoutedNetworkParameters
from rapyuta_io.clients.common_models import Limits

from riocli.model import Model
from riocli.network.util import find_network_name, NetworkNotFound
Expand Down Expand Up @@ -73,6 +74,9 @@ def to_v1(self, client: Client) -> NativeNetwork:

return NativeNetwork(self.metadata.name, self.spec.runtime.lower(), self.spec.rosDistro, parameters=parameters)

def _get_limits(self):
return Limits(self.spec.resourceLimits['cpu'], self.spec.resourceLimits['memory'])

def _create_routed_network(self, client: Client) -> RoutedNetwork:
if self.spec.runtime == 'cloud':
network = self._create_cloud_routed_network(client)
Expand Down

0 comments on commit 4751307

Please sign in to comment.