diff --git a/pkg/addons/addons_gcpauth.go b/pkg/addons/addons_gcpauth.go index e324e78dfc..4228918fc8 100644 --- a/pkg/addons/addons_gcpauth.go +++ b/pkg/addons/addons_gcpauth.go @@ -72,7 +72,7 @@ func enableAddonGCPAuth(cfg *config.ClusterConfig) error { // Grab credentials from where GCP would normally look ctx := context.Background() creds, err := google.FindDefaultCredentials(ctx) - if err != nil || creds.JSON == nil { + if err != nil { if detect.IsCloudShell() { if c := os.Getenv("CLOUDSDK_CONFIG"); c != "" { f, err := ioutil.ReadFile(path.Join(c, "application_default_credentials.json")) @@ -98,6 +98,11 @@ func enableAddonGCPAuth(cfg *config.ClusterConfig) error { return nil } + if creds.JSON == nil { + out.WarningT("You have authenicated with a service account that does not have an associated JSON. The GCP Auth requires credentials with a JSON file to in order to continue. The image pull secret has been imported.") + return nil + } + // Actually copy the creds over f := assets.NewMemoryAssetTarget(creds.JSON, credentialsPath, "0444")