File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed
pkg/kubernetes-mcp-server/cmd Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -292,16 +292,20 @@ func (m *MCPServerOptions) Validate() error {
292292 klog .Warningf ("authorization-url is using http://, this is not recommended production use" )
293293 }
294294 }
295- /* If Kiali tools are enabled, validate Kiali toolset configuration */
296- if slices .Contains (m .StaticConfig .Toolsets , "kiali" ) {
297- cfg , ok := m .StaticConfig .GetToolsetConfig ("kiali" )
298- if ! ok {
299- return fmt .Errorf ("kiali configuration is required when kiali tools are enabled" )
300- }
301- if err := cfg .Validate (); err != nil {
302- return fmt .Errorf ("invalid kiali configuration: %w" , err )
303- }
304- }
295+ /* If Kiali tools are enabled, validate Kiali toolset configuration */
296+ if slices .Contains (m .StaticConfig .Toolsets , "kiali" ) {
297+ cfg , ok := m .StaticConfig .GetToolsetConfig ("kiali" )
298+ if ! ok {
299+ return fmt .Errorf ("kiali-url is required when kiali tools are enabled" )
300+ }
301+ if err := cfg .Validate (); err != nil {
302+ // Normalize error message for missing URL to match expected UX/tests
303+ if strings .Contains (err .Error (), "kiali-url is required" ) {
304+ return fmt .Errorf ("kiali-url is required when kiali tools are enabled" )
305+ }
306+ return fmt .Errorf ("invalid kiali configuration: %w" , err )
307+ }
308+ }
305309 return nil
306310}
307311
Original file line number Diff line number Diff line change 11toolsets = [" core" , " kiali" ]
22
3- [kiali ]
3+ [toolset_configs . kiali ]
44url = " http://kiali"
55
You can’t perform that action at this time.
0 commit comments