-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
Ready for review and acceptance tests! |
packet/resource_packet_device.go
Outdated
"access_public_ipv6": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Computed: true, | ||
ForceNew: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ForceNew necessary in computed fields? Maybe @radeksimko could clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields can be both Computed
and Optional
in which case they may also be ForceNew
, but a Computed-only field can't really be ForceNew
, because such field never occurs in the config, so there's nothing to trigger the recreation process. API changing computed values isn't interpreted as change, it's just simply written to state and updated wherever it's referenced.
Thanks for pointing this out - I'll see if we can add this to our schema validation logic
https://github.com/hashicorp/terraform/blob/cbb512d374a80d9d2c7cd49ca0644c576ab2335f/helper/schema/schema.go#L548
packet/resource_packet_device.go
Outdated
if ip.AddressFamily == 4 && ip.Public == true { | ||
host = ip.Address | ||
ipv4SubnetSize = ip.CIDR | ||
if ip.AddressFamily == 4 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default public IPv4 has Management: True, and it should be checked to get the access_public_ipv4.
However, the management field is not exported by packngo (my fault). Can we please hold this PR until I add Management to Packngo.
I run the basic acceptance test, and beside my comments in the review it it's alright. |
Blocked by equinixmetal-archive/packngo#40 @bzub please review the linekd packngo PR if you have time. |
0974c1e
to
7510853
Compare
- access_public_ipv6 - access_public_ipv4 - access_private_ipv4 These are copied from the "network" list of maps for convenience. Add test step to validate access IP address strings Document new first-level IP address device fields Don't use ForceNew on management IPs If these IPs change, something must be wrong with the API or this plugin. So to be safe, don't force a recreation of the device/resource. Use management designation to determine access IPs
6146b61
to
cedf707
Compare
Please take another look, thanks! |
Tweak the issue template to match the repository
These are copied from the "network" list of maps for convenience.
Fixes #11