2
0
Эх сурвалжийг харах

Fix log statement error message such that it doesn't panic (eek!)

Matt Bolt 6 жил өмнө
parent
commit
bb5f596877

+ 6 - 1
pkg/cloud/gcpprovider.go

@@ -197,7 +197,12 @@ func (*GCP) loadGCPAuthSecret() {
 
 	exists, err := util.FileExists(authSecretPath)
 	if !exists || err != nil {
-		klog.V(4).Infof("[Warning] Failed to load auth secret, or was not mounted: %s", err.Error())
+		errMessage := "Secret does not exist"
+		if err != nil {
+			errMessage = err.Error()
+		}
+
+		klog.V(4).Infof("[Warning] Failed to load auth secret, or was not mounted: %s", errMessage)
 		return
 	}