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

Add support for Admin Partitions to endpoints controller #717

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

thisisnotashwin
Copy link
Contributor

Changes proposed in this PR:

  • set a flag on endpoints controller with the status of Admin Partitions being enabled.
  • when Admin Partitions are enabled, that first part of the upstream will be attempted to be broken into 3 pieces, named x.y.z where x is the service name, y is the namespace and z is the admin partition. if there are only 2 pieces, service name and namespace are assumed. if there is only 1 piece, service name is assumed.

How I've tested this PR:

  • unit tests.

How I expect reviewers to test this PR:

  • code review

Checklist:

  • Tests added

@thisisnotashwin thisisnotashwin requested review from lkysow, a team and ndhanushkodi and removed request for a team September 10, 2021 16:16
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

LGTM.

control-plane/connect-inject/endpoints_controller.go Outdated Show resolved Hide resolved
serviceName = strings.TrimSpace(pieces[0])
if len(pieces) > 1 {
if r.EnableConsulNamespaces || r.EnableConsulPartitions {
pieces := strings.SplitN(parts[0], ".", 3)
Copy link
Member

Choose a reason for hiding this comment

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

Is this the plan for Consul DNS too? svc.ns.part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup! based on conversations with @freddygv Consul DNS will become svc.ns.part

Comment on lines +409 to +429
consulNamespacesEnabled: true,
consulPartitionsEnabled: true,
Copy link
Member

Choose a reason for hiding this comment

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

Q: Is partitions with namespaces disabled supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤔 it should be. ill write a test for it. Everything should land in the default namespace in that case.
Should we error if the namespace provided is non-default?

Copy link
Member

Choose a reason for hiding this comment

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

No I think it's fine as is. Just might be weird for folks to have to use svc.ns.part if they don't have namespaces enabled but I think that's fine.

control-plane/subcommand/inject-connect/command.go Outdated Show resolved Hide resolved
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.

3 participants