(cmd *cobra.Command, args []string)
| 135 | } |
| 136 | |
| 137 | func runSandboxListCommand(cmd *cobra.Command, args []string) (commandErr error) { |
| 138 | telemetry.TrackCommand(cmd.Context(), "sandbox", []string{"list"}) |
| 139 | defer func() { |
| 140 | telemetry.TrackCommandError(cmd.Context(), "sandbox", []string{"list"}, commandErr) |
| 141 | }() |
| 142 | |
| 143 | out := cli.NewPrinter(cmd.OutOrStdout()) |
| 144 | |
| 145 | cfg, err := userconfig.Load() |
| 146 | if err != nil { |
| 147 | return fmt.Errorf("failed to load config: %w", err) |
| 148 | } |
| 149 | |
| 150 | if len(cfg.SandboxAllowlist) == 0 { |
| 151 | out.Println("Persistent sandbox allowlist is empty.") |
| 152 | out.Println("\nAdd a host with: docker agent sandbox allow <host>") |
| 153 | return nil |
| 154 | } |
| 155 | |
| 156 | out.Printf("Persistent sandbox allowlist (%d):\n\n", len(cfg.SandboxAllowlist)) |
| 157 | for _, h := range cfg.SandboxAllowlist { |
| 158 | out.Printf(" %s\n", h) |
| 159 | } |
| 160 | return nil |
| 161 | } |
nothing calls this directly
no test coverage detected