Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/oklog/run v1.1.0
github.com/panta/machineid v1.0.2
github.com/signadot/go-sdk v0.3.8-0.20260105152858-7f85937470f8
github.com/signadot/libconnect v0.1.1-0.20260105152930-8677498c2388
github.com/signadot/libconnect v0.1.1-0.20260119111130-f21daa573daf
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.11.0
github.com/theckman/yacspin v0.13.12
Expand Down Expand Up @@ -171,6 +171,6 @@ require (
)

// Used for local dev
//replace github.com/signadot/libconnect => ../libconnect/
// replace github.com/signadot/libconnect => ../libconnect/

//replace github.com/signadot/go-sdk => ../go-sdk
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
github.com/signadot/go-sdk v0.3.8-0.20260105152858-7f85937470f8 h1:MQ6IebgvaT8KaclHmdO18D7r+zQj6FlR8949shHU4Vs=
github.com/signadot/go-sdk v0.3.8-0.20260105152858-7f85937470f8/go.mod h1:eSr+sGcPoeQvBH5v4Yy0+t2PlBHYohLDW+nxFQUj3L0=
github.com/signadot/libconnect v0.1.1-0.20260105152930-8677498c2388 h1:EAqVcmS2ovzum3RYfUTKKqC7lXyus/EIR0bgM4CkQTc=
github.com/signadot/libconnect v0.1.1-0.20260105152930-8677498c2388/go.mod h1:cAsgAummH9Q9DrLQ7+S3mqrBv/+ZYKVSEXjR/WfoUJM=
github.com/signadot/libconnect v0.1.1-0.20260119111130-f21daa573daf h1:NxF7XT6NmJwl4yifYM3Vmw1oPDonS0DeIWD8jg/NNLM=
github.com/signadot/libconnect v0.1.1-0.20260119111130-f21daa573daf/go.mod h1:cAsgAummH9Q9DrLQ7+S3mqrBv/+ZYKVSEXjR/WfoUJM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8=
github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY=
Expand Down
4 changes: 2 additions & 2 deletions internal/command/local/printers.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ func getRawDevboxSession(cfg *config.LocalStatus, devboxSession *commonapi.Devbo
}

result := &PrintableDevboxSession{
Healthy: devboxSession.Healthy,
DevboxId: devboxSession.DevboxId,
Healthy: devboxSession.Healthy,
DevboxId: devboxSession.DevboxId,
SessionId: devboxSession.SessionId,
}

Expand Down
10 changes: 5 additions & 5 deletions internal/command/sandbox/get_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ func getEnv(cfg *config.SandboxGetEnv, out, errOut io.Writer, name string) error
resEnv = k8senv.ResolveEnv(ctx, resEnv)

// print output
return printEnv(out, cfg.OutputFormat, resEnv)
return printEnv(out, cfg, resEnv)
}

