Skip to content

Add validation for network resources in cluster director#17678

Open
bprachet wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
bprachet:network-validation
Open

Add validation for network resources in cluster director#17678
bprachet wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
bprachet:network-validation

Conversation

@bprachet
Copy link
Copy Markdown
Contributor

@bprachet bprachet commented May 21, 2026

feat: Add network_resources validation for Cluster Director

Adds a CustomizeDiff function to ensure the network_resources field is set and not empty during the creation of a cluster resource. This prevents terraform apply failures by catching the missing required network during the terraform plan phase.

Custom Go helper functions are now consolidated into hypercomputecluster_cluster_utils.go.tmpl.

Fixes b/495546305

clusterdirector: Added validation to require at least one `network_resources` block during creation of cluster resource

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit ff29481:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 96 insertions(+)
google-beta provider View Diff 2 files changed, 96 insertions(+)
terraform-google-conversion View Diff 1 file changed, 19 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
6 0 1 5
Affected Service Packages
  • hypercomputecluster

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccHypercomputeclusterCluster_hypercomputeclusterClusterBasicExample
  • TestAccHypercomputeclusterCluster_inPlaceUpdates
  • TestAccHypercomputeclusterCluster_networkValidation
  • TestAccHypercomputeclusterCluster_new
  • TestAccHypercomputeclusterCluster_update

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccHypercomputeclusterCluster_networkValidation
❌ Error · Log - TestAccHypercomputeclusterCluster_hypercomputeclusterClusterBasicExample
❌ Error · Log - TestAccHypercomputeclusterCluster_inPlaceUpdates
❌ Error · Log - TestAccHypercomputeclusterCluster_new
❌ Error · Log - TestAccHypercomputeclusterCluster_update

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@bprachet VCR tests complete for ff29481!

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 21, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 3e6b0f8:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 96 insertions(+)
google-beta provider View Diff 2 files changed, 96 insertions(+)
terraform-google-conversion View Diff 1 file changed, 19 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
6 1 1 4
Affected Service Packages
  • hypercomputecluster

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccHypercomputeclusterCluster_hypercomputeclusterClusterBasicExample
  • TestAccHypercomputeclusterCluster_inPlaceUpdates
  • TestAccHypercomputeclusterCluster_new
  • TestAccHypercomputeclusterCluster_update

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccHypercomputeclusterCluster_hypercomputeclusterClusterBasicExample
❌ Error · Log - TestAccHypercomputeclusterCluster_inPlaceUpdates
❌ Error · Log - TestAccHypercomputeclusterCluster_new
❌ Error · Log - TestAccHypercomputeclusterCluster_update

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@bprachet VCR tests complete for 3e6b0f8!

@modular-magician
Copy link
Copy Markdown
Collaborator

modular-magician commented May 22, 2026

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit f99fdef:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 2 files changed, 96 insertions(+)
google-beta provider View Diff 2 files changed, 96 insertions(+)
terraform-google-conversion View Diff 1 file changed, 19 insertions(+)

Test report

Analytics

Total Tests Passed Skipped Affected
6 5 1 0
Affected Service Packages
  • hypercomputecluster

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@bprachet VCR tests complete for f99fdef!

@bprachet bprachet marked this pull request as ready for review May 22, 2026 20:04
@github-actions github-actions Bot requested a review from zli82016 May 22, 2026 20:04
@github-actions
Copy link
Copy Markdown

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@zli82016, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants