Loading...
Loading...
### Terraform Version ```shell Latest main branch (specifically within the new action block implementation in the internal/addrs package). ``` ### Terraform Configuration Files # Any action block triggers this if targeted via CLI: action "mock" "example" { } ### Debug Output N/A - This is an internal Go logic bug in the graph targeting solver, reproducible via the addrs package unit tests rather than a CLI crash log. ### Expected Behavior By definition in the Terraform graph builder, a targetable address must contain itself. Calling ConfigAction.TargetContains(ConfigAction) with an identical address should return true. When running terraform plan -target=action.mock.example, the graph walker should correctly identify and isolate the action block. ### Actual Behavior The type switch in ConfigAction.TargetContains is missing a case for its own type. If passed a ConfigAction, it falls through the switch statement and hits the default return false. As a result, targeting an action block directly via the CLI will silently fail to match the configuration node. ### Steps to Reproduce 1. Open action_test.go and append this exact test to the bottom of the file: func TestConfigActionTargetContains(t *testing.T) { addr := ConfigAction{ Module: RootModule, Action: Action{Type: "mock", Name: "example"}, } if !addr.TargetContains(addr) { t.Fatalf("expected ConfigAction to contain itself") } // Test it does not contain a completely different action otherAddr := ConfigAction{ Module: RootModule, Action: Action{Type: "mock", Name: "different"}, } if addr.TargetContains(otherAddr) { t.Fatalf("expected ConfigAction not to contain a different action") } } 2. Run this command in the terminal to run the test: `go test -run TestConfigActionTargetContains -v` 3. The test will fail because it returns false. ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
BugZero Plan
Streamline upgrades with automated vendor bug scrubs
BugZero Prevent
Wish you caught this bug sooner? Get proactive today.