-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Use REMOTE_CLUSTER_PROFILE for linked project connections when CPS is enabled #135964
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
base: main
Are you sure you want to change the base?
Use REMOTE_CLUSTER_PROFILE for linked project connections when CPS is enabled #135964
Conversation
… enabled Currently the presence of credentials for a linked project alias determines if the RCS2.0 REMOTE_CLUSTER_PROFILE is used for the transport profile. For CPS we want to use the REMOTE_CLUSTER_PROFILE, but will not be using the credentials manager. This PR adds a check to see if CPS is enabled and if so the REMOTE_CLUSTER_PROFILE is used when constructing RemoteClusterConnection instances. Resolves: ES-13109
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
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.
I have a different view on where we decide the transport profile.
RemoteClusterCredentialsManager credentialsManager, | ||
boolean hasCredentials, |
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.
It feels a bit awkward to me that hasCredentials
is essentially redundant. I'd personally prefer passing crossProjectEnabled
instead and still resolve the transport profile here. Both low and high level profiles are connection specific concepts. It feels natural to me that they are decided inside the connection? Also, I wonder whether we might need crossProjectEnabled
in future for other things in this class, e.g. returning it somehow in getConnectionInfo
?
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.
Understood. I refactored to pass crossProjectEnabled
.
server/src/main/java/org/elasticsearch/transport/RemoteClusterConnection.java
Outdated
Show resolved
Hide resolved
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.
LGTM
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.
LGTM 👍
Note: The serverless checks are now failing which seem related. You may need to adjust some of the integration tests (probably mute for now). |
Currently the presence of credentials for a linked project alias determines if the RCS2.0
REMOTE_CLUSTER_PROFILE
is used for the transport profile. For CPS we want to use theREMOTE_CLUSTER_PROFILE
, but will not be using the credentials manager. This PR adds a check to see if CPS is enabled and if so theREMOTE_CLUSTER_PROFILE
is used when constructing RemoteClusterConnection instances.I wanted to keep the knowledge of CPS limited to the
RemoteClusterService
, so the transport profile name and a boolean for if the alias has credentials are now passed to theRemoteClusterConnection
constructor. An additional unit test case has been added to verify thatREMOTE_CLUSTER_PROFILE
is used when CPS is enabled.Resolves: ES-13109