Repository navigation
add local override {delete,list} - #209
Conversation
There was a problem hiding this comment.
The sandbox package doesn't build:
$ go build ./internal/command/sandbox/
# github.com/signadot/cli/internal/command/sandbox
internal/command/sandbox/delete.go:98:21: cannot use func() bool {…} (value of type func() bool) as func() "github.com/signadot/cli/internal/poll".PollingState value in argument to retry.Until|
@scott-cotton @scott-cotton PTAL whenever you can, it addressed all the comments you made |
| Use: "override --sandbox=<sandbox> --to=<target> [--detach]", | ||
| Short: "Override traffic routing for sandboxes", | ||
| Long: `Override traffic routing allows you to route traffic from a sandbox to a local service. | ||
| This is useful for testing local changes against a sandbox environment. |
There was a problem hiding this comment.
We should link to docs once available (in another PR)
| "time" | ||
| ) | ||
|
|
||
| type PollingState int |
There was a problem hiding this comment.
Not terribly important, but I find the addition of this type a bit more complicated than using bools as before because the reader of the code has to go and look it up, whereas a bool is just a bool indicating whether or the condition passed.
There was a problem hiding this comment.
Agree, but also i think the reading of true is still polling or it will stop? Then you have to go and see the details makes little bit harder. But if you think that's not true, sure happy to change it back
There was a problem hiding this comment.
It's certainly not objective. When called in context, like retry.Until(func () bool {...}) I don't think it's ambiguous which way the bool means stop, as there is Until there. And, at any rate, one needs to go look at the details of what is PollingState when done this way.
As it's quite subjective, I don't think it's important but just wanted to share my thoughts here. Please feel free to do with it what you think best.
|
@davixcky great to see the progress here. As it is basically workable, but also has some outstanding things to refine, I think it's ok to merge to feature-mw and refine on a stacked PR or to keep working in this one, as you prefer. |
* first commits for feature-mw - allow exp-middleware: in sandbox spec - support free revtuns * show-revtun-svc-name * use latest go-sdk with valueFrom * use go-sdk from main branch * rename revtun to forward (#212) depends on signadot/signadot#6231 * fix revtun to forward rename * add local override {delete,list} (#209) * add skeleton for local override * add sandbox builder * use sandbox builder to add middleware * Fix merge * apply go-mod-tidy * feat: add refresh api config and missing flags * refactor: move waitforsandbox readiness to separate function * feat: make sandbox apply use new utility + sandbox builder * feat: add helpers in sandbox builder that allows to set machine id and others fields * feat: complete create, list and delete methods for override * feat: move sbmg logic to sbmgr pacakge * fix: build * fix logic in sandbox builder for removing override * fix pending PR comments * fix logic for getting overrides * add examples for other commands and clear the local logic for override * redo poll enum --------- Co-authored-by: David Orozco <[email protected]>
Basic Override Creation
Override Management
Override Deletion
Expected Output Examples
Override Creation: