@@ -35,7 +35,7 @@ func NewPlan(clusterName string, desiredAssociations, currentAssociations []EKSP
3535 }
3636}
3737
38- // Plan is a plan that will manage EKS addons .
38+ // Plan is a plan that will manage EKS pod identities .
3939type plan struct {
4040 currentAssociations []EKSPodIdentityAssociation
4141 desiredAssociations []EKSPodIdentityAssociation
@@ -61,17 +61,15 @@ func (a *plan) getDesiredAssociation(association EKSPodIdentityAssociation) bool
6161 return false
6262}
6363
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 .
6565func (a * plan ) Create (_ context.Context ) ([]planner.Procedure , error ) {
6666 procedures := []planner.Procedure {}
6767
68- for _ , d := range a .desiredAssociations {
69- desired := d
68+ for _ , desired := range a .desiredAssociations {
7069 existsInCurrent := a .getCurrentAssociation (desired )
71- existsInDesired := a .getDesiredAssociation (desired )
7270
7371 // Create pod association if is doesnt already exist
74- if existsInDesired && ! existsInCurrent {
72+ if ! existsInCurrent {
7573 procedures = append (procedures ,
7674 & CreatePodIdentityAssociationProcedure {
7775 eksClient : a .eksClient ,
@@ -83,10 +81,9 @@ func (a *plan) Create(_ context.Context) ([]planner.Procedure, error) {
8381 }
8482
8583 for _ , current := range a .currentAssociations {
86- existsInCurrent := a .getCurrentAssociation (current )
8784 existsInDesired := a .getDesiredAssociation (current )
8885
89- if ! existsInDesired && existsInCurrent {
86+ if ! existsInDesired {
9087 // Delete pod association if it exists
9188 procedures = append (procedures ,
9289 & DeletePodIdentityAssociationProcedure {
0 commit comments