bhouse-nexthop commented on code in PR #282:
URL: 
https://github.com/apache/cloudstack-terraform-provider/pull/282#discussion_r3570075952


##########
cloudstack/resource_cloudstack_network.go:
##########
@@ -306,6 +378,13 @@ func resourceCloudStackNetworkRead(d *schema.ResourceData, 
meta interface{}) err
        d.Set("network_domain", n.Networkdomain)
        d.Set("vpc_id", n.Vpcid)
 
+       // Always set IPv6 fields to detect drift when IPv6 is removed 
server-side
+       d.Set("ip6cidr", n.Ip6cidr)
+       d.Set("ip6gateway", n.Ip6gateway)
+
+       // Note: CloudStack API may not return startipv6 and endipv6 fields
+       // These are typically only set during network creation
+

Review Comment:
   Leaving this as-is intentionally. `startipv6`/`endipv6` are `Computed` and 
CloudStack does not surface the configured IPv6 range on the network read (only 
`ip6cidr`/`ip6gateway` come back), so there is no reliable API field to 
reconcile against without a separate listVlanIpRanges lookup. Rather than add 
speculative drift logic that risks perpetual diffs, I've documented that these 
are conditional/best-effort. Happy to revisit in a follow-up if a stable API 
source is confirmed.



##########
cloudstack/resource_cloudstack_network_test.go:
##########
@@ -165,6 +175,90 @@ func TestAccCloudStackNetwork_importProject(t *testing.T) {
        })
 }
 
+// testAccPreCheckIPv6Support checks if IPv6 tests should run.
+// IPv6 tests are skipped on the CloudStack simulator unless explicitly enabled
+// via the CLOUDSTACK_ENABLE_IPV6_TESTS environment variable.
+func testAccPreCheckIPv6Support(t *testing.T) {
+       testAccPreCheck(t)
+
+       // Allow explicit override to enable IPv6 tests
+       if os.Getenv("CLOUDSTACK_ENABLE_IPV6_TESTS") == "true" {
+               return
+       }
+
+       // Try to detect if we're running on the simulator by checking the API 
URL
+       apiURL := os.Getenv("CLOUDSTACK_API_URL")
+       if strings.Contains(apiURL, "localhost") || strings.Contains(apiURL, 
"127.0.0.1") {
+               t.Skip("Skipping IPv6 test: CloudStack simulator does not 
support IPv6 for isolated networks. Set CLOUDSTACK_ENABLE_IPV6_TESTS=true to 
force-enable.")
+       }

Review Comment:
   Keeping the localhost/127.0.0.1 heuristic. These IPv6 acceptance tests are 
meant to run against the simulator-based CI, which is reached at localhost; the 
heuristic keeps them opt-out there without extra config. An 
SSH-tunnel/reverse-proxy setup is not how this repo's CI runs them, and 
switching to a bespoke env var would just move the gating burden without 
improving the CI path. Can revisit if the CI topology changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to