diff --git a/rfcs/0000-custom-health-checks/README.md b/rfcs/0000-custom-health-checks/README.md index 911a20c75b..7a324c653d 100644 --- a/rfcs/0000-custom-health-checks/README.md +++ b/rfcs/0000-custom-health-checks/README.md @@ -33,8 +33,8 @@ condition to know if the certificate has been issued or not before looking at th In order to provide a generic solution for custom resources, that would not imply writing a custom `kstatus` reader for each CRD, we need to provide a way for the user to express the conditions that need to be met in order to determine the status. -And we need to do this in a way that is flexible enough to cover all possible use cases, -without having to change Flux source code for each new use case. +It should be done in a way that is flexible enough to cover all possible use cases, +without having to change Flux source code for each new CRD. ### Goals @@ -120,7 +120,7 @@ To help users define custom health checks, we will provide on the [fluxcd.io](ht website a library of custom health checks for popular custom resources. The Flux community will be able to contribute to this library by submitting pull requests -to the `fluxcd/website` repository. +to the [fluxcd/website](https://github.com/fluxcd/website) repository. ### User Stories @@ -176,7 +176,7 @@ Example for `Cluster`: We need an expression language that is flexible enough to cover all possible use cases, without having to change Flux source code for each new use case. -An alternative that have been considered was to use `CUE` instead of `CEL`. +An alternative that has been considered was to use `CUE` instead of `CEL`. `CUE` lang is a more powerful expression language, but given the fact that Kubernetes makes use of `CEL` for CRD validation and admission control, we have decided to also use `CEL` in Flux in order to be consistent with @@ -217,6 +217,17 @@ type CustomHealthCheck struct { } ``` +The `InProgress` expression is optional, when not specified the controller will determine +if the resource is in progress if both `Failed` and `Current` evaluate to false. +Moreover, if the `InProgress` expression is not specified and the custom resource has a +`.status.observedGeneration` field, the controller with compare it with the `.metadata.generation` +field to determine if the resource is in progress. + +The `Failed` expression is optional, when not specified the controller will keep evaluating the +`Current` expression until it returns true, and gave up after the timeout is reached. +Users should be encouraged to provide a `Failed` expression to avoid staling the reconciliation +loop until the timeout is reached. + ### Introduce a generic custom status reader We'll Introduce a `StatusReader` that will be used to compute the status