Skip to content

Commit

Permalink
Bug fix, add back httproute status (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
liwenwu-amazon authored Feb 28, 2023
1 parent 9e4b16d commit 04e6f02
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion controllers/httproute_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,13 @@ func (r *HTTPRouteReconciler) updateHTTPRouteStatus(ctx context.Context, dns str

httproute.ObjectMeta.Annotations["application-networking.k8s.aws/lattice-assigned-domain-name"] = dns

if err := r.Client.Patch(ctx, httproute, client.MergeFrom(httprouteOld)); err != nil {
glog.V(2).Infof("updateHTTPRouteStatus: Patch() received err %v \n", err)
return errors.Wrapf(err, "failed to update httproute status")
}

httprouteOld = httproute.DeepCopy()

httproute.Status.RouteStatus.Parents[0].ControllerName = config.LatticeGatewayControllerName

httproute.Status.RouteStatus.Parents[0].Conditions[0].Type = "httproute"
Expand All @@ -297,7 +304,7 @@ func (r *HTTPRouteReconciler) updateHTTPRouteStatus(ctx context.Context, dns str
httproute.Status.RouteStatus.Parents[0].ParentRef.Kind = httproute.Spec.ParentRefs[0].Kind
httproute.Status.RouteStatus.Parents[0].ParentRef.Name = httproute.Spec.ParentRefs[0].Name

if err := r.Client.Patch(ctx, httproute, client.MergeFrom(httprouteOld)); err != nil {
if err := r.Client.Status().Patch(ctx, httproute, client.MergeFrom(httprouteOld)); err != nil {
glog.V(2).Infof("updateHTTPRouteStatus: Patch() received err %v \n", err)
return errors.Wrapf(err, "failed to update httproute status")
}
Expand Down

0 comments on commit 04e6f02

Please sign in to comment.