Skip to content

Commit f43e29b

Browse files
ChrisJBurnsclaude
andauthored
Add printer columns to all CRDs (#4489)
Add printer columns to all CRDs for informative kubectl output `kubectl get` output for config CRDs (MCPOIDCConfig, MCPTelemetryConfig, MCPExternalAuthConfig, MCPToolConfig) was minimal — showing only type/name and age. Operators had to use `-o yaml` to check readiness or which servers reference a config. This adds Ready and References columns to all config CRDs, renames MCPOIDCConfig's column to "Source" for clarity, and fixes the MCPGroup `printerColumn` typo that prevented its columns from rendering. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 47c3651 commit f43e29b

15 files changed

Lines changed: 76 additions & 38 deletions

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,8 @@ type MCPExternalAuthConfigStatus struct {
722722
// +kubebuilder:subresource:status
723723
// +kubebuilder:resource:shortName=extauth;mcpextauth,categories=toolhive
724724
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`
725+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Valid')].status`
726+
// +kubebuilder:printcolumn:name="References",type=string,JSONPath=`.status.referencingServers`
725727
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
726728

727729
// MCPExternalAuthConfig is the Schema for the mcpexternalauthconfigs API.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ const (
7575
//+kubebuilder:object:root=true
7676
//+kubebuilder:subresource:status
7777
//+kubebuilder:resource:shortName=mcpg;mcpgroup,categories=toolhive
78-
//nolint:lll
79-
//+kubebuilder:printerColumn:name="Servers",type="integer",JSONPath=".status.serverCount",description="The number of MCPServers in this group"
80-
//+kubebuilder:printerColumn:name="Phase",type="string",JSONPath=".status.phase",description="The phase of the MCPGroup"
81-
//+kubebuilder:printerColumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="The age of the MCPGroup"
78+
//+kubebuilder:printcolumn:name="Servers",type="integer",JSONPath=".status.serverCount"
79+
//+kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase"
8280
//+kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='MCPServersChecked')].status"
81+
//+kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
8382

8483
// MCPGroup is the Schema for the mcpgroups API
8584
type MCPGroup struct {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ type MCPOIDCConfigStatus struct {
154154
// +kubebuilder:object:root=true
155155
// +kubebuilder:subresource:status
156156
// +kubebuilder:resource:shortName=mcpoidc,categories=toolhive
157-
// +kubebuilder:printcolumn:name="Type",type=string,JSONPath=`.spec.type`
157+
// +kubebuilder:printcolumn:name="Source",type=string,JSONPath=`.spec.type`
158+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Valid')].status`
159+
// +kubebuilder:printcolumn:name="References",type=string,JSONPath=`.status.referencingServers`
158160
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
159161

160162
// MCPOIDCConfig is the Schema for the mcpoidcconfigs API.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ type MCPTelemetryConfigStatus struct {
6868
// +kubebuilder:subresource:status
6969
// +kubebuilder:resource:shortName=mcpotel,categories=toolhive
7070
// +kubebuilder:printcolumn:name="Endpoint",type=string,JSONPath=`.spec.endpoint`
71-
// +kubebuilder:printcolumn:name="Tracing",type=boolean,JSONPath=`.spec.tracingEnabled`
72-
// +kubebuilder:printcolumn:name="Metrics",type=boolean,JSONPath=`.spec.metricsEnabled`
71+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Valid')].status`
72+
// +kubebuilder:printcolumn:name="References",type=string,JSONPath=`.status.referencingServers`
7373
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
7474

7575
// MCPTelemetryConfig is the Schema for the mcptelemetryconfigs API.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,8 @@ type MCPToolConfigStatus struct {
105105
// +kubebuilder:object:root=true
106106
// +kubebuilder:subresource:status
107107
// +kubebuilder:resource:shortName=tc;toolconfig,categories=toolhive
108-
// +kubebuilder:printcolumn:name="Filter Count",type=integer,JSONPath=`.spec.toolsFilter[*]`
109-
// +kubebuilder:printcolumn:name="Override Count",type=integer,JSONPath=`.spec.toolsOverride`
110-
// +kubebuilder:printcolumn:name="Referenced By",type=string,JSONPath=`.status.referencingServers`
108+
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=='Valid')].status`
109+
// +kubebuilder:printcolumn:name="References",type=string,JSONPath=`.status.referencingServers`
111110
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
112111

113112
// MCPToolConfig is the Schema for the mcptoolconfigs API.

deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcpexternalauthconfigs.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ spec:
2323
- jsonPath: .spec.type
2424
name: Type
2525
type: string
26+
- jsonPath: .status.conditions[?(@.type=='Valid')].status
27+
name: Ready
28+
type: string
29+
- jsonPath: .status.referencingServers
30+
name: References
31+
type: string
2632
- jsonPath: .metadata.creationTimestamp
2733
name: Age
2834
type: date

deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcpgroups.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,18 @@ spec:
2020
scope: Namespaced
2121
versions:
2222
- additionalPrinterColumns:
23+
- jsonPath: .status.serverCount
24+
name: Servers
25+
type: integer
26+
- jsonPath: .status.phase
27+
name: Phase
28+
type: string
2329
- jsonPath: .status.conditions[?(@.type=='MCPServersChecked')].status
2430
name: Ready
2531
type: string
32+
- jsonPath: .metadata.creationTimestamp
33+
name: Age
34+
type: date
2635
name: v1alpha1
2736
schema:
2837
openAPIV3Schema:

deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcpoidcconfigs.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ spec:
2020
versions:
2121
- additionalPrinterColumns:
2222
- jsonPath: .spec.type
23-
name: Type
23+
name: Source
24+
type: string
25+
- jsonPath: .status.conditions[?(@.type=='Valid')].status
26+
name: Ready
27+
type: string
28+
- jsonPath: .status.referencingServers
29+
name: References
2430
type: string
2531
- jsonPath: .metadata.creationTimestamp
2632
name: Age

deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcptelemetryconfigs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ spec:
2222
- jsonPath: .spec.endpoint
2323
name: Endpoint
2424
type: string
25-
- jsonPath: .spec.tracingEnabled
26-
name: Tracing
27-
type: boolean
28-
- jsonPath: .spec.metricsEnabled
29-
name: Metrics
30-
type: boolean
25+
- jsonPath: .status.conditions[?(@.type=='Valid')].status
26+
name: Ready
27+
type: string
28+
- jsonPath: .status.referencingServers
29+
name: References
30+
type: string
3131
- jsonPath: .metadata.creationTimestamp
3232
name: Age
3333
type: date

deploy/charts/operator-crds/files/crds/toolhive.stacklok.dev_mcptoolconfigs.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ spec:
2020
scope: Namespaced
2121
versions:
2222
- additionalPrinterColumns:
23-
- jsonPath: .spec.toolsFilter[*]
24-
name: Filter Count
25-
type: integer
26-
- jsonPath: .spec.toolsOverride
27-
name: Override Count
28-
type: integer
23+
- jsonPath: .status.conditions[?(@.type=='Valid')].status
24+
name: Ready
25+
type: string
2926
- jsonPath: .status.referencingServers
30-
name: Referenced By
27+
name: References
3128
type: string
3229
- jsonPath: .metadata.creationTimestamp
3330
name: Age

0 commit comments

Comments
 (0)