stacks: actions for a no-op change are a concrete list (#34260)

pull/34283/head
Liam Cervante 2 years ago committed by GitHub
parent ccb5596742
commit afc83356ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,10 +7,11 @@ import (
"fmt" "fmt"
"math/big" "math/big"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/internal/lang/marks" "github.com/hashicorp/terraform/internal/lang/marks"
"github.com/hashicorp/terraform/internal/plans" "github.com/hashicorp/terraform/internal/plans"
"github.com/hashicorp/terraform/internal/stacks/stackaddrs" "github.com/hashicorp/terraform/internal/stacks/stackaddrs"
"github.com/zclconf/go-cty/cty"
) )
// This file contains some hand-written type conversion helpers to complement // This file contains some hand-written type conversion helpers to complement
@ -21,7 +22,7 @@ import (
func ChangeTypesForPlanAction(action plans.Action) ([]ChangeType, error) { func ChangeTypesForPlanAction(action plans.Action) ([]ChangeType, error) {
switch action { switch action {
case plans.NoOp: case plans.NoOp:
return nil, nil return []ChangeType{ChangeType_NOOP}, nil
case plans.Create: case plans.Create:
return []ChangeType{ChangeType_CREATE}, nil return []ChangeType{ChangeType_CREATE}, nil
case plans.Read: case plans.Read:

@ -146,6 +146,7 @@ func TestPlannedChangeAsProto(t *testing.T) {
{ {
Description: &terraform1.PlannedChange_ChangeDescription_ComponentInstancePlanned{ Description: &terraform1.PlannedChange_ChangeDescription_ComponentInstancePlanned{
ComponentInstancePlanned: &terraform1.PlannedChange_ComponentInstance{ ComponentInstancePlanned: &terraform1.PlannedChange_ComponentInstance{
Actions: []terraform1.ChangeType{terraform1.ChangeType_NOOP},
Addr: &terraform1.ComponentInstanceInStackAddr{ Addr: &terraform1.ComponentInstanceInStackAddr{
ComponentAddr: "component.foo", ComponentAddr: "component.foo",
ComponentInstanceAddr: `component.foo["bar"]`, ComponentInstanceAddr: `component.foo["bar"]`,

Loading…
Cancel
Save