Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

BundleDeployment Healthcheck #725

Closed

Conversation

jmprusi
Copy link
Member

@jmprusi jmprusi commented Sep 6, 2023

wip

@jmprusi jmprusi requested a review from a team as a code owner September 6, 2023 14:43
Signed-off-by: Joaquim Moreno Prusi <[email protected]>
Adds a "generic" healthcheck function.

It returns true if all resources are healthy with nil error.
It returns false if any of the resources are not healthy, the error contains the GVK + resource name, and the error message of
each unhealthy resource.

The current list of supported resources is:
- Deployments
- StatefulSets
- DaemonSets
- ReplicaSets
- Pods
- APIServices
- CustomResourceDefinitions

If the resource is not supported, it is assumed to be healthy.

wip

wip

Signed-off-by: Joaquim Moreno Prusi <[email protected]>
Signed-off-by: Joaquim Moreno Prusi <[email protected]>
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Patch coverage: 50.85% and project coverage change: +4.53% 🎉

Comparison is base (e59d3f5) 19.21% compared to head (8a39ce8) 23.75%.
Report is 4 commits behind head on main.

❗ Current head 8a39ce8 differs from pull request most recent head b44839a. Consider uploading reports for the commit b44839a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #725      +/-   ##
==========================================
+ Coverage   19.21%   23.75%   +4.53%     
==========================================
  Files          13       14       +1     
  Lines        1046     1221     +175     
==========================================
+ Hits          201      290      +89     
- Misses        801      879      +78     
- Partials       44       52       +8     
Files Changed Coverage Δ
...l/controllers/bundledeployment/bundledeployment.go 3.10% <0.00%> (-0.66%) ⬇️
internal/healthchecks/generic/generic.go 78.76% <78.76%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// toErrKey returns a string that uniquely identifies a resource based on its GVK and name.
// This is used to create a map of "GVK + Resource Name" to error message.
func toErrKey(resource client.Object) string {
return fmt.Sprintf("%s.%s.%s/%s", resource.GetObjectKind().GroupVersionKind().Kind, resource.GetObjectKind().GroupVersionKind().Group, resource.GetObjectKind().GroupVersionKind().Version, resource.GetName())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to include namespace, in case the bundle puts the same named object in two different namespaces.

@jmprusi
Copy link
Member Author

jmprusi commented Sep 6, 2023

closed in favour of #711

@jmprusi jmprusi closed this Sep 6, 2023
@jmprusi jmprusi deleted the jmprusi/resource-healthcheck branch September 6, 2023 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants