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

Added support for namespaces and adminPartitions #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Ganeshrockz
Copy link

@Ganeshrockz Ganeshrockz commented Jun 6, 2023

This PR

  • Adds -consul-namespace and -consul-admin-partition flags to the existing consul-aws command. This will enable Consul enterprise users to sync their AWS to custom namespaces and admin partitions and vice versa. The default value for both these fields is an empty string and so there should be no changes in experience for non enterprise use cases.
  • Adds an integration test for the enterprise usecase.
  • Fixes a bug which prevented properly syncing AWS services into Consul when -aws-prefix flag is non empty. Because of this bug, the existing integration test was a bit flaky
  • Upgraded Go version of this repo to 1.20

@Ganeshrockz Ganeshrockz changed the title WIP: Spike to add basic E2E support for namespaces and adminPartitions Added support for namespaces and adminPartitions Jun 12, 2023
@Ganeshrockz Ganeshrockz marked this pull request as ready for review June 12, 2023 05:54
Copy link
Member

@hanshasselberg hanshasselberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for your work. My comments are no blockers, but I think it would be nice if Namespace and Partition are consistently (in CatalogDeregistration and CatalogRegistration or in AgentService) set only once across this PR.

catalog/consul.go Show resolved Hide resolved
catalog/consul.go Show resolved Hide resolved
catalog/consul.go Show resolved Hide resolved
catalog/consul.go Show resolved Hide resolved
catalog/sync.go Show resolved Hide resolved
catalog/sync_test.go Show resolved Hide resolved
catalog/sync_test.go Show resolved Hide resolved
@Ganeshrockz
Copy link
Author

@hanshasselberg Thanks for the review. I removed the additional Partition field that is added to the CatalogRegistration request. Consul server throws the following error when creating a service

sync_test.go:60: error creating service in Consul: Unexpected response code: 500 (Cannot register services and checks for multiple partitions in one registration request)

I guess we should have adminPartition set in both the places. Thoughts?

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.

2 participants