.genop.yaml Reference
This file is generated from the Topology* structs in cmd/cli/topology.go. It lists every field of .genop.yaml, its type, whether it is required, its default and its meaning. Run make docs to regenerate it, and docs/genop.schema.json alongside it, after changing a topology struct.
ProjectTopology
ProjectTopology is the root type representing a genop project topology configuration.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
apiVersion | string (const genop.kornercloud.dev/v1) | yes | APIVersion is the topology schema version. It must be “genop.kornercloud.dev/v1”; genop rejects any other value. | |
kind | string (const ProjectTopology) | yes | Kind identifies the document type. It must be “ProjectTopology”. | |
spec | TopologySpec | yes | Spec holds the project topology: the Go module path, optional license configuration and the list of operators. |
TopologySpec
TopologySpec contains the specification for a project topology.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
module | string | no | Module is the Go module path of the repository, for example “gitlab.com/acme.io/fleet-operator”. When empty, genop falls back to the module declared in go.mod. | |
license | TopologyLicense | no | License configures the license header prepended to generated Go files. Omit it to generate files without a header. | |
operators | list of TopologyOperator | no | Operators lists the operators scaffolded in this repository. Each entry is an independent operator with its own API group, controllers and packaging. |
TopologyLicense
TopologyLicense configures license header injection for generated Go files.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
disabled | bool | no | Disabled explicitly opts out of license headers. It is mutually exclusive with Path. | |
path | string | no | Path is the license file to inject, relative to the directory containing .genop.yaml. Its contents are wrapped in a block comment and prepended to every generated Go file. |
TopologyOperator
TopologyOperator represents an operator definition in the topology.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
project | string | yes | Project is the logical name of the operator. genop commands key on it (–project) and, unless Path is set, it is also the directory the operator is generated into. | |
path | string | no | <project name> | Path is the operator’s location on disk, relative to the repository root. Set it to house the operator in a repository that also holds non-operator code. |
apiGroup | string | yes | APIGroup is the Kubernetes API group for the operator’s resources, for example “infrastructure.acme.io”. Set on the command line with –api-group. | |
packaging | TopologyPackaging | no | Packaging selects which deployment artifacts are scaffolded. When omitted, Kustomize is enabled and Helm is not. | |
controllers | list of TopologyController | no | Controllers lists the controllers exposed by this operator. Each one reconciles one or more resources. |
TopologyPackaging
TopologyPackaging configures which packaging methods are scaffolded for an operator. When the whole block is omitted, Kustomize is enabled and Helm is not.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
helm | bool | no | false | Helm enables scaffolding of a Helm chart under config/helm for the operator. |
kustomize | bool | no | true | Kustomize enables scaffolding of a Kustomize base under config/kustomize/base for the operator. |
TopologyController
TopologyController represents a controller definition in the topology.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Name is the controller name, for example “vms”. It becomes the controller package and the –controller value on genop commands. | |
resources | list of TopologyResource | no | Resources lists the API resources this controller reconciles. |
TopologyResource
TopologyResource represents a resource definition in the topology.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
version | string | yes | Version is the Kubernetes API version of the resource, for example “v1alpha1”. | |
kind | string | yes | Kind is the resource kind, for example “Instance”. | |
scope | string | no | Namespaced | Scope is Namespaced or Cluster. It is chosen when the resource is created and cannot change afterwards. |
metrics | bool | no | true | Metrics controls whether the resource metrics recorder is started. It is read at runtime from |
webhook | TopologyWebhook | no | Webhook selects which admission webhooks the resource registers. When omitted, both are registered. | |
apply | list of TopologyApplyStep | no | Apply is the ordered list of reconciliation steps run when the resource is created or updated. | |
delete | list of TopologyDeleteStep | no | Delete is the ordered list of reconciliation steps run when the resource is being deleted. | |
preReconcileHooks | list of TopologyHook | no | PreReconcileHooks is the ordered list of hooks run at the top of every reconcile loop, before the apply or delete steps. Each becomes a function in the resource’s hooks package. | |
cleanupHooks | list of TopologyHook | no | CleanupHooks is the ordered list of hooks run only when the resource is being deleted, after the deletion steps and before genop removes its own finalizer. They run regardless of the deletion policy (Retain included). Each becomes a function in the resource’s hooks package. | |
operator | TopologyOperatorConfig | no | Operator overrides genop-runtime OperatorBuilder options that are otherwise only reachable by hand-editing the generated wiring. Every field is optional; an omitted field keeps the runtime default. Anything not expressible here (a custom DeletionPolicyFunc, per-controller logic) goes in the generated Configure |
TopologyWebhook
TopologyWebhook configures which admission webhooks a resource registers. A nil field means enabled.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
validating | bool | no | true | Validating controls whether a validating admission webhook is registered and whether the resource appears in ValidatingWebhookConfiguration. |
mutating | bool | no | true | Mutating controls whether a mutating admission webhook is registered and whether the resource appears in MutatingWebhookConfiguration. |
TopologyApplyStep
TopologyApplyStep is one entry in the apply reconciliation list for a resource.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Name is the step name in PascalCase, for example “MountVolume”. It becomes the step’s Go identifier and package. | |
conditionType | string | yes | ConditionType is the status condition the step reports, for example “VolumeMounted”. Derived from Name when omitted on the command line. |
TopologyDeleteStep
TopologyDeleteStep is one entry in the deletion reconciliation list for a resource.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Name is the step name in PascalCase. It becomes the step’s Go identifier and package. | |
conditionType | string | yes | ConditionType is the status condition the step reports. Derived from Name when omitted on the command line. |
TopologyHook
TopologyHook is one entry in a resource’s preReconcileHooks or cleanupHooks list. A hook is a plain function the operator runs around the reconciliation steps; unlike a step it reports no status condition of its own (the runtime wraps a hook failure in a PreReconcileHookExecuted / CleanupHookExecuted condition).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | Name is the hook name in PascalCase, for example “AddFinalizers”. It becomes the generated Go function name in the resource’s hooks package. |
TopologyOperatorConfig
TopologyOperatorConfig is the optional operator: block on a resource. It
maps to genop-runtime OperatorBuilder.With* options. Empty fields keep the
runtime default.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
retryPolicy | string | no | RetryPolicy is how the operator resumes after a failed step: “resumeAtFailure” (default) restarts from the failed step; “restartAll” re-runs every step from the beginning. | |
successStatus | string | no | SuccessStatus is the terminal phase on success: “Running” (default, keeps reconciling for drift) or “Succeeded” (one-shot, absorbing — never reconciled again, including after a spec change). | |
deletionPolicy | string | no | DeletionPolicy selects the deletion-policy provider: “default” reads spec.lifecycle.deletionPolicy on the resource itself; “fromAncestor” walks ownerReferences and applies the policy of the top parent being deleted (needs extra get RBAC on the parent kinds — see the generated Configure | |
backoff | TopologyBackoff | no | Backoff tunes the exponential backoff applied to failed reconciles. | |
pendingCheckInterval | string | no | PendingCheckInterval is how often a resource in a Pending holding pattern (paused by annotation, or deletion blocked on another finalizer) is re-checked. Go duration string. Default 10s. | |
successCheckInterval | string | no | SuccessCheckInterval is how often a successfully reconciled resource is re-checked for drift. Go duration string. Overrides the controller-level SUCCESS_CHECK_INTERVAL (default 12h) for this resource only. |
TopologyBackoff
TopologyBackoff tunes exponential backoff. Zero-value fields keep the runtime default (baseDelay 5s, maxDelay 1h, factor 2.0, jitterRatio 25).
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
baseDelay | string | no | ||
maxDelay | string | no | ||
factor | number | no | ||
jitterRatio | integer | no | JitterRatio is the jitter percentage, 0-100. |