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

All controllers log with controllerKind "SuperStream" #404

Closed
ChunyiLyu opened this issue Jun 20, 2022 · 5 comments
Closed

All controllers log with controllerKind "SuperStream" #404

ChunyiLyu opened this issue Jun 20, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@ChunyiLyu
Copy link
Contributor

ChunyiLyu commented Jun 20, 2022

Describe the bug

{"level":"info","ts":1655722814.3733497,"msg":"Successfully declared queue","controller":"superstream","controllerGroup":"rabbitmq.com","controllerKind":"SuperStream","queue":{"name":"qq-example","namespace":"rabbitmq-system"},"namespace":"rabbitmq-system","name":"qq-example","reconcileID":"a17695c7-8dc2-4b4c-a254-bb7b4a74606f","queue":"qq"}
{"level":"info","ts":1655722814.3779905,"msg":"Finished reconciling","controller":"superstream","controllerGroup":"rabbitmq.com","controllerKind":"SuperStream","queue":{"name":"qq-example","namespace":"rabbitmq-system"},"namespace":"rabbitmq-system","name":"qq-example","reconcileID":"a17695c7-8dc2-4b4c-a254-bb7b4a74606f"}

Impacted version: 1.7.0. All previous versions log in a slightly different format and are not impacted.

To Reproduce

Deploy latest 1.7.0 operator, create a non SuperStream CR and see the log line

Expected behavior

ControllerKind should be the actual controller kind name

Fix

This is currently fixed in controller-runtime master branch kubernetes-sigs/controller-runtime#1907. We can wait til their next release. I will mark this issue as blocked for now and leave it open as a reminder for us.

@ChunyiLyu ChunyiLyu added the bug Something isn't working label Jun 20, 2022
@ChunyiLyu ChunyiLyu changed the title All controller logs with controllerKind SuperStream All controllers log with controllerKind "SuperStream" Jun 20, 2022
@ChunyiLyu
Copy link
Contributor Author

ChunyiLyu commented Jun 20, 2022

It's because SuperStream is the last controller to start. For example, in my quick test, when moving the Shovel controller to the last (swap the block of SuperStream and Shovel): https://github.com/rabbitmq/messaging-topology-operator/blob/main/main.go#L214-L234

You get controllerKind "Shovel" instead 1.6557344300973513e+09 INFO Successfully declared queue {"controller": "shovel", "controllerGroup": "rabbitmq.com", "controllerKind": "Shovel", "queue": {"name":"qq-example","namespace":"rabbitmq-system"}, "namespace": "rabbitmq-system", "name": "qq-example", "reconcileID": "fdffebe6-c324-46ef-91f2-c45e8b4a07e9", "queue": "qq"} 1.6557344300975776e+09 DEBUG events Normal {"object": {"kind":"Queue","namespace":"rabbitmq-system","name":"qq-example","uid":"b1ae7ebd-881d-4a15-976b-c292cf6b5372","apiVersion":"rabbitmq.com/v1beta1","resourceVersion":"40161"}, "reason": "SuccessfulDeclare", "message": "Successfully declared queue"} 1.65573443010357e+09 INFO Finished reconciling {"controller": "shovel", "controllerGroup": "rabbitmq.com", "controllerKind": "Shovel", "queue": {"name":"qq-example","namespace":"rabbitmq-system"}, "namespace": "rabbitmq-system", "name": "qq-example", "reconcileID": "fdffebe6-c324-46ef-91f2-c45e8b4a07e9"}

@ChunyiLyu
Copy link
Contributor Author

It's only an issue with 1.17. 1.16 and all previous versions logs with Reconcile Kind instead of controller kind and has no issue, see

{"level":"info","ts":1655800165.8050077,"logger":"controller.queue","msg":"Successfully declared queue","reconciler group":"rabbitmq.com","reconciler kind":"Queue","name":"qq-example","namespace":"rabbitmq-system","queue":"qq"}
{"level":"info","ts":1655800165.8178542,"logger":"controller.queue","msg":"Finished reconciling","reconciler group":"rabbitmq.com","reconciler kind":"Queue","name":"qq-example","namespace":"rabbitmq-system"}

@ChunyiLyu
Copy link
Contributor Author

This is currently fixed in controller-runtime master branch kubernetes-sigs/controller-runtime#1907. We can wait til their next release. I will mark this issue as blocked for now and leave it open as a reminder for us.

@ChunyiLyu
Copy link
Contributor Author

Not an issue anymore after controller runtime update: #406

See

1.6564091640764148e+09	DEBUG	events	Normal	{"object": {"kind":"User","namespace":"rabbitmq-system","name":"import-user-sample","uid":"9902c5ce-4c54-43e2-9da0-f6581d7320f4","apiVersion":"rabbitmq.com/v1beta1","resourceVersion":"619555"}, "reason": "SuccessfulDeclare", "message": "Successfully declared user"}
1.656409164085648e+09	INFO	Finished reconciling	{"controller": "user", "controllerGroup": "rabbitmq.com", "controllerKind": "User", "user": {"name":"import-user-sample","namespace":"rabbitmq-system"}, "namespace": "rabbitmq-system", "name": "import-user-sample", "reconcileID": "a8489d27-5120-4ae4-b9f1-0849088b0694"}

@ChunyiLyu
Copy link
Contributor Author

ChunyiLyu commented Jun 29, 2022

New version cut with updated controller-runtime: https://github.com/rabbitmq/messaging-topology-operator/releases/tag/v1.7.1. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant