Feat/add vpn network config - #1763
Conversation
1fa2f05 to
d70130e
Compare
| "routing_table_id": schema.StringAttribute{ | ||
| Description: schemaDescriptions["network_config_routing_table_id"], | ||
| Optional: true, | ||
| // Computed: true, |
| } | ||
|
|
||
| networkConfigObject, diags := types.ObjectValue(networkConfigTypes, map[string]attr.Value{ | ||
| "predefined_network_prefix": predefinedNetworkPrefix, |
There was a problem hiding this comment.
| "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) { |
There was a problem hiding this comment.
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}, |
There was a problem hiding this comment.
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" { |
There was a problem hiding this comment.
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
| 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" { |
| } | ||
| } | ||
|
|
||
| resource "stackit_resourcemanager_project" "project" { |
| } | ||
| } | ||
|
|
||
| resource "stackit_routing_table" "routing_table" { |
Description
Adds networkConfig attribute to VPN Gateway
relates to STACKITTPR-850
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)