-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add healthy condition to source (#1976)
This pull request includes several changes to the `frontend` package, focusing on refactoring functions, improving code readability, and enhancing the condition handling for instrumented applications. ### Refactoring and Code Simplification: * Removed the mapping of instrumentation options in the `instrumentedApplicationToActualSource` function in `frontend/graph/conversions.go` to simplify the code. * Changed the `AutoInstrumentedDecision` field to be an empty string in the `instrumentedApplicationToActualSource` function in `frontend/graph/conversions.go`. ### Condition Handling Enhancements: * Added a call to `AddHealthyInstrumentationInstancesCondition` in the `K8sActualSources` resolver in `frontend/graph/schema.resolvers.go` to ensure healthy instrumentation instances are tracked. * Modified the `GetActualSource` function in `frontend/services/sources.go` to use `AddHealthyInstrumentationInstancesCondition` with a `nil` source parameter. * Updated the `addHealthyInstrumentationInstancesCondition` function (renamed to `AddHealthyInstrumentationInstancesCondition`) in `frontend/services/sources.go` to use `model.ConditionStatusTrue` and `model.ConditionStatusFalse` instead of `metav1.ConditionTrue` and `metav1.ConditionFalse`, respectively. Also, added formatted message and transition time handling. [[1]](diffhunk://#diff-d8f62b6675961fc4e307e4fd622a59132ddc730b6e701ae1bc43dd1695f969a7L126-R126) [[2]](diffhunk://#diff-d8f62b6675961fc4e307e4fd622a59132ddc730b6e701ae1bc43dd1695f969a7L153-R164) ### Utility Functions: * Added a new utility function `Metav1TimeToString` in `frontend/services/utils.go` to convert `metav1.Time` to a string formatted in RFC3339. ### Minor Code Improvements: * Removed unnecessary comments in the `Actions` resolver in `frontend/graph/schema.resolvers.go` to improve code readability. * Added the `time` package import in `frontend/services/utils.go` for date and time formatting. --------- Co-authored-by: alonkeyval <[email protected]> Co-authored-by: Ben Elferink <[email protected]>
- Loading branch information
1 parent
5acf192
commit 396aa34
Showing
4 changed files
with
26 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters