router: initial implementation - #148
Conversation
a6ba7c4 to
51e9444
Compare
| google.golang.org/protobuf v1.36.11 // indirect | ||
| ) | ||
|
|
||
| replace github.com/cloudscale-ch/cloudscale-go-sdk/v9 => ../cloudscale-go-sdk |
There was a problem hiding this comment.
cfe208b to
80e7c38
Compare
| In addition to the arguments listed above, the following computed attributes are exported: | ||
|
|
||
| * `href` - The cloudscale.ch API URL of the current router. | ||
| * `tags` - The tags assigned to this router. |
There was a problem hiding this comment.
items already listed in ## Argument Reference should not be repeated here. applies to: tags and internet_gateway.
|
|
||
| * `id` - (Optional) The UUID of a router. | ||
| * `name` - (Optional) The name of a router. | ||
| * `zone_slug` - (Optional) The zone slug of a router. Options include `lpg1` and `rma1`. |
There was a problem hiding this comment.
should be listed here, not in attributes:
* `tags` - (Optional) Filter by tags; the resource must have at least the specified key-value pairs (subset match).
| In addition to the arguments listed above, the following computed attributes are exported: | ||
|
|
||
| * `href` - The cloudscale.ch API URL of the current router. | ||
| * `tags` - The tags assigned to this router. |
There was a problem hiding this comment.
similarly, this goes I way I guess :)
|
|
||
| *Remember to replace `[your-username]` with your actual username.* | ||
|
|
||
| ### Debugging with Delve |
There was a problem hiding this comment.
out of curiosity: why did you need this? for me it worked pretty good to debug the provider using the integration tests.
There was a problem hiding this comment.
I don't remember exactly which part I needed to debug, but in general, I personally often prefer to debug using a debugger to be able to inspect what variables etc. hold in specific breakpoints.
There was a problem hiding this comment.
Yes; me to. What i meant: the intellij debugger can attach to the tests without additional tooling.
There was a problem hiding this comment.
ah.. yeah that's true. Not sure why I didn't do it that way to be honest..
| resource.TestCheckResourceAttr( | ||
| resourceName, "addresses.#", "1"), | ||
| resource.TestCheckResourceAttrSet( | ||
| resourceName, "addresses.0.address"), |
There was a problem hiding this comment.
please try to assert all attributes, imho network_name, network_href and type are not asserted.
|
|
||
| func gatherRouterUpdateRequest(d *schema.ResourceData) []*cloudscale.RouterUpdateRequest { | ||
| requests := make([]*cloudscale.RouterUpdateRequest, 0) | ||
| // FIXME: not implemented yet |
There was a problem hiding this comment.
you mean the FIXME comment or the whole gatherRouterUpdateRequest function?
There was a problem hiding this comment.
removed it, along with all commented-out code.
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
The upstream API always requires an address on an interface. There is no auto-assign (contrary to server interfaces).
I think this should read:
Required: true,
Also adjust the docs to reflect this.
There was a problem hiding this comment.
also maybe its worth the double check this is correct in the go-sdk
There was a problem hiding this comment.
fixed, thanks. SDK is not a problem.
3ed2604 to
39dc956
Compare
- config.go: use context.Background() and NewSubsystemLoggingHTTPTransport - gofmt/whitespace fixes in floating_ip datasource, volume test, provider test
Adds cloudscale_router (resource + data source) and cloudscale_interface, plus a load-balancer health-monitor URLPath rename (due to lint). Additionally: - splitImportID: moved to util.go and parameterized so import errors name the correct attributes (router_uuid/interface_uuid vs pool_uuid/member_uuid)
39dc956 to
a4b2c3e
Compare
- updates docs with attributes/arguments - adds missing assertions - corrects interface create computed/required/optional flags - remove waitForDeleted: router/interface delete are now both synchronously deleted
a4b2c3e to
2679936
Compare
No description provided.