Skip to content

Commit

Permalink
bugfix: operator update service
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
  • Loading branch information
famarting committed Apr 28, 2022
1 parent 8eee96b commit f314263
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/operator/handlers/dapr_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,20 @@ func (h *DaprHandler) ensureDaprServicePresent(ctx context.Context, namespace st
return err
}

if err := h.patchDaprService(ctx, mayDaprService, wrapper); err != nil {
if err := h.patchDaprService(ctx, mayDaprService, wrapper, daprSvc); err != nil {
log.Errorf("unable to update service, %s, err: %s", mayDaprService, err)
return err
}

return nil
}

func (h *DaprHandler) patchDaprService(ctx context.Context, expectedService types.NamespacedName, wrapper ObjectWrapper) error {
func (h *DaprHandler) patchDaprService(ctx context.Context, expectedService types.NamespacedName, wrapper ObjectWrapper, daprSvc corev1.Service) error {
appID := h.getAppID(wrapper)
service := h.createDaprServiceValues(ctx, expectedService, wrapper, appID)

service.ObjectMeta.ResourceVersion = daprSvc.ObjectMeta.ResourceVersion

if err := h.Update(ctx, service); err != nil {
return err
}
Expand Down

0 comments on commit f314263

Please sign in to comment.