Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fb159b1
unify workload management across CLI and Kubernetes
amirejaz Nov 6, 2025
480db30
removed unnecessary files
amirejaz Nov 6, 2025
0b09d38
unified workload with separate workloads for cli and k8s
amirejaz Nov 10, 2025
030368d
merged remote main branch into local
amirejaz Nov 11, 2025
068e2ce
refactor the constructor and fix tests
amirejaz Nov 11, 2025
c58ce7c
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 11, 2025
31e40e7
adds more tests
amirejaz Nov 11, 2025
2c921c7
fixed thv listing
amirejaz Nov 11, 2025
1d6d807
checks the kubernetes client runtime instead of the environment
amirejaz Nov 12, 2025
bec49a2
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 12, 2025
26a37ad
fix e2e tests
amirejaz Nov 12, 2025
9dd801e
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 12, 2025
f3fd09f
improves test coverage
amirejaz Nov 12, 2025
846fe38
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 12, 2025
b70ac65
refactor the k8s manager into separate package
amirejaz Nov 12, 2025
dd7c0ed
removed logs fns
amirejaz Nov 12, 2025
d121268
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 13, 2025
0608b7a
use pkg/k8s package for client and namespace
amirejaz Nov 13, 2025
ed6b6d9
moved discoverer creation to factory inside pkg
amirejaz Nov 14, 2025
152a921
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 14, 2025
5ed3dff
refactor the workload manager
amirejaz Nov 17, 2025
8dce2b6
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 17, 2025
8e819a0
removed changes regarding the workload manager refactor
amirejaz Nov 17, 2025
e14a9ea
use default workload manager as the cli implmentation for workload di…
amirejaz Nov 17, 2025
07698d2
Merge remote-tracking branch 'origin/main' into unified-workload-manager
amirejaz Nov 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions cmd/vmcp/app/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/stacklok/toolhive/pkg/vmcp/discovery"
vmcprouter "github.com/stacklok/toolhive/pkg/vmcp/router"
vmcpserver "github.com/stacklok/toolhive/pkg/vmcp/server"
"github.com/stacklok/toolhive/pkg/workloads"
)

var rootCmd = &cobra.Command{
Expand Down Expand Up @@ -227,32 +226,22 @@ func discoverBackends(ctx context.Context, cfg *config.Config) ([]vmcp.Backend,
}

// Initialize managers for backend discovery
logger.Info("Initializing workload and group managers")
workloadsManager, err := workloads.NewManager(ctx)
logger.Info("Initializing group manager")
groupsManager, err := groups.NewManager()
if err != nil {
logger.Warnf("Failed to create workloads manager (expected in Kubernetes): %v", err)
logger.Warnf("Backend discovery will be skipped - continuing with empty backend list")
return []vmcp.Backend{}, backendClient, nil
return nil, nil, fmt.Errorf("failed to create groups manager: %w", err)
}

groupsManager, err := groups.NewManager()
// Create backend discoverer based on runtime environment
discoverer, err := aggregator.NewBackendDiscoverer(ctx, groupsManager, cfg.OutgoingAuth)
if err != nil {
logger.Warnf("Failed to create groups manager (expected in Kubernetes): %v", err)
logger.Warnf("Backend discovery will be skipped - continuing with empty backend list")
return []vmcp.Backend{}, backendClient, nil
return nil, nil, fmt.Errorf("failed to create backend discoverer: %w", err)
}

// Create backend discoverer and discover backends
discoverer := aggregator.NewCLIBackendDiscoverer(workloadsManager, groupsManager, cfg.OutgoingAuth)

logger.Infof("Discovering backends in group: %s", cfg.Group)
backends, err := discoverer.Discover(ctx, cfg.Group)
if err != nil {
// Handle discovery errors gracefully - this is expected in Kubernetes
logger.Warnf("CLI backend discovery failed (likely running in Kubernetes): %v", err)
logger.Warnf("Kubernetes backend discovery is not yet implemented - continuing with empty backend list")
logger.Warnf("The vmcp server will start but won't proxy any backends until this feature is implemented")
return []vmcp.Backend{}, backendClient, nil
return nil, nil, fmt.Errorf("failed to discover backends: %w", err)
}

if len(backends) == 0 {
Expand Down
153 changes: 0 additions & 153 deletions pkg/vmcp/aggregator/cli_discoverer.go

This file was deleted.

Loading
Loading