feature(vpn): onboard gateway#1417
Conversation
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
relates to STACKITCLI-353
458d051 to
f0fe08f
Compare
Merging this branch changes the coverage (1 decrease, 10 increase)
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
|
|
||
| ``` | ||
| Show the status of the gateway with the ID "xxx" | ||
| $ stackit beta vpn gateway describe xxx |
There was a problem hiding this comment.
wrong description
| $ stackit beta vpn gateway describe xxx | |
| $ stackit beta vpn gateway status xxx |
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| var regionFlag = globalflags.RegionFlag |
There was a problem hiding this comment.
These vars can be removed. You can instead directly use globalflags.ProjectIdFlag or globalflags.RegionFlag
| var projectIdFlag = globalflags.ProjectIdFlag | ||
| var regionFlag = globalflags.RegionFlag |
There was a problem hiding this comment.
same here, can be removed
| Example: examples.Build( | ||
| examples.NewExample( | ||
| `Show the status of the gateway with the ID "xxx"`, | ||
| "$ stackit beta vpn gateway describe xxx", |
There was a problem hiding this comment.
| "$ stackit beta vpn gateway describe xxx", | |
| "$ stackit beta vpn gateway status xxx", |
| for _, route := range tunnel.BgpStatus.Get().Routes { | ||
| if route.Network != "" { | ||
| routeString += fmt.Sprintf("Network: %s; ", route.Network) | ||
| } | ||
| if route.Origin != "" { | ||
| routeString += fmt.Sprintf("Origin: %s; ", route.Origin) | ||
| } | ||
| if route.Path != "" { | ||
| routeString += fmt.Sprintf("Path: %s; ", route.Path) | ||
| } | ||
| if route.PeerId != "" { | ||
| routeString += fmt.Sprintf("PeerId: %s; ", route.PeerId) | ||
| } | ||
| routeString += fmt.Sprintf("Weight: %d\n", route.Weight) | ||
| } |
There was a problem hiding this comment.
Didn't find yet a valid configuration to get this output, but I think it would be more readable, when there is always a new line instead of a semicolon. A row doesn't need to be always only one single line, it can have also more than one line
There was a problem hiding this comment.
But we can also discuss about it in a private chat
| } | ||
|
|
||
| // Truncate output | ||
| items := utils.GetSliceFromPointer(&resp.Plans) |
There was a problem hiding this comment.
why is utils.GetSliceFromPointer here called? I think this should only be an issue, when Plans would be a pointer, but this isn't a pointer
| } | ||
|
|
||
| // Truncate output | ||
| items := utils.GetSliceFromPointer(&resp.Gateways) |
There was a problem hiding this comment.
same here, why is utils.GetSliceFromPointer called here?
| if limit != nil && *limit < 1 { | ||
| return nil, &errors.FlagValidationError{ | ||
| Flag: limitFlag, | ||
| Details: "must be grater than 0", |
There was a problem hiding this comment.
| Details: "must be grater than 0", | |
| Details: "must be greater than 0", |
| if limit != nil && *limit < 1 { | ||
| return nil, &errors.FlagValidationError{ | ||
| Flag: limitFlag, | ||
| Details: "must be grater than 0", |
There was a problem hiding this comment.
| Details: "must be grater than 0", | |
| Details: "must be greater than 0", |
| if limit != nil && *limit < 1 { | ||
| return nil, &errors.FlagValidationError{ | ||
| Flag: limitFlag, | ||
| Details: "must be grater than 0", |
There was a problem hiding this comment.
| Details: "must be grater than 0", | |
| Details: "must be greater than 0", |
Description
relates to STACKITCLI-353
Checklist
make fmtmake generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)