Skip to content

Commit 7129044

Browse files
committed
Be more lenient with spaces
Signed-off-by: David Gageot <[email protected]>
1 parent 89723dc commit 7129044

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

cmd/docker-mcp/internal/gateway/configuration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ func (c *Configuration) DockerImages() []string {
5959
}
6060

6161
func (c *Configuration) Find(serverName string) (*catalog.ServerConfig, *map[string]catalog.Tool, bool) {
62+
serverName = strings.TrimSpace(serverName)
63+
6264
// Is it in the catalog?
6365
server, ok := c.servers[serverName]
6466
if !ok {
@@ -329,6 +331,8 @@ func (c *FileBasedConfiguration) readConfig(ctx context.Context) (map[string]map
329331
func (c *FileBasedConfiguration) readDockerDesktopSecrets(ctx context.Context, servers map[string]catalog.Server, serverNames []string) (map[string]string, error) {
330332
var secretNames []string
331333
for _, serverName := range serverNames {
334+
serverName := strings.TrimSpace(serverName)
335+
332336
serverSpec, ok := servers[serverName]
333337
if !ok {
334338
continue

cmd/docker-mcp/secret-management/secret/export.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"sort"
7+
"strings"
78

89
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/catalog"
910
"github.com/docker/mcp-gateway/cmd/docker-mcp/internal/docker"
@@ -17,6 +18,8 @@ func Export(ctx context.Context, docker docker.Client, serverNames []string) (ma
1718

1819
var secretNames []string
1920
for _, serverName := range serverNames {
21+
serverName = strings.TrimSpace(serverName)
22+
2023
serverSpec, ok := catalog.Servers[serverName]
2124
if !ok {
2225
return nil, fmt.Errorf("server %s not found in catalog", serverName)

0 commit comments

Comments
 (0)