Skip to content

Commit 82ede32

Browse files
Expose resource-url parameter through MCPServer CRD (#1426)
Signed-off-by: ChrisJBurns <[email protected]> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: Chris Burns <[email protected]>
1 parent 15fc950 commit 82ede32

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

cmd/thv-operator/api/v1alpha1/mcpserver_types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ type OIDCConfigRef struct {
272272
// +kubebuilder:default=kubernetes
273273
Type string `json:"type"`
274274

275+
// ResourceURL is the explicit resource URL for OAuth discovery endpoint (RFC 9728)
276+
// If not specified, defaults to the in-cluster Kubernetes service URL
277+
// +optional
278+
ResourceURL string `json:"resourceUrl,omitempty"`
279+
275280
// Kubernetes configures OIDC for Kubernetes service account token validation
276281
// Only used when Type is "kubernetes"
277282
// +optional

cmd/thv-operator/controllers/mcpserver_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,10 @@ func (r *MCPServerReconciler) deploymentForMCPServer(m *mcpv1alpha1.MCPServer) *
431431
args = append(args, oidcArgs...)
432432

433433
// Add OAuth discovery resource URL for RFC 9728 compliance
434-
resourceURL := createServiceURL(m.Name, m.Namespace, m.Spec.Port)
434+
resourceURL := m.Spec.OIDCConfig.ResourceURL
435+
if resourceURL == "" {
436+
resourceURL = createServiceURL(m.Name, m.Namespace, m.Spec.Port)
437+
}
435438
args = append(args, fmt.Sprintf("--resource-url=%s", resourceURL))
436439
}
437440

deploy/charts/operator-crds/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: toolhive-operator-crds
33
description: A Helm chart for installing the ToolHive Operator CRDs into Kubernetes.
44
type: application
5-
version: 0.0.13
5+
version: 0.0.14
66
appVersion: "0.0.1"

deploy/charts/operator-crds/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# ToolHive Operator CRDs Helm Chart
33

4-
![Version: 0.0.13](https://img.shields.io/badge/Version-0.0.13-informational?style=flat-square)
4+
![Version: 0.0.14](https://img.shields.io/badge/Version-0.0.14-informational?style=flat-square)
55
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
66

77
A Helm chart for installing the ToolHive Operator CRDs into Kubernetes.

deploy/charts/operator-crds/templates/toolhive.stacklok.dev_mcpservers.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ spec:
228228
Defaults to true if not specified
229229
type: boolean
230230
type: object
231+
resourceUrl:
232+
description: |-
233+
ResourceURL is the explicit resource URL for OAuth discovery endpoint (RFC 9728)
234+
If not specified, defaults to the in-cluster Kubernetes service URL
235+
type: string
231236
type:
232237
default: kubernetes
233238
description: Type is the type of OIDC configuration

docs/operator/crd-api.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)