CSS-9572 Correct the usage of public address #1266
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug when using JIMM with cross-controller relations. When a client tries to perform a cross-model/cross-controller relation it:
The first call for app-offer details is a controller level call handled by JIMM here. You can see in that snippet that if the controller where the app offer is hosted has a public address, we don't return the controller's CA cert, if it doesn't have a public address we do return the controller's CA cert.
Trying the following:
juju debug-log
to see the following error:The destination controller cannot connect to the source controller via TLS because JAAS never provided the controller's CA cert. This issue arises because of our
jimmctl list-controller
command, here we fill the public-address field even when it's not actually a public address. That has been fixed.The second issue that comes up is our dialer only attempts to dial IPs that have "scope"="public". The scope is a concept, part of the struct used to store controller info, where the scope is determined by this function in Juju. For example, localhost has link-local scope. Scope "local-cloud" are all private IP ranges (e.g. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), which may still be reachable from JIMM.
Engineering checklist
Check only items that apply
Test instructions
Retried my steps above and was able to consume and relate two apps cross-controller.
Notes for code reviewers
Still working on tests.