Repository navigation
fix(ci): drift fails on an attribute Terraform cannot set - #475
Merged
Merged
Conversation
`drift (dev)` reports real drift on `module.eks.aws_eks_cluster.this [platform_version]`, which AWS moved from `eks.14` to `eks.17` when it patched the control plane. We set it nowhere — `grep platform_version infra/terraform/` finds nothing — so there is no configuration for it to drift FROM. Left alone it fails the daily schedule after every AWS patch, forever, which is the fastest way to teach everyone to ignore a red drift job. A THIRD rule rather than a third entry in `IGNORE_ON_TYPE`. That list is the sibling-resource rule specifically — an attribute a sibling resource owns, and whose drift the sibling reports itself — and stretching it to cover this would make it mean "whatever we are tired of seeing". #370's lesson was that the ignore list needs a rule, not a longer list of sightings, and it applies here. `IGNORE_READONLY` states what qualifies: the attribute appears only in the provider's Attribute Reference, never its Argument Reference, and `grep` finds it nowhere in infra/terraform/. Both checked for this entry rather than assumed. Two fixtures, because the test file's own warning is that an over-broad entry silently retires drift detection while leaving the workflow green: - a read-only attribute alone is NOT drift (exit 0), and - a SETTABLE attribute beside it on the SAME type IS drift (exit 1), named as `[version]` and not swallowed with its read-only neighbour. The second is the one that keeps the rule honest: without it, "ignore platform_version on aws_eks_cluster" could be widened to the whole type and nobody would notice EKS drift detection had been switched off. Observed failing before being trusted: removing the rule fails both new assertions, and the boundary case keeps passing — which is the direction that proves it is asserting an absence rather than nothing. 45 passed, 0 failed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
terraform plan
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
drift (dev)reports real drift onmodule.eks.aws_eks_cluster.this [platform_version]:AWS moved it when it patched the control plane. We set it nowhere —
grep platform_version infra/terraform/finds nothing — so there is no configuration for it to drift from. Left alone it fails the daily schedule after every AWS patch, forever, which is the fastest way to teach everyone to ignore a red drift job.A third rule, not a third entry
IGNORE_ON_TYPEis the sibling-resource rule specifically: an attribute a sibling resource owns, and whose drift that sibling reports itself. Stretching it to cover this would make it mean "whatever we are tired of seeing" — and #370's lesson was that the ignore list needs a rule, not a longer list of sightings.So
IGNORE_READONLYstates what qualifies: the attribute appears only in the provider's Attribute Reference, never its Argument Reference, andgrepfinds it nowhere ininfra/terraform/. Both were checked for this entry rather than assumed.Two fixtures, because the second is what keeps it honest
tf-helpers-test.sh's own header warns that an over-broad entry "silently retires drift detection while leaving the workflow green". So:[version]The second is the boundary. Without it, "ignore
platform_versiononaws_eks_cluster" could be widened to the whole type and nobody would notice EKS drift detection had been switched off.Observed failing before being trusted
Removing the rule fails both new assertions — and the boundary case keeps passing, which is the direction that proves it asserts an absence rather than nothing:
With the rule: 45 passed, 0 failed.
🤖 Generated with Claude Code