func printEnv(out io.Writer, oFmt config.OutputFormat, resEnv []k8senv.EnvItem) error {
switch oFmt {
func printEnv(out io.Writer, cfg *config.SandboxGetEnv, resEnv []k8senv.EnvItem) error {
switch cfg.OutputFormat {
case config.OutputFormatDefault:
w := tabwriter.NewWriter(os.Stdout, 0, 4, 1, ' ', tabwriter.TabIndent)
for _, item := range resEnv {
_, err := w.Write([]byte(item.ToShellEval() + "\n"))
_, err := w.Write([]byte(item.ToShellEval(cfg.ShowSource) + "\n"))
if err != nil {
return err
}
Expand All @@ -112,7 +112,7 @@ func printEnv(out io.Writer, oFmt config.OutputFormat, resEnv []k8senv.EnvItem)
case config.OutputFormatYAML:
return print.RawYAML(out, resEnv)
default:
return fmt.Errorf("unknown output format %q", oFmt)
return fmt.Errorf("unknown output format %q", cfg.OutputFormat)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/command/sandbox/sandbox_subst_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var substCases = []SubstTest{
{
Yaml: `{"name":"aaa","spec":{"cluster":"@{dev}-cluster"}}`,
Args: []string{"dev=jane"},
Result: `{"endpoints":null,"name":"aaa","spec":{"cluster":"jane-cluster","endpoints":null,"forks":null,"local":null,"resources":null,"virtual":null}}`,
Result: `{"endpoints":null,"name":"aaa","spec":{"cluster":"jane-cluster","endpoints":null,"forks":null,"local":null,"middleware":null,"resources":null,"virtual":null}}`,
},
}

Expand Down
14 changes: 8 additions & 6 deletions internal/config/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ type SandboxGetFiles struct {
}

func (c *SandboxGetFiles) AddFlags(cmd *cobra.Command) {
cmd.Flags().StringVarP(&c.Local, "local", "l", "", "local workload name (default to first)")
cmd.Flags().StringVarP(&c.Container, "container", "c", "", "container name (defaults to first)")
cmd.Flags().StringVarP(&c.Local, "local", "l", "", "local workload name, defaults to the first local workload in the sandbox")
cmd.Flags().StringVarP(&c.Container, "container", "c", "", "container name, defaults to the first container in the local workload")
cmd.Flags().BoolVar(&c.NoClobber, "no-clobber", false, "do not overwrite files")
cmd.Flags().StringVarP(&c.OutputDir, "output-dir", "d", "", "output directory")
}
Expand All @@ -76,11 +76,13 @@ type SandboxCleanFiles struct {

type SandboxGetEnv struct {
*Sandbox
Local string
Container string
Local string
Container string
ShowSource bool
}

func (c *SandboxGetEnv) AddFlags(cmd *cobra.Command) {
cmd.Flags().StringVarP(&c.Local, "local", "l", "", "local workload name (default to first)")
cmd.Flags().StringVarP(&c.Container, "container", "c", "", "container")
cmd.Flags().StringVarP(&c.Local, "local", "l", "", "local workload name, defaults to the first local workload in the sandbox")
cmd.Flags().StringVarP(&c.Container, "container", "c", "", "container name, defaults to the first container in the local workload")
cmd.Flags().BoolVarP(&c.ShowSource, "show-source", "s", false, "show source in comments")
}
2 changes: 1 addition & 1 deletion internal/locald/rootmanager/sbmgr_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (mon *sbmgrMonitor) run() {
goto tick
}
mon.setProcInfo(procDone, procPID)

select {
case <-procDone:
case <-mon.done:
Expand Down
4 changes: 2 additions & 2 deletions internal/locald/sandboxmanager/sandbox_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ func (s *sbmServer) devboxSessionStatus() *commonapi.DevboxSessionStatus {
healthy, devboxID, sessionID, lastErrorTime, lastError := s.devboxSessionMgr.GetStatus()

status := &commonapi.DevboxSessionStatus{
Healthy: healthy,
DevboxId: devboxID,
Healthy: healthy,
DevboxId: devboxID,
SessionId: sessionID,
}

Expand Down
2 changes: 1 addition & 1 deletion internal/locald/sandboxmanager/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func ValidateSandboxManager(expectedCluster *string) (*sbmapi.StatusResponse, er
// Validate cluster matches
if expectedCluster != nil && *expectedCluster != ciConfig.ConnectionConfig.Cluster {
return nil, fmt.Errorf("sandbox spec cluster %q does not match connected cluster (%q)",
expectedCluster, ciConfig.ConnectionConfig.Cluster)
*expectedCluster, ciConfig.ConnectionConfig.Cluster)
}

return status, nil
Expand Down
4 changes: 2 additions & 2 deletions internal/trafficwatch/filemanager/logfile_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ type LogFileScanner struct {
cfg *LogFileScannerConfig
offset int64

resumeCh chan struct{}
closeCh chan struct{}
resumeCh chan struct{}
closeCh chan struct{}
closeOnce sync.Once
}

Expand Down
4 changes: 2 additions & 2 deletions internal/trafficwatch/filemanager/trafficwatch_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type TrafficWatchScanner struct {
path string
offset int64

resumeCh chan struct{}
closeCh chan struct{}
resumeCh chan struct{}
closeCh chan struct{}
closeOnce sync.Once

pendingRequests map[string]*RequestMetadata
Expand Down
1 change: 0 additions & 1 deletion internal/trafficwatch/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,3 @@ func ensureDir(p string) error {
}
return nil
}