-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug in
zoneToRegion
which didn't work if multiple zones where…
… passed separated by `__` (#2731) * Fix the bug in `zoneToRegion` There was a bug in `zoneToRegion` function because of which the PV resources were not being created with correct `nodeAffinity` set. `zoneToRegion` tried to get regions from passed zone just by removing `-[onechar]` from the zone. For example if we passed the zone `us-west1-b` this function would return `us-west1` by removing `-b`. This would work properly in the cases where just one zone is given to the function. But if more than one zones are given to the function (separated by `__`), this function didn't work properly. Because for the input `us-west1-a__us-west2-a` it returned `us-west1-a__us-west2` (using existing logic), which is incorrect. As we can see the `-a` was not reomved from first zone. This commit doesn't introduce the separator `__`, it was already part of code and zones were being passed to this funciton separated by `__`. This commit fixes above problem by making sure that we split the zones and then remove `-char` from the zone and add the regions together again using `__` sep. * Add a const for regions and zone separator * Correct function name
- Loading branch information
1 parent
f27ff46
commit 79fb8cc
Showing
4 changed files
with
88 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters