@@ -31,6 +31,106 @@ const (
3131 TransportTypeHTTP TransportType = "http"
3232)
3333
34+ // MCPServerConditionType represents the condition types for MCPServer status.
35+ type MCPServerConditionType string
36+
37+ const (
38+ // MCPServerConditionAccepted indicates that the MCPServer has been accepted for processing.
39+ // This condition indicates that the MCPServer configuration is syntactically and semantically valid,
40+ // and the controller can generate some configuration for the underlying infrastructure.
41+ //
42+ // Possible reasons for this condition to be True are:
43+ //
44+ // * "Accepted"
45+ //
46+ // Possible reasons for this condition to be False are:
47+ //
48+ // * "InvalidConfig"
49+ // * "UnsupportedTransport"
50+ //
51+ // Controllers may raise this condition with other reasons,
52+ // but should prefer to use the reasons listed above to improve
53+ // interoperability.
54+ MCPServerConditionAccepted MCPServerConditionType = "Accepted"
55+
56+ // MCPServerConditionResolvedRefs indicates whether the controller was able to
57+ // resolve all the object references for the MCPServer.
58+ //
59+ // Possible reasons for this condition to be True are:
60+ //
61+ // * "ResolvedRefs"
62+ //
63+ // Possible reasons for this condition to be False are:
64+ //
65+ // * "ImageNotFound"
66+ //
67+ // Controllers may raise this condition with other reasons,
68+ // but should prefer to use the reasons listed above to improve
69+ // interoperability.
70+ MCPServerConditionResolvedRefs MCPServerConditionType = "ResolvedRefs"
71+
72+ // MCPServerConditionProgrammed indicates that the controller has successfully
73+ // programmed the underlying infrastructure with the MCPServer configuration.
74+ // This means that all required Kubernetes resources (Deployment, Service, ConfigMap)
75+ // have been created and configured.
76+ //
77+ // Possible reasons for this condition to be True are:
78+ //
79+ // * "Programmed"
80+ //
81+ // Possible reasons for this condition to be False are:
82+ //
83+ // * "DeploymentFailed"
84+ // * "ServiceFailed"
85+ // * "ConfigMapFailed"
86+ //
87+ // Controllers may raise this condition with other reasons,
88+ // but should prefer to use the reasons listed above to improve
89+ // interoperability.
90+ MCPServerConditionProgrammed MCPServerConditionType = "Programmed"
91+
92+ // MCPServerConditionReady indicates that the MCPServer is ready to serve traffic.
93+ // This condition indicates that the underlying Deployment has running pods
94+ // that are ready to accept connections.
95+ //
96+ // Possible reasons for this condition to be True are:
97+ //
98+ // * "Ready"
99+ //
100+ // Possible reasons for this condition to be False are:
101+ //
102+ // * "PodsNotReady"
103+ //
104+ // Controllers may raise this condition with other reasons,
105+ // but should prefer to use the reasons listed above to improve
106+ // interoperability.
107+ MCPServerConditionReady MCPServerConditionType = "Ready"
108+ )
109+
110+ // MCPServerConditionReason represents the reasons for MCPServer conditions.
111+ type MCPServerConditionReason string
112+
113+ const (
114+ // Accepted condition reasons
115+ MCPServerReasonAccepted MCPServerConditionReason = "Accepted"
116+ MCPServerReasonInvalidConfig MCPServerConditionReason = "InvalidConfig"
117+ MCPServerReasonUnsupportedTransport MCPServerConditionReason = "UnsupportedTransport"
118+
119+ // ResolvedRefs condition reasons
120+ MCPServerReasonResolvedRefs MCPServerConditionReason = "ResolvedRefs"
121+ MCPServerReasonImageNotFound MCPServerConditionReason = "ImageNotFound"
122+
123+ // Programmed condition reasons
124+ MCPServerReasonProgrammed MCPServerConditionReason = "Programmed"
125+ MCPServerReasonDeploymentFailed MCPServerConditionReason = "DeploymentFailed"
126+ MCPServerReasonServiceFailed MCPServerConditionReason = "ServiceFailed"
127+ MCPServerReasonConfigMapFailed MCPServerConditionReason = "ConfigMapFailed"
128+
129+ // Ready condition reasons
130+ MCPServerReasonReady MCPServerConditionReason = "Ready"
131+ MCPServerReasonPodsNotReady MCPServerConditionReason = "PodsNotReady"
132+ )
133+
34134// MCPServerSpec defines the desired state of MCPServer.
35135type MCPServerSpec struct {
36136 // Configuration to Deploy the MCP Server using a docker container
@@ -58,8 +158,29 @@ type HTTPTransport struct {
58158
59159// MCPServerStatus defines the observed state of MCPServer.
60160type MCPServerStatus struct {
61- // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
62- // Important: Run "make" to regenerate code after modifying this file
161+ // Conditions describe the current conditions of the MCPServer.
162+ // Implementations should prefer to express MCPServer conditions
163+ // using the `MCPServerConditionType` and `MCPServerConditionReason`
164+ // constants so that operators and tools can converge on a common
165+ // vocabulary to describe MCPServer state.
166+ //
167+ // Known condition types are:
168+ //
169+ // * "Accepted"
170+ // * "ResolvedRefs"
171+ // * "Programmed"
172+ // * "Ready"
173+ //
174+ // +optional
175+ // +listType=map
176+ // +listMapKey=type
177+ // +kubebuilder:validation:MaxItems=8
178+ Conditions []metav1.Condition `json:"conditions,omitempty"`
179+
180+ // ObservedGeneration is the most recent generation observed for this MCPServer.
181+ // It corresponds to the MCPServer's generation, which is updated on mutation by the API Server.
182+ // +optional
183+ ObservedGeneration int64 `json:"observedGeneration,omitempty"`
63184}
64185
65186// MCPServerDeployment
0 commit comments