Skip to content

Feat/add rt support#1266

Open
h3adex wants to merge 8 commits intostackitcloud:mainfrom
h3adex:feat/add-rt-support
Open

Feat/add rt support#1266
h3adex wants to merge 8 commits intostackitcloud:mainfrom
h3adex:feat/add-rt-support

Conversation

@h3adex
Copy link
Contributor

@h3adex h3adex commented Feb 6, 2026

Description

reopened #1023

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)

@h3adex h3adex requested a review from a team as a code owner February 6, 2026 10:13
@h3adex h3adex force-pushed the feat/add-rt-support branch from d8f4c9f to 60fae5d Compare February 19, 2026 14:59
@h3adex h3adex requested a review from rubenhoenle February 19, 2026 15:11
@h3adex h3adex force-pushed the feat/add-rt-support branch from 7a76aaa to 565f907 Compare February 19, 2026 15:17
@github-actions
Copy link

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.

).AddRoutingTableToAreaPayload(payload), nil
}

func outputResult(p *print.Printer, outputFormat string, routingTable *iaas.RoutingTable) error {
Copy link
Member

Choose a reason for hiding this comment

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

Recognized during testing: It would be new to me that we show tables for create commands. I would also like to stick to that, because I don't see any benefit for the user: He just entered all information when executing the create command, so why show it all again.

For create we usually just print something like `Created routing table with ID xxx in STACKIT Network Area xxx".

Could you elaborate why you've chosen to implement a table output here? 😅

Copy link
Member

Choose a reason for hiding this comment

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

In fact the current approach with the table is already questionable for me since the ID of the routing table I just created isn't visible anymore after I exited the pager showing the table output.

),
examples.NewExample(
`Disables the dynamic routes of a routing-table with ID "xxx" in organization with ID "yyy" and network-area with ID "zzz"`,
"$ stackit routing-table update xxx --organization-id yyy --network-area-id zzz --disable-dynamic-routes",
Copy link
Member

Choose a reason for hiding this comment

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

Your examples are using a non-existent --disable-dynamic-routes flag.

Image

}

if route.Labels != nil && len(*route.Labels) > 0 {
var labels []string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var labels []string
routeDetails.Labels = JoinStringMap(tt.input, ": ", "\n")

This should do everything you need 😅

func TestJoinStringMap(t *testing.T) {
tests := []struct {
name string
input map[string]string
want string
}{
{
name: "nil map",
input: nil,
want: "",
},
{
name: "empty map",
input: map[string]string{},
want: "",
},
{
name: "single element",
input: map[string]string{"key1": "value1"},
want: "key1=value1",
},
{
name: "multiple elements",
input: map[string]string{"key1": "value1", "key2": "value2"},
want: "key1=value1, key2=value2",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := JoinStringMap(tt.input, "=", ", "); got != tt.want {
t.Errorf("JoinStringMap() = %v, want %v", got, tt.want)
}
})
}
}

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants