فهرست منبع

ParseID: only log failure when id is not empty

Niko Kovacevic 5 سال پیش
والد
کامیت
083b63e8be
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 3 1
      pkg/cloud/awsprovider.go
  2. 3 1
      pkg/cloud/gcpprovider.go

+ 3 - 1
pkg/cloud/awsprovider.go

@@ -2398,7 +2398,9 @@ func (aws *AWS) ParseID(id string) string {
 	rx := regexp.MustCompile("aws://[^/]*/[^/]*/([^/]+)")
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
-		log.Infof("awsprovider.ParseID: failed to parse %s", id)
+		if id != "" {
+			log.Infof("awsprovider.ParseID: failed to parse %s", id)
+		}
 		return id
 	}
 

+ 3 - 1
pkg/cloud/gcpprovider.go

@@ -1409,7 +1409,9 @@ func (gcp *GCP) ParseID(id string) string {
 	rx := regexp.MustCompile("gce://[^/]*/[^/]*/([^/]+)")
 	match := rx.FindStringSubmatch(id)
 	if len(match) < 2 {
-		log.Infof("gcpprovider.ParseID: failed to parse %s", id)
+		if id != "" {
+			log.Infof("gcpprovider.ParseID: failed to parse %s", id)
+		}
 		return id
 	}