Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

udpating error message returned from getUserCredentials to avoid logs looping … #569

Merged

Conversation

DanielePalaia
Copy link
Contributor

@DanielePalaia DanielePalaia commented Mar 6, 2023

…forever

This closes #

#551

Note to reviewers: remember to look at the commits in this PR and consider if they can be squashed
Note to contributors: remember to re-generate client set if there are any API changes

Summary Of Changes

It seems like that when we delete a credential user secret the messaging operator prints continuously logs like:

ZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,} EZI43wvWvLfxxFsWYdeykLxeKy4mWMX5}}] &LocalObjectReference{Name:myuser-2-user-credentials,}

and

2023-03-06T14:21:00Z ERROR Reconciler error {"controller": "user", "controllerGroup": "rabbitmq.com", "controllerKind": "User", "User": {"name":"myuser-2","namespace":"rabbitmq-system"}, "namespace": "rabbitmq-system", "name": "myuser-2", "reconcileID": "cd7a69ea-5e53-4e2f-9523-746062bd13bf", "error": "failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from status; user.status: {1 [{Ready False 2023-03-06 14:20:41 +0000 UTC FailedCreateOrUpdate failed to retrieve user credentials secret from statu

This modification seems preventing this to happen. The error will be printed just at every reconciliation loop.

Additional Context

@DanielePalaia DanielePalaia changed the title udpating error message from getUserCredentials to avoid logs looping … udpating error message returned from getUserCredentials to avoid logs looping … Mar 6, 2023
@ChunyiLyu
Copy link
Contributor

It's because error returned from DeclareFunc() is used to set objects status.condition in https://github.com/rabbitmq/messaging-topology-operator/blob/main/controllers/topology_controller.go#L95, so the status condition just keep getting longer and longer with the same repeated message. Not returning the user.status as part of the error fixes the issue.

@DanielePalaia DanielePalaia merged commit e01fb04 into main Mar 6, 2023
@DanielePalaia DanielePalaia deleted the delay_reconciliation_loop_user_controller_iferror branch March 6, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants