diff --git a/cmd/cloud_sql_proxy/proxy.go b/cmd/cloud_sql_proxy/proxy.go index 4b9509bbe..f6bc86c7a 100644 --- a/cmd/cloud_sql_proxy/proxy.go +++ b/cmd/cloud_sql_proxy/proxy.go @@ -264,6 +264,10 @@ func parseInstanceConfig(dir, instance string, cl *http.Client) (instanceConfig, if err != nil { return instanceConfig{}, err } + if in.BackendType == "FIRST_GEN" { + logging.Errorf("WARNING: proxy client does not support first generation Cloud SQL instances.") + return instanceConfig{}, fmt.Errorf("%q is a first generation instance", instance) + } if strings.HasPrefix(strings.ToLower(in.DatabaseVersion), "postgres") { path := filepath.Join(dir, instance) if err := os.MkdirAll(path, 0755); err != nil { diff --git a/proxy/certs/certs.go b/proxy/certs/certs.go index f117a01c7..9213fc9a7 100644 --- a/proxy/certs/certs.go +++ b/proxy/certs/certs.go @@ -259,6 +259,10 @@ func (s *RemoteCertSource) Remote(instance string) (cert *x509.Certificate, addr if len(data.IpAddresses) == 0 { return nil, "", "", fmt.Errorf("no IP address found for %v", instance) } + if data.BackendType == "FIRST_GEN" { + logging.Errorf("WARNING: proxy client does not support first generation Cloud SQL instances.") + return nil, "", "", fmt.Errorf("%q is a first generation instance", instance) + } // Find the first matching IP address by user input IP address types ipAddrInUse := ""