mirror of
https://github.com/containers/kubernetes-mcp-server.git
synced 2025-10-23 01:22:57 +03:00
refactor: tools dependent on client config
This commit is contained in:
@@ -27,12 +27,6 @@ func NewSever() (*Server, error) {
|
||||
if err := s.reloadKubernetesClient(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
s.server.AddTools(slices.Concat(
|
||||
s.initConfiguration(),
|
||||
s.initEvents(),
|
||||
s.initPods(),
|
||||
s.initResources(),
|
||||
)...)
|
||||
return s, nil
|
||||
}
|
||||
|
||||
@@ -42,6 +36,12 @@ func (s *Server) reloadKubernetesClient() error {
|
||||
return err
|
||||
}
|
||||
s.k = k
|
||||
s.server.SetTools(slices.Concat(
|
||||
s.initConfiguration(),
|
||||
s.initEvents(),
|
||||
s.initPods(),
|
||||
s.initResources(),
|
||||
)...)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user