-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add support for FUSE #135
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
Conversation
This is a port of GoogleCloudPlatform/cloud-sql-proxy#1381. Fixes #132.
| } | ||
|
|
||
| const readmeText = ` | ||
| When applications attempt to open files in this directory, a remote connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the README for AlloyDB.
internal/proxy/proxy.go
Outdated
| return c.NewInode(ctx, &readme{}, fs.StableAttr{}), fs.OK | ||
| } | ||
|
|
||
| instanceURI, err := toFullURI(instance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check expands the requested instance (e.g., proj.region.cluster.inst) into a full instance URI. If instance isn't a valid short Unix name, it returns an error.
hessjcg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double-check the concurrency in the Client.Close() method.
hessjcg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go. A few nits remain.
| // Instance URI is in the format: | ||
| // 'projects/<PROJECT>/locations/<REGION>/clusters/<CLUSTER>/instances/<INSTANCE>' | ||
| // Additionally, we have to support legacy "domain-scoped" projects (e.g. "google.com:PROJECT") | ||
| instURIRegex = regexp.MustCompile("projects/([^:]+(:[^:]+)?)/locations/([^:]+)/clusters/([^:]+)/instances/([^:]+)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional Nit: If you wanted to be really clever, use a non-capturing group (?: ) for the sub-domain in PROJECT group
instURIRegex = regexp.MustCompile(
"projects/([^:]+(?::[^:]+)?)/locations/([^:]+)/clusters/([^:]+)/instances/([^:]+)")
Then the so that your code down below goes 1,2,3,4:
project := string(m[1])
region := string(m[2])
cluster := string(m[3])
name := string(m[4])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fancy -- I'm working on making this code exported from the connector and will revisit this change with unit tests when I get there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #137.
hessjcg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Nice cleanup.
This is a port of GoogleCloudPlatform/cloud-sql-proxy#1381.
Fixes #132.