Cloud provider GCP: adopt changes to CCM / CNM for GCP

This commit is contained in:
Malte Poll 2022-03-25 10:55:37 +01:00 committed by Malte Poll
parent a59ce30e7b
commit 3c1ddfb94e
9 changed files with 430 additions and 60 deletions

View file

@ -2,7 +2,6 @@ package gcp
import (
"context"
"errors"
"fmt"
"regexp"
"strings"
@ -267,7 +266,7 @@ func splitProviderID(providerID string) (project, zone, instance string, err err
providerIDregex := regexp.MustCompile(`^gce://([^/]+)/([^/]+)/([^/]+)$`)
matches := providerIDregex.FindStringSubmatch(providerID)
if len(matches) != 4 {
return "", "", "", errors.New("error splitting providerID")
return "", "", "", fmt.Errorf("error splitting providerID: %v", providerID)
}
return matches[1], matches[2], matches[3], nil
}