Skip to content

Commit

Permalink
fix: check port change to reflect changes in underlying service
Browse files Browse the repository at this point in the history
  • Loading branch information
miladibra10 committed Jun 12, 2023
1 parent 5ae241d commit f69593a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/externalservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func (r *ExternalServiceReconciler) Reconcile(ctx context.Context, req ctrl.Requ
// TODO: DeepEqual function does not operate good for this part because kubernetes adds values to fields after creation
// we can check for more field differences here.
if !reflect.DeepEqual(&desiredService.Spec.Type, &currentService.Spec.Type) ||
!reflect.DeepEqual(&desiredService.Labels, &currentService.Labels) {
!reflect.DeepEqual(&desiredService.Labels, &currentService.Labels) ||
!reflect.DeepEqual(&desiredService.Spec.Ports, &currentService.Spec.Ports) {
err = r.Update(ctx, &desiredService)
if err != nil {
logger.Error(err, "could not update service object")
Expand Down

0 comments on commit f69593a

Please sign in to comment.