Skip to content

Commit ba4fa91

Browse files
authored
deployplan: Rename Action.Action to Action.ActionType (#3093)
This is a better name.
1 parent d5108bf commit ba4fa91

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

bundle/deploy/terraform/showplanfile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ func GetActions(changes []*tfjson.ResourceChange) []deployplan.Action {
4040
}
4141

4242
result = append(result, deployplan.Action{
43-
Action: actionType,
44-
Group: group,
45-
Name: rc.Name,
43+
ActionType: actionType,
44+
Group: group,
45+
Name: rc.Name,
4646
})
4747
}
4848

bundle/deployplan/plan.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ type Action struct {
2020
// Key of the resource the config
2121
Name string
2222

23-
Action ActionType
23+
ActionType ActionType
2424
}
2525

2626
func (a Action) String() string {
2727
typ, _ := strings.CutSuffix(a.Group, "s")
28-
return fmt.Sprintf(" %s %s %s", a.Action, typ, a.Name)
28+
return fmt.Sprintf(" %s %s %s", a.ActionType, typ, a.Name)
2929
}
3030

3131
// Implements cmdio.Event for cmdio.Log
@@ -50,7 +50,7 @@ const (
5050
func Filter(changes []Action, actionType ActionType) []Action {
5151
var result []Action
5252
for _, action := range changes {
53-
if action.Action == actionType {
53+
if action.ActionType == actionType {
5454
result = append(result, action)
5555
}
5656
}
@@ -68,7 +68,7 @@ func FilterGroup(changes []Action, group string, actionTypes ...ActionType) []Ac
6868
}
6969

7070
for _, action := range changes {
71-
if action.Group == group && actionTypeSet[action.Action] {
71+
if action.Group == group && actionTypeSet[action.ActionType] {
7272
result = append(result, action)
7373
}
7474
}

bundle/phases/deploy_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ func TestParseTerraformActions(t *testing.T) {
4646

4747
assert.Equal(t, []deployplan.Action{
4848
{
49-
Action: deployplan.ActionTypeDelete,
50-
Group: "pipelines",
51-
Name: "delete pipeline",
49+
ActionType: deployplan.ActionTypeDelete,
50+
Group: "pipelines",
51+
Name: "delete pipeline",
5252
},
5353
{
54-
Action: deployplan.ActionTypeRecreate,
55-
Group: "pipelines",
56-
Name: "recreate pipeline",
54+
ActionType: deployplan.ActionTypeRecreate,
55+
Group: "pipelines",
56+
Name: "recreate pipeline",
5757
},
5858
}, res)
5959
}

0 commit comments

Comments
 (0)