Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
4a6c657
Spike: refactoring ProxyMachinesContext and usage into a MultiMachine…
jabr Jan 26, 2026
19f47e5
Move proxy machines name/id lookup logic to server side
jabr Jan 27, 2026
b2a286b
Add machine/machines option distinction for handling single machine, …
jabr Jan 28, 2026
8b96d0c
Refactor the director-mapper-backend interactions and also address ch…
jabr Jan 28, 2026
1940cf2
Clean up some of the items noted on review
jabr Feb 9, 2026
c542468
Remove unnecessary error param from ProxyMachine(s)Context usage
jabr Feb 9, 2026
f4ee1ef
Remove newly added print warnings from ListImages for now
jabr Feb 9, 2026
b1ad042
Clean up proxy code and comments in machine rm
jabr Feb 9, 2026
887f95d
Return error if multi-machine proxy doesn't match all names/ids. Also…
jabr Feb 9, 2026
9a8fe9c
Rename metadata machine to machine_addr
jabr Feb 9, 2026
05867d8
Fix custom proxy call setup code in service.go but not entirely refac…
jabr Feb 9, 2026
57a0914
Fix some tests
jabr Feb 9, 2026
e02f92d
Remove ps collect container tests that are no longer relevant
jabr Feb 9, 2026
fcab71c
Fix tests and two bugs they caught
jabr Feb 9, 2026
4f72b05
Return more informative error from director/mapper with the specis ma…
jabr Feb 9, 2026
1206f87
Small refactoring of start/stop/remove container to remove linter dup…
jabr Feb 9, 2026
4940525
Clean up merge conflicts
jabr Apr 16, 2026
6faf9cd
Merge branch 'main' into improved-proxy-machines-context
jabr Apr 21, 2026
128b5fd
Fix some issues after merge
jabr Apr 21, 2026
28cacfa
Set min client/server version to 0.20.0 (guess for actual release thi…
jabr Apr 21, 2026
fde7c79
Pass machine name through in MachineServiceContainer
jabr Apr 22, 2026
f8cf71d
Unit tests on proxy director and mapper
jabr Apr 23, 2026
ac8c307
Dedup proxy machines on id (catches same machine specified by name an…
jabr Apr 23, 2026
b37dd06
Use machine name from metadata in client/volume
jabr Apr 23, 2026
05a016d
Handle edge cases with machine mapper: called with no names/ids shoul…
jabr Apr 23, 2026
0a21eb7
Return error from proxy director is both "machine" and "machines" are…
jabr Apr 23, 2026
c88c0da
Add metadata missing and error warnings in client/image
jabr Apr 23, 2026
5160327
Merge branch 'main' into improved-proxy-machines-context
jabr May 10, 2026
fea0c78
Post merge cleanup
jabr May 11, 2026
884fde0
Use atomic to store proxy Director's localAddress to handle unlikely …
jabr May 16, 2026
f3dc341
Fixes for minor review notes
jabr May 16, 2026
8da7d7d
Remove InspectMachine call that is no longer needed (machine name is …
jabr May 16, 2026
136fe2d
fix minor inconsistenct in test
jabr May 16, 2026
c0d62bb
test commit in PR branch
psviderski May 18, 2026
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
Prev Previous commit
Next Next commit
Pass machine name through in MachineServiceContainer
  • Loading branch information
jabr committed Apr 22, 2026
commit fde7c79731262511d54160cfd1c19c14758e9782
9 changes: 9 additions & 0 deletions cmd/uncloud/machine/rtt.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ func rtt(ctx context.Context, uncli *cli.CLI) error {
// Map machine IDs to names for display from the response.
machineNames := make(map[string]string)
for _, m := range resp.Machines {
// NOTE: Metadata should never be nil in practice. This is legacy fallback that will be removed.
if m.Metadata == nil {
tui.PrintWarning("metadata is missing in response from unknown server")
continue
}
if m.Metadata.Error != "" {
tui.PrintWarning(fmt.Sprintf("failed to inspect machine '%s': %s", m.Metadata.MachineName, m.Metadata.Error))
continue
}
if m.Machine == nil {
continue
}
Expand Down
11 changes: 1 addition & 10 deletions cmd/uncloud/service/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ func inspect(ctx context.Context, uncli *cli.CLI, opts inspectOptions) error {
return fmt.Errorf("inspect service: %w", err)
}

machines, err := client.ListMachines(ctx, nil)
if err != nil {
return fmt.Errorf("list machines: %w", err)
}
machinesNamesByID := make(map[string]string)
for _, m := range machines {
machinesNamesByID[m.Machine.Id] = m.Machine.Name
}

fmt.Printf("Service ID: %s\n", svc.ID)
fmt.Printf("Name: %s\n", svc.Name)
fmt.Printf("Mode: %s\n", svc.Mode)
Expand Down Expand Up @@ -89,7 +80,7 @@ func inspect(ctx context.Context, uncli *cli.CLI, opts inspectOptions) error {
for _, ctr := range allContainers {
created := units.HumanDuration(now.Sub(createdTimes[ctr.Container.ID])) + " ago"

machine := machinesNamesByID[ctr.MachineID]
machine := ctr.MachineName
if machine == "" {
machine = ctr.MachineID
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,9 @@ type Service struct {
}

type MachineServiceContainer struct {
MachineID string
Container ServiceContainer
MachineID string
MachineName string
Container ServiceContainer
}

// MachineIDs returns a list of unique machine IDs where the service containers are running.
Expand Down
14 changes: 7 additions & 7 deletions pkg/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"os"
"slices"
"sync"

Expand Down Expand Up @@ -125,8 +124,8 @@ func (cli *Client) InspectService(ctx context.Context, nameOrID string) (api.Ser

if mc.Metadata.Error != "" {
// TODO: return failed machines in the response.
fmt.Printf("WARNING: failed to list containers on machine '%s': %s\n",
mc.Metadata.MachineAddr, mc.Metadata.Error)
tui.PrintWarning(fmt.Sprintf("failed to list containers on machine '%s': %s",
mc.Metadata.MachineName, mc.Metadata.Error))
continue
}

Expand All @@ -135,8 +134,9 @@ func (cli *Client) InspectService(ctx context.Context, nameOrID string) (api.Ser
// Collect both regular and hook containers for the service.
for _, ctr := range append(mc.Containers, mc.HookContainers...) {
containers = append(containers, api.MachineServiceContainer{
MachineID: machineID,
Container: ctr,
MachineID: machineID,
MachineName: mc.Metadata.MachineName,
Container: ctr,
})

if ctr.ServiceID() == nameOrID {
Expand Down Expand Up @@ -354,8 +354,8 @@ func (cli *Client) ListServices(ctx context.Context) ([]api.Service, error) {

if mc.Metadata.Error != "" {
// TODO: return failed machines in the response.
fmt.Fprintf(os.Stderr, "WARNING: failed to list containers on machine '%s': %s\n",
mc.Metadata.MachineAddr, mc.Metadata.Error)
tui.PrintWarning(fmt.Sprintf("failed to list containers on machine '%s': %s",
mc.Metadata.MachineName, mc.Metadata.Error))
continue
}

Expand Down