@@ -131,6 +131,48 @@ func TestDeploymentForMCPServerWithPodTemplateSpec(t *testing.T) {
131
131
assert .True (t , podTemplatePatchFound , "Pod template patch should be included in the args" )
132
132
}
133
133
134
+ func TestDeploymentForMCPServerSecretsProviderEnv (t * testing.T ) {
135
+ t .Parallel ()
136
+ // Create a test MCPServer
137
+ mcpServer := & mcpv1alpha1.MCPServer {
138
+ ObjectMeta : metav1.ObjectMeta {
139
+ Name : "test-mcp-server" ,
140
+ Namespace : "default" ,
141
+ },
142
+ Spec : mcpv1alpha1.MCPServerSpec {
143
+ Image : "test-image:latest" ,
144
+ Transport : "stdio" ,
145
+ Port : 8080 ,
146
+ },
147
+ }
148
+
149
+ // Register the scheme
150
+ s := scheme .Scheme
151
+ s .AddKnownTypes (mcpv1alpha1 .GroupVersion , & mcpv1alpha1.MCPServer {})
152
+ s .AddKnownTypes (mcpv1alpha1 .GroupVersion , & mcpv1alpha1.MCPServerList {})
153
+
154
+ // Create a reconciler with the scheme
155
+ r := & MCPServerReconciler {
156
+ Scheme : s ,
157
+ }
158
+
159
+ // Call deploymentForMCPServer
160
+ deployment := r .deploymentForMCPServer (mcpServer )
161
+ require .NotNil (t , deployment , "Deployment should not be nil" )
162
+
163
+ // Check that the TOOLHIVE_SECRETS_PROVIDER environment variable is set to "none"
164
+ container := deployment .Spec .Template .Spec .Containers [0 ]
165
+ secretsProviderEnvFound := false
166
+ for _ , env := range container .Env {
167
+ if env .Name == "TOOLHIVE_SECRETS_PROVIDER" {
168
+ secretsProviderEnvFound = true
169
+ assert .Equal (t , "none" , env .Value , "TOOLHIVE_SECRETS_PROVIDER should be set to 'none'" )
170
+ break
171
+ }
172
+ }
173
+ assert .True (t , secretsProviderEnvFound , "TOOLHIVE_SECRETS_PROVIDER environment variable should be present" )
174
+ }
175
+
134
176
// Helper functions
135
177
func boolPtr (b bool ) * bool {
136
178
return & b
0 commit comments