fix(query): skip Terraform references in metadata label validation#8059
Open
omribz156 wants to merge 1 commit into
Open
fix(query): skip Terraform references in metadata label validation#8059omribz156 wants to merge 1 commit into
omribz156 wants to merge 1 commit into
Conversation
Contributor
|
Hi @omribz156, Although I believe the fix you proposed was going to silently get rid of the false positives, supporting terraform locals would be the best approach in my opinion. This PR - #7946 - aims to achieve that by replicating the behaviour of terraform's locals resolver. You can check more information on the PR description and the tagged issue. I'm not sure if both solutions can coexist completely, but part of it may be a good fit. Let me know what you think! |
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.
Closes #7944
Reason for Proposed Changes
Metadata Label Is Invalidquery currently validates unresolved Terraform references such aslocal.resource_nameas literal Kubernetes label values.Proposed Changes
local.*,var.*, ordata.*reference/interpolation.local.resource_name.Verification
Metadata Label Is Invalidresult at thelabelsblock.TOTAL: 0.TOTAL: 1forg**dy.l+bel.git diff --checkpassed with local CRLF warnings only.Focused Go query harness timed out locally on Windows, so I used direct CLI scans for this query.
This was implemented with Codex assistance, with the final patch kept focused and manually reviewed.
I submit this contribution under the Apache-2.0 license.