-
Notifications
You must be signed in to change notification settings - Fork 78
Support for internal domain name as env var #310
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
| ### Tools | ||
| # Allows flexbility to use other build kits, like nerdctl | ||
| BUILD_KIT ?= /usr/local/bin/docker |
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.
Love it!
[#233] Signed-off-by: Aitor Perez Cedres <[email protected]>
It makes it easier to refactor/rename an env var. The env var to hint the internal cluster domain is also renamed, based on feedback from #233. Tests pass without those lines. The two tests that use this variable in 'rabbitmq_client_factory_test.go` call the same arguments. Signed-off-by: Aitor Perez Cedres <[email protected]>
Kubernetes internal domain name can be customised during the cluster creation. Some certificates are issued with a 'star domain', so that any subdomain can be validated. In these cases, the Topology Operator needs a 'hint' about this internal domain, so that it can connect to the correct URI to communicate with RabbitMQ. Related to #233. Signed-off-by: Aitor Perez Cedres <[email protected]>
The variable broke the workflow because the GitHub Actions containers do not have Docker executable in the default location set in the Makefile. Signed-off-by: Aitor Perez Cedres <[email protected]>
729c3a1 to
4c25eef
Compare
| It("sets the domain name in the URI to connect to RabbitMQ", func() { | ||
| for _, controller := range topologyControllers { | ||
| controller.SetInternalDomainName(".some-domain.com") | ||
| } | ||
|
|
||
| for i, _ := range topologyControllers { | ||
| Expect(client.Create(ctx, topologyObjects[i])).To(Succeed()) |
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 test was a bit flaky. For some reason, sometimes the test would fail by not adding the internal domain name. By splitting in two different loops the "setup" and the "tests", the flake seems to go away.
This is related #233
Note to contributors: remember to re-generate client set if there are any API changes
Summary Of Changes
Additional Context
It's notable the testing strategy used to test this new feature. In order to test that a controller is using the property, I had to expose such property in the controller's struct, and add a function that allows to interact with such property. Secondly, the interface was necessary to avoid duplicating the same code multiple times, in every controller test. The addition of this interface seems to have no impact, and it allows us to test common controller functionality in one place.
There's been no work done to allow arbitrary URI strings, as that use case is better covered by #294 and #296.
Pending to PR the docs to document this new feature.