Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy rejects requests for first generation instances. #269

Merged
merged 1 commit into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/cloud_sql_proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions proxy/certs/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 := ""
Expand Down