diff --git a/api/v1beta2/condition_types.go b/api/v1beta2/condition_types.go index 3fcc5eb..3d20880 100644 --- a/api/v1beta2/condition_types.go +++ b/api/v1beta2/condition_types.go @@ -17,8 +17,8 @@ limitations under the License. package v1beta2 const ( - // HealthyCondition is the condition type used - // to record the last health assessment result. + // HealthyCondition represents the last recorded + // health assessment result. HealthyCondition string = "Healthy" // PruneFailedReason represents the fact that the @@ -26,18 +26,14 @@ const ( PruneFailedReason string = "PruneFailed" // ArtifactFailedReason represents the fact that the - // artifact download of the kustomization failed. + // source artifact download failed. ArtifactFailedReason string = "ArtifactFailed" // BuildFailedReason represents the fact that the - // kustomize build of the Kustomization failed. + // kustomize build failed. BuildFailedReason string = "BuildFailed" // HealthCheckFailedReason represents the fact that - // one of the health checks of the Kustomization failed. + // one of the health checks failed. HealthCheckFailedReason string = "HealthCheckFailed" - - // ValidationFailedReason represents the fact that the - // validation of the Kustomization manifests has failed. - ValidationFailedReason string = "ValidationFailed" ) diff --git a/controllers/kustomization_wait_test.go b/controllers/kustomization_wait_test.go index b7f3319..93fc713 100644 --- a/controllers/kustomization_wait_test.go +++ b/controllers/kustomization_wait_test.go @@ -172,7 +172,7 @@ data: events := getEvents(resultK.GetName(), map[string]string{"kustomize.toolkit.fluxcd.io/revision": revision}) g.Expect(len(events) > 0).To(BeTrue()) g.Expect(events[len(events)-1].Type).To(BeIdenticalTo("Warning")) - g.Expect(events[len(events)-1].Message).To(ContainSubstring("NotFound")) + g.Expect(events[len(events)-1].Message).To(ContainSubstring("context deadline")) }) t.Run("recovers and reports healthy status", func(t *testing.T) { diff --git a/docs/spec/v1beta2/kustomization.md b/docs/spec/v1beta2/kustomization.md index b15b06a..091398f 100644 --- a/docs/spec/v1beta2/kustomization.md +++ b/docs/spec/v1beta2/kustomization.md @@ -361,7 +361,25 @@ A Kustomization can contain a series of health checks used to determine the [rollout status](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#deployment-status) of the deployed workloads and the ready status of custom resources. -To enabled health checking for all the reconciled resources, set `spec.wait` to `true`. +To enabled health checking for all the reconciled resources, +set `spec.wait` and `spec.timeout`: + +```yaml +apiVersion: kustomize.toolkit.fluxcd.io/v1beta2 +kind: Kustomization +metadata: + name: backend + namespace: default +spec: + interval: 5m + path: "./deploy" + sourceRef: + kind: GitRepository + name: webapp + wait: true + timeout: 2m +``` + If you wish to select only certain resources, list them under `spec.healthChecks`. Note that when `spec.wait` is enabled, the `spec.healthChecks` field is ignored.