Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug in zoneToRegion which didn't work if multiple zones where passed separated by __ #2731

Merged
merged 3 commits into from
Mar 8, 2024

Commits on Mar 8, 2024

  1. 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.
    viveksinghggits committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    d726f89 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d1cfc35 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c0d6952 View commit details
    Browse the repository at this point in the history