Skip to content

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.

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.

// 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/([^:]+)")
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.

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