Provisioning: Mark repository as unhealthy if hooks fail (#109788)

This commit is contained in:
Roberto Jiménez Sánchez
2025-08-21 08:32:23 +00:00
committed by GitHub
parent 03d9ec4ea3
commit 61d137992b
22 changed files with 1578 additions and 490 deletions
@@ -242,10 +242,22 @@ type RepositoryStatus struct {
Webhook *WebhookStatus `json:"webhook"`
}
// HealthFailureType represents different types of repository failures
// +enum
type HealthFailureType string
const (
HealthFailureHook HealthFailureType = "hook"
HealthFailureHealth HealthFailureType = "health"
)
type HealthStatus struct {
// When not healthy, requests will not be executed
Healthy bool `json:"healthy"`
// The type of the error
Error HealthFailureType `json:"error,omitempty"`
// When the health was checked last time
Checked int64 `json:"checked,omitempty"`
@@ -571,6 +571,14 @@ func schema_pkg_apis_provisioning_v0alpha1_HealthStatus(ref common.ReferenceCall
Format: "",
},
},
"error": {
SchemaProps: spec.SchemaProps{
Description: "The type of the error\n\nPossible enum values:\n - `\"health\"`\n - `\"hook\"`",
Type: []string{"string"},
Format: "",
Enum: []interface{}{"health", "hook"},
},
},
"checked": {
SchemaProps: spec.SchemaProps{
Description: "When the health was checked last time",