Skip to content

Commit 1c9aabd

Browse files
SinghVikram97VikramBediRyan Lymburner
authored
Fix IAMAuthPolicy reconciliation loop on invalid service name override (#856)
Co-authored-by: VikramBedi <vbedi@amazon.com> Co-authored-by: Ryan Lymburner <137918933+rlymbur@users.noreply.github.com>
1 parent c75447a commit 1c9aabd

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

pkg/controllers/iamauthpolicy_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func (c *IAMAuthPolicyController) reconcileUpsert(ctx context.Context, k8sPolicy
161161
if statusErr := c.ph.UpdateAcceptedCondition(ctx, k8sPolicy, gwv1alpha2.PolicyReasonInvalid, err.Error()); statusErr != nil {
162162
return ctrl.Result{}, statusErr
163163
}
164+
return ctrl.Result{}, nil
164165
}
165166
return ctrl.Result{}, err
166167
}

test/suites/integration/iamauthpolicy_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ var _ = Describe("IAM Auth Policy", Ordered, func() {
304304
})
305305

306306
It("supports targetRef HTTPRoute change from invalid to valid service name override", func() {
307-
Skip("Test skipped")
308307
policy := newPolicy("recovery-test", "HTTPRoute", httpRouteWithInvalidServiceNameOverride.Name)
309308

310309
testK8sPolicy(policy, K8sResults{statusReason: gwv1alpha2.PolicyReasonInvalid})
@@ -324,19 +323,7 @@ var _ = Describe("IAM Auth Policy", Ordered, func() {
324323
annotationResId: svcId,
325324
}
326325

327-
Eventually(func(g Gomega) (K8sResults, error) {
328-
p := &anv1alpha1.IAMAuthPolicy{}
329-
err := testFramework.Client.Get(ctx, client.ObjectKeyFromObject(policy), p)
330-
if err != nil {
331-
return K8sResults{}, err
332-
}
333-
return K8sResults{
334-
statusReason: GetPolicyStatusReason(p),
335-
annotationResType: p.Annotations[controllers.IAMAuthPolicyAnnotationType],
336-
annotationResId: p.Annotations[controllers.IAMAuthPolicyAnnotationResId],
337-
}, nil
338-
}).WithTimeout(120 * time.Second).WithPolling(time.Second).
339-
Should(Equal(wantResults))
326+
testK8sPolicy(policy, wantResults)
340327
testLatticeSvcPolicy(svcId, vpclattice.AuthTypeAwsIam, policy.Spec.Policy)
341328

342329
testFramework.ExpectDeletedThenNotFound(ctx, policy)

0 commit comments

Comments
 (0)