Provisioning: Mark repository as unhealthy if hooks fail (#109788)
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user