Skip to content

Commit 562fae8

Browse files
stefanmcshaneDanil-Grigorev
authored andcommitted
semantic changes
1 parent ed77fa0 commit 562fae8

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

pkg/eks/podidentities/plan.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
3939
type 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.
6565
func (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{

pkg/eks/podidentities/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ type EKSPodIdentityAssociation struct {
3030

3131
// IsEqual determines if 2 EKSPodIdentityAssociation are equal.
3232
func (e *EKSPodIdentityAssociation) IsEqual(other *EKSPodIdentityAssociation) bool {
33-
// NOTE: we don't compare the ARN as thats only for existing addons
3433
if e == other {
3534
return true
3635
}

0 commit comments

Comments
 (0)