Skip to content

Commit

Permalink
Fix location for regional NFS service.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 689175891
  • Loading branch information
andyz422 authored and copybara-github committed Oct 24, 2024
1 parent 51c6add commit ad6ffdc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions perfkitbenchmarker/providers/gcp/gce_nfs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@

FLAGS = flags.FLAGS

STANDARD = 'STANDARD'
PREMIUM = 'PREMIUM'
ZONAL = 'ZONAL'
REGIONAL = 'REGIONAL'
HIGH_SCALE_SSD = 'high-scale-ssd'
ENTERPRISE = 'enterprise'


class GceNFSDiskSpec(disk.BaseNFSDiskSpec):
CLOUD = provider_info.GCP
Expand All @@ -23,10 +30,7 @@ class GceNfsService(nfs_service.BaseNfsService):
"""Resource for GCE NFS service."""

CLOUD = provider_info.GCP
NFS_TIERS = (
'STANDARD',
'PREMIUM'
)
NFS_TIERS = (STANDARD, PREMIUM, ZONAL, REGIONAL, HIGH_SCALE_SSD, ENTERPRISE)
DEFAULT_NFS_VERSION = '3.0'
DEFAULT_TIER = 'STANDARD'
user_managed = False
Expand Down Expand Up @@ -99,6 +103,8 @@ def _Describe(self):
return self._NfsCommand('describe')

def _GetLocation(self):
if self.nfs_tier in [ENTERPRISE, REGIONAL]:
return util.GetRegionFromZone(self.zone)
return self.zone

def _NfsCommand(self, verb, *args):
Expand Down

0 comments on commit ad6ffdc

Please sign in to comment.