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

feat: add support for FUSE #135

Merged
merged 12 commits into from
Sep 19, 2022
Merged

feat: add support for FUSE #135

merged 12 commits into from
Sep 19, 2022

Conversation

enocom
Copy link
Member

@enocom enocom commented Sep 15, 2022

@enocom enocom requested a review from a team September 15, 2022 16:58
}

const readmeText = `
When applications attempt to open files in this directory, a remote connection
Copy link
Member Author

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.

return c.NewInode(ctx, &readme{}, fs.StableAttr{}), fs.OK
}

instanceURI, err := toFullURI(instance)
Copy link
Member Author

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.

Copy link
Contributor

@hessjcg hessjcg left a 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.

internal/proxy/proxy.go Outdated Show resolved Hide resolved
internal/proxy/proxy.go Show resolved Hide resolved
Copy link
Contributor

@hessjcg hessjcg left a 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.

@@ -151,10 +160,13 @@ var (
// '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/([^:]+)")
Copy link
Contributor

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])

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #137.

internal/proxy/other_test.go Show resolved Hide resolved
Copy link
Contributor

@hessjcg hessjcg left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for FUSE mounts
2 participants