Skip to content

Feat/add vpn network config - #1763

Open
SerseusWasTaken wants to merge 2 commits into
mainfrom
feat/add-vpn-network-config
Open

Feat/add vpn network config#1763
SerseusWasTaken wants to merge 2 commits into
mainfrom
feat/add-vpn-network-config

Conversation

@SerseusWasTaken

Copy link
Copy Markdown
Contributor

Description

Adds networkConfig attribute to VPN Gateway

relates to STACKITTPR-850

Checklist

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

@SerseusWasTaken
SerseusWasTaken requested a review from a team as a code owner September 11, 2026 11:12
@SerseusWasTaken
SerseusWasTaken force-pushed the feat/add-vpn-network-config branch from 1fa2f05 to d70130e Compare September 11, 2026 11:22
"routing_table_id": schema.StringAttribute{
Description: schemaDescriptions["network_config_routing_table_id"],
Optional: true,
// Computed: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove commented code

}

networkConfigObject, diags := types.ObjectValue(networkConfigTypes, map[string]attr.Value{
"predefined_network_prefix": predefinedNetworkPrefix,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"predefined_network_prefix": predefinedNetworkPrefix,
"predefined_network_prefix": types.StringPointerValue(gateway.NetworkConfig.PredefinedNetworkPrefix),

Same should be possible for the routing table id.

Saves you a lot of code and especially the two if conditions above.

}
}

func TestUpdateGatewayRetriesOnConflict(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What did I miss? What is this test case about? 😅

An explaining comment should help here I guess. Not only for me, for the whole team that needs to maintain this code in the future.

isValid bool
wantAttempts int
}{
{"succeeds immediately", 0, true, 1},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personal opinion but I prefer to have the struct field keys listed in the table test.

Makes it much more easier to read (especially while you're trying to wrap your head around what this thing even does).

Furthermore when doing refactorings it makes your life easier. Especially for the person who has to review the refactorings when the time comes 😉

variable "label_value" {}
variable "network_config_prefix" {}

resource "stackit_network_area" "network_area" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I prefer to add some comment here which explains why this resource is here. It's not because we want to test it - it's part of the bootstrapping for the test

Suggested change
resource "stackit_network_area" "network_area" {
# no test candidate, just needed for the testing setup
resource "stackit_network_area" "network_area" {

depends_on = [stackit_network_area_region.network_area_region]
}

resource "stackit_network_area_region" "network_area_region" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

}
}

resource "stackit_resourcemanager_project" "project" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

}
}

resource "stackit_routing_table" "routing_table" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

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