Skip to content

Commit 8c3ec9e

Browse files
committed
Linter driven cleanup.
1 parent 86db1a6 commit 8c3ec9e

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

internal/controller/trafficprotectionpolicy_controller.go

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (r *TrafficProtectionPolicyReconciler) updateTPPAncestorsStatus(
185185
}
186186

187187
// Remove any ancestorRefs owned by this controller that are no longer targeted
188-
for i, ancestor := range policy.Status.PolicyStatus.Ancestors {
188+
for i, ancestor := range policy.Status.Ancestors {
189189
if ancestor.ControllerName != r.Config.Gateway.ControllerName {
190190
continue
191191
}
@@ -199,7 +199,7 @@ func (r *TrafficProtectionPolicyReconciler) updateTPPAncestorsStatus(
199199
}
200200

201201
if !found {
202-
policy.Status.PolicyStatus.Ancestors = append(policy.Status.PolicyStatus.Ancestors[:i], policy.Status.PolicyStatus.Ancestors[i+1:]...)
202+
policy.Status.Ancestors = append(policy.Status.Ancestors[:i], policy.Status.Ancestors[i+1:]...)
203203
}
204204
}
205205

@@ -470,7 +470,7 @@ func (r *TrafficProtectionPolicyReconciler) processTrafficProtectionPolicyForHTT
470470
route.attached = true
471471
} else {
472472
found := false
473-
for _, r := range route.HTTPRoute.Spec.Rules {
473+
for _, r := range route.Spec.Rules {
474474
if r.Name != nil && *r.Name == *targetRef.SectionName {
475475
found = true
476476
break
@@ -561,22 +561,12 @@ func getAncestorRefForTarget(namespace string, targetRef gatewayv1alpha2.LocalPo
561561
return &gatewayv1alpha2.ParentReference{
562562
Group: ptr.To(targetRef.Group),
563563
Kind: ptr.To(targetRef.Kind),
564-
Name: gatewayv1.ObjectName(targetRef.Name),
564+
Name: targetRef.Name,
565565
Namespace: ptr.To(gatewayv1.Namespace(namespace)),
566566
SectionName: targetRef.SectionName,
567567
}
568568
}
569569

570-
func getParentReferenceString(ref *gatewayv1alpha2.ParentReference) string {
571-
return fmt.Sprintf("%s/%s/%s/%s/%s",
572-
ptr.Deref(ref.Group, ""),
573-
ptr.Deref(ref.Kind, ""),
574-
ptr.Deref(ref.Namespace, ""),
575-
ref.Name,
576-
ptr.Deref(ref.SectionName, ""),
577-
)
578-
}
579-
580570
func (r *TrafficProtectionPolicyReconciler) processTrafficProtectionPolicyForGateway(
581571
ctx context.Context,
582572
gatewayMap map[client.ObjectKey]*policyGatewayTargetContext,

0 commit comments

Comments
 (0)