Skip to content

Commit 452ed76

Browse files
docs(deployment-operator): clarify CustomHealth scripts (#4000)
Co-authored-by: Michael Guarino <mjg@plural.sh>
1 parent 0b28dc9 commit 452ed76

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

go/deployment-operator/api/v1alpha1/customhealth_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ import (
2323

2424
// CustomHealthSpec defines the desired state of CustomHealth
2525
type CustomHealthSpec struct {
26+
// Script is a Lua health-assessment script. The target resource is available as the global `Obj`.
27+
//
28+
// The script must assign a Lua table to the global `healthStatus`; a Lua `return { ... }` is not consumed.
29+
// The table uses `status` and an optional `message`, for example: `healthStatus = { status = "Healthy", message = "resource is ready" }`.
30+
//
31+
// Supported/intended status values are `Healthy`, `Degraded`, `Paused`, `Unknown`, `Progressing`, `Suspended`, and `Missing`.
32+
//
33+
// See https://docs.plural.sh/plural-features/continuous-deployment/deployment-operator/custom-health for the full guide.
2634
Script string `json:"script,omitempty"`
2735

2836
// +kubebuilder:validation:Optional

go/deployment-operator/config/crd/bases/deployments.plural.sh_customhealths.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ spec:
4444
kind:
4545
type: string
4646
script:
47+
description: |-
48+
Script is a Lua health-assessment script. The target resource is available as the global `Obj`.
49+
50+
The script must assign a Lua table to the global `healthStatus`; a Lua `return { ... }` is not consumed.
51+
The table uses `status` and an optional `message`, for example: `healthStatus = { status = "Healthy", message = "resource is ready" }`.
52+
53+
Supported/intended status values are `Healthy`, `Degraded`, `Paused`, `Unknown`, `Progressing`, `Suspended`, and `Missing`.
54+
55+
See https://docs.plural.sh/plural-features/continuous-deployment/deployment-operator/custom-health for the full guide.
4756
type: string
4857
version:
4958
type: string

go/deployment-operator/docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ _Appears in:_
585585

586586
| Field | Description | Default | Validation |
587587
| --- | --- | --- | --- |
588-
| `script` _string_ | | | |
588+
| `script` _string_ | Script is a Lua health-assessment script. The target resource is available as the global `Obj`.<br />The script must assign a Lua table to the global `healthStatus`; a Lua `return \{ ... \}` is not consumed.<br />The table uses `status` and an optional `message`, for example: `healthStatus = \{ status = "Healthy", message = "resource is ready" \}`.<br />Supported/intended status values are `Healthy`, `Degraded`, `Paused`, `Unknown`, `Progressing`, `Suspended`, and `Missing`.<br />See https://docs.plural.sh/plural-features/continuous-deployment/deployment-operator/custom-health for the full guide. | | |
589589
| `group` _string_ | | | Optional: \{\} <br /> |
590590
| `version` _string_ | | | Optional: \{\} <br /> |
591591
| `kind` _string_ | | | Optional: \{\} <br /> |

0 commit comments

Comments
 (0)