Skip to content

Conversation

@Zerpet
Copy link
Member

@Zerpet Zerpet commented Feb 18, 2022

This is related #233

Note to contributors: remember to re-generate client set if there are any API changes

Summary Of Changes

  • Support for custom internal cluster domain name
  • Refactor unused code and extracted env var names as constants

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.

Comment on lines +11 to +13
### Tools
# Allows flexbility to use other build kits, like nerdctl
BUILD_KIT ?= /usr/local/bin/docker
Copy link
Contributor

Choose a reason for hiding this comment

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

Love it!

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]>
@Zerpet Zerpet force-pushed the issue-233-rebase-2 branch from 729c3a1 to 4c25eef Compare February 28, 2022 16:04
@Zerpet Zerpet requested a review from MirahImage February 28, 2022 16:04
Comment on lines +111 to +117
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())
Copy link
Member Author

@Zerpet Zerpet Feb 28, 2022

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.

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.

4 participants