@@ -35,7 +35,7 @@ func NewPlan(clusterName string, desiredAssociations, currentAssociations []EKSP
35
35
}
36
36
}
37
37
38
- // Plan is a plan that will manage EKS addons .
38
+ // Plan is a plan that will manage EKS pod identities .
39
39
type plan struct {
40
40
currentAssociations []EKSPodIdentityAssociation
41
41
desiredAssociations []EKSPodIdentityAssociation
@@ -61,17 +61,15 @@ func (a *plan) getDesiredAssociation(association EKSPodIdentityAssociation) bool
61
61
return false
62
62
}
63
63
64
- // Create will create the plan (i.e. list of procedures) for managing EKS addons .
64
+ // Create will create the plan (i.e. list of procedures) for managing EKS pod identities .
65
65
func (a * plan ) Create (_ context.Context ) ([]planner.Procedure , error ) {
66
66
procedures := []planner.Procedure {}
67
67
68
- for _ , d := range a .desiredAssociations {
69
- desired := d
68
+ for _ , desired := range a .desiredAssociations {
70
69
existsInCurrent := a .getCurrentAssociation (desired )
71
- existsInDesired := a .getDesiredAssociation (desired )
72
70
73
71
// Create pod association if is doesnt already exist
74
- if existsInDesired && ! existsInCurrent {
72
+ if ! existsInCurrent {
75
73
procedures = append (procedures ,
76
74
& CreatePodIdentityAssociationProcedure {
77
75
eksClient : a .eksClient ,
@@ -83,10 +81,9 @@ func (a *plan) Create(_ context.Context) ([]planner.Procedure, error) {
83
81
}
84
82
85
83
for _ , current := range a .currentAssociations {
86
- existsInCurrent := a .getCurrentAssociation (current )
87
84
existsInDesired := a .getDesiredAssociation (current )
88
85
89
- if ! existsInDesired && existsInCurrent {
86
+ if ! existsInDesired {
90
87
// Delete pod association if it exists
91
88
procedures = append (procedures ,
92
89
& DeletePodIdentityAssociationProcedure {
0 commit comments