Skip to content

feature(vpn): onboard gateway#1417

Open
Manuelvaas wants to merge 3 commits into
mainfrom
feature/onboard-vpn-gateway
Open

feature(vpn): onboard gateway#1417
Manuelvaas wants to merge 3 commits into
mainfrom
feature/onboard-vpn-gateway

Conversation

@Manuelvaas

@Manuelvaas Manuelvaas commented May 20, 2026

Copy link
Copy Markdown
Contributor

Description

relates to STACKITCLI-353

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see e.g. here)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label May 28, 2026
@Manuelvaas Manuelvaas removed the Stale label Jun 1, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label Jun 8, 2026
@Manuelvaas Manuelvaas removed the Stale label Jun 9, 2026
@github-actions

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the Stale label Jun 24, 2026
@Manuelvaas Manuelvaas removed the Stale label Jul 1, 2026
@Manuelvaas Manuelvaas force-pushed the feature/onboard-vpn-gateway branch from 458d051 to f0fe08f Compare July 6, 2026 12:48
@Manuelvaas Manuelvaas marked this pull request as ready for review July 6, 2026 12:49
@Manuelvaas Manuelvaas requested a review from a team as a code owner July 6, 2026 12:49
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 10 increase)

Impacted Packages Coverage Δ 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway 0.00% (ø)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/create 54.29% (+54.29%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/delete 23.81% (+23.81%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/describe 67.35% (+67.35%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/list 57.14% (+57.14%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/status 30.12% (+30.12%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/plans 59.46% (+59.46%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/quotas 60.53% (+60.53%) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/config/set 90.91% (+0.19%) 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset 35.11% (-0.04%) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config 70.21% (+0.11%) 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/vpn/utils 83.33% (+83.33%) 🌟

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/create/create.go 54.29% (+54.29%) 70 (+70) 38 (+38) 32 (+32) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/delete/delete.go 23.81% (+23.81%) 42 (+42) 10 (+10) 32 (+32) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/describe/describe.go 67.35% (+67.35%) 49 (+49) 33 (+33) 16 (+16) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/gateway.go 0.00% (ø) 8 (+8) 0 8 (+8)
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/list/list.go 57.14% (+57.14%) 42 (+42) 24 (+24) 18 (+18) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/status/status.go 30.12% (+30.12%) 83 (+83) 25 (+25) 58 (+58) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/plans/plans.go 59.46% (+59.46%) 37 (+37) 22 (+22) 15 (+15) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/quotas/quotas.go 60.53% (+60.53%) 38 (+38) 23 (+23) 15 (+15) 🌟
github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/vpn.go 0.00% (ø) 7 (+3) 0 7 (+3)
github.com/stackitcloud/stackit-cli/internal/cmd/config/set/set.go 90.91% (+0.19%) 143 (+3) 130 (+3) 13 👍
github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset.go 35.11% (-0.04%) 131 (+3) 46 (+1) 85 (+2) 👎
github.com/stackitcloud/stackit-cli/internal/pkg/config/config.go 90.91% (+0.14%) 66 (+1) 60 (+1) 6 👍
github.com/stackitcloud/stackit-cli/internal/pkg/services/vpn/utils/utils.go 83.33% (+83.33%) 6 (+6) 5 (+5) 1 (+1) 🌟

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

  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/create/create_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/delete/delete_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/describe/describe_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/list/list_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/gateway/status/status_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/plans/plans_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/beta/vpn/quotas/quotas_test.go
  • github.com/stackitcloud/stackit-cli/internal/cmd/config/unset/unset_test.go
  • github.com/stackitcloud/stackit-cli/internal/pkg/services/vpn/utils/utils_test.go


```
Show the status of the gateway with the ID "xxx"
$ stackit beta vpn gateway describe xxx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong description

Suggested change
$ stackit beta vpn gateway describe xxx
$ stackit beta vpn gateway status xxx

Comment on lines +18 to +19
var projectIdFlag = globalflags.ProjectIdFlag
var regionFlag = globalflags.RegionFlag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These vars can be removed. You can instead directly use globalflags.ProjectIdFlag or globalflags.RegionFlag

Comment on lines +16 to +17
var projectIdFlag = globalflags.ProjectIdFlag
var regionFlag = globalflags.RegionFlag

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"$ stackit beta vpn gateway describe xxx",
"$ stackit beta vpn gateway status xxx",

Comment on lines +144 to +158
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)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can also discuss about it in a private chat

}

// Truncate output
items := utils.GetSliceFromPointer(&resp.Plans)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Details: "must be grater than 0",
Details: "must be greater than 0",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants