ork generate katalog
Scaffold a starter katalog.yaml for a new operator.
ork generate katalog [flags]
Generates a katalog.yaml with sensible defaults, commented optional blocks, and TODO placeholders. All generated fields are valid YAML — no further tooling is required before editing.
Flags
| Flag | Description |
|---|---|
--add-hook | Typed mode: include a commented hooks declaration |
--add-constructor | Typed mode: include a commented constructor declaration with default: false |
--typed | Typed mode: include both hooks and constructor sections commented; prints a warning |
--add-security | Include a security block (namespace and deletion protection) |
--add-notification | Include a notification block with example team entries |
--add-provider <cloud> | Include a providers block for aws, azure, or gcp |
-o, --output <file> | Output file path (default: katalog.yaml) |
Reconcile Modes
Choose at most one reconcile mode flag. They are mutually exclusive.
| Flag | Mode | Description |
|---|---|---|
| (none) | Dynamic | Declarative templates (onCreate, onReconcile, onDelete). No Go code needed. |
--add-hook | Typed | Commented hooks declaration. You write a ReconcileHooks[*MyKind] factory in Go. |
--add-constructor | Typed | Commented constructor declaration with default: false. You own the full reconcile loop. |
--typed | Typed | Both hooks and constructor sections commented. A warning is printed — you must uncomment exactly one before running. |
Usage
Scaffold a dynamic-mode Katalog (default):
ork generate katalog
Typed mode with hooks:
ork generate katalog --add-hook -o database-katalog.yaml
Typed mode with a custom constructor:
ork generate katalog --add-constructor -o reconciler-katalog.yaml
Full typed mode (both sections commented, choose one):
ork generate katalog --typed
Add optional blocks:
ork generate katalog --add-security --add-notification --add-provider aws
Combine mode and optional flags:
ork generate katalog --add-hook --add-security --add-provider gcp -o ops-katalog.yaml
Behavior
- Validates flag combinations before writing any file. Mutually exclusive flags produce a clear error.
- Writes the scaffold to
katalog.yaml(or--outputpath). - The output is pure YAML — no template syntax leaks into the generated file.
- When
--typedis used, a warning is printed to stderr reminding you to uncomment exactly one section.
Optional Blocks
Optional flags may be combined freely with any reconcile mode.
| Flag | Block added |
|---|---|
--add-security | security.namespaceProtection and security.deletionProtection |
--add-notification | notification.teams with example Slack webhook entries |
--add-provider aws | providers.aws with credential env-var placeholders |
--add-provider azure | providers.azure with subscription and tenant env-var placeholders |
--add-provider gcp | providers.gcp with project and credentials file placeholders |
Notes
- Replace every
TODOplaceholder before runningork run. - The generated file is idempotent — re-running overwrites the output file.
- Provider names are case-insensitive (
AWS,aws, andAwsall work).