Build http.client to avoid rest.TransportFor in toolset#35
Build http.client to avoid rest.TransportFor in toolset#35saswatamcode wants to merge 3 commits intorhobs:mainfrom
Conversation
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
| // which would inherit the AccessControlRoundTripper. | ||
| func createAPIConfigWithToken(restConfig *rest.Config, prometheusURL, token string, insecure bool) (promapi.Config, error) { | ||
| apiConfig := promapi.Config{ | ||
| Address: prometheusURL, |
There was a problem hiding this comment.
I'm not sure if this will work in the multi cluster case. In general, the idea is that the params passed into each tool call will be configured to communicate to any target cluster transparently, see how that gets set up for ACM (which uses the cluster proxy addon to communicate to the target cluster) here: https://github.com/openshift/openshift-mcp-server/blob/c8655b776aa11143bcf37d0a61a6ecc445d952f3/pkg/kubernetes/provider_acm_hub.go#L549
If the idea is that these tools should not be able to target multiple clusters you would need to set cluster aware to false: https://github.com/openshift/openshift-mcp-server/blob/c8655b776aa11143bcf37d0a61a6ecc445d952f3/pkg/toolsets/config/configuration.go#L31
Otherwise we would probably need to figure out how to make sure that the prometheus url actually goes to the target cluster
There was a problem hiding this comment.
So this is a question I had as well. In ACM case, ideally, this toolset wouldn't be going cluster by cluster but rather just switch to the ACM hub Thanos instance.
I'd need to figure out how to coordinate that when creating these clients
There was a problem hiding this comment.
I'm going to handle this in next PR
There was a problem hiding this comment.
if you set cluster aware to false it should go to the hub cluster, as far as I know
There was a problem hiding this comment.
I've set it to false 43cddc4.
But my point was more that the ACM Hub Thanos actually relies on mTLS auth + custom rbac logic. So would need a way to define the behavior here.
Signed-off-by: Saswata Mukherjee <saswataminsta@yahoo.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: iNecas, saswatamcode The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
No description provided.