operator-sample-go icon indicating copy to clipboard operation
operator-sample-go copied to clipboard

Feature/event recorder

Open vishal-ramani opened this issue 3 years ago • 2 comments

Created new feature when application is started it will write an Kubernetes event in different conditions. We can check those events via kubectl get events command. Tested all scenarios as per our documentation with Kubernetes and OpenShift clusters.

vishal-ramani avatar Jul 29 '22 12:07 vishal-ramani

Hi Vishal. Thanks for completing this task. I have some comments:

operator-application/controllers/application/deployment.go

In this file, the event "Created deployment" is not really a Warning in my opinion. Could you make this event type corev1.EventTypeNormal?

operator-application/controllers/application/conditions.go

In this file, I think you are logging the same message twice with code:

log.Info("Application resource status update failed.") log.Info(CONDITION_MESSAGE_DELETECONDITION)

Also, the const definitions would be better defined in the variables.go file. However, if changing this would require a lot of repeat testing then it also fine to leave the consts where they are in conditions.go.

deleeuwblue avatar Aug 15 '22 13:08 deleeuwblue

Hi @deleeuwblue I have updated both the files with required changes. Can you please review and approve. Thank you!

vishal-ramani avatar Aug 16 '22 10:08 vishal-ramani