Skip to content

Fixing validation block error in Filestore module#3528

Merged
RachaelSTamakloe merged 3 commits into
GoogleCloudPlatform:developfrom
RachaelSTamakloe:remove_validation_filestore
Jan 13, 2025
Merged

Fixing validation block error in Filestore module#3528
RachaelSTamakloe merged 3 commits into
GoogleCloudPlatform:developfrom
RachaelSTamakloe:remove_validation_filestore

Conversation

@RachaelSTamakloe

Copy link
Copy Markdown
Collaborator

a validation block introduced in this pr causes an error during terraform init as a result of referencing another variable. In this PR, the validation block is replaced with a lifecycle precondition block.

error:

'terraform init' failed, 'terraform validate' skipped: modules/file-system/filestore
Terraform encountered problems during initialisation, including problems
with the configuration, described below.

The Terraform configuration must be valid before initialization so that
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Invalid reference in variable validation
│ 
│   on variables.tf line 100, in variable "filestore_tier":
│  100:     condition     = !(var.protocol == "NFS_V4_1" && !contains(["HIGH_SCALE_SSD", "ZONAL", "REGIONAL", "ENTERPRISE"], var.filestore_tier))
│ 
│ The condition for variable "filestore_tier" can only refer to the variable
│ itself, using var.filestore_tier.
╵

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@RachaelSTamakloe RachaelSTamakloe added the release-improvements Added to release notes under the "Improvements" heading. label Jan 13, 2025
@RachaelSTamakloe RachaelSTamakloe changed the title replacing validation block with lifecycle precondition Fixing validation block error in Filestore module Jan 13, 2025

@tpdownes tpdownes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a follow-up task for the next sprint to remove legacy tiers from our documentation but allow them to to continue be explicitly called when desired by the user:

https://cloud.google.com/filestore/docs/service-tiers#should-you-use-legacy

Comment thread modules/file-system/filestore/main.tf Outdated
Comment thread modules/file-system/filestore/variables.tf Outdated
@tpdownes tpdownes removed the request for review from mr0re1 January 13, 2025 15:54
@tpdownes tpdownes assigned RachaelSTamakloe and unassigned mr0re1 Jan 13, 2025
@RachaelSTamakloe RachaelSTamakloe force-pushed the remove_validation_filestore branch 2 times, most recently from d043d1b to ba36afc Compare January 13, 2025 17:52
@RachaelSTamakloe RachaelSTamakloe force-pushed the remove_validation_filestore branch from ba36afc to f838fd7 Compare January 13, 2025 18:08
Comment thread modules/file-system/filestore/main.tf Outdated
Comment thread modules/file-system/filestore/variables.tf
@RachaelSTamakloe RachaelSTamakloe force-pushed the remove_validation_filestore branch from f838fd7 to 8139628 Compare January 13, 2025 18:32
Comment thread modules/file-system/filestore/variables.tf
Comment thread modules/file-system/filestore/variables.tf Outdated
RachaelSTamakloe and others added 2 commits January 13, 2025 10:55
Co-authored-by: Tom Downes <tpdownes@users.noreply.github.com>
Co-authored-by: Tom Downes <tpdownes@users.noreply.github.com>
@RachaelSTamakloe RachaelSTamakloe removed their assignment Jan 13, 2025
@RachaelSTamakloe RachaelSTamakloe merged commit 7a795a1 into GoogleCloudPlatform:develop Jan 13, 2025
@abbas1902 abbas1902 mentioned this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-improvements Added to release notes under the "Improvements" heading.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants