.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.

FieldTypeRequiredDefaultDescription
apiVersionstring (const genop.kornercloud.dev/v1)yesAPIVersion is the topology schema version. It must be “genop.kornercloud.dev/v1”; genop rejects any other value.
kindstring (const ProjectTopology)yesKind identifies the document type. It must be “ProjectTopology”.
specTopologySpecyesSpec 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.

FieldTypeRequiredDefaultDescription
modulestringnoModule 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.
licenseTopologyLicensenoLicense configures the license header prepended to generated Go files. Omit it to generate files without a header.
operatorslist of TopologyOperatornoOperators 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.

FieldTypeRequiredDefaultDescription
disabledboolnoDisabled explicitly opts out of license headers. It is mutually exclusive with Path.
pathstringnoPath 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.

FieldTypeRequiredDefaultDescription
projectstringyesProject 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.
pathstringno<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.
apiGroupstringyesAPIGroup is the Kubernetes API group for the operator’s resources, for example “infrastructure.acme.io”. Set on the command line with –api-group.
packagingTopologyPackagingnoPackaging selects which deployment artifacts are scaffolded. When omitted, Kustomize is enabled and Helm is not.
controllerslist of TopologyControllernoControllers 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.

FieldTypeRequiredDefaultDescription
helmboolnofalseHelm enables scaffolding of a Helm chart under config/helm for the operator.
kustomizeboolnotrueKustomize enables scaffolding of a Kustomize base under config/kustomize/base for the operator.

TopologyController#

TopologyController represents a controller definition in the topology.

FieldTypeRequiredDefaultDescription
namestringyesName is the controller name, for example “vms”. It becomes the controller package and the –controller value on genop commands.
resourceslist of TopologyResourcenoResources lists the API resources this controller reconciles.

TopologyResource#

TopologyResource represents a resource definition in the topology.

FieldTypeRequiredDefaultDescription
versionstringyesVersion is the Kubernetes API version of the resource, for example “v1alpha1”.
kindstringyesKind is the resource kind, for example “Instance”.
scopestringnoNamespacedScope is Namespaced or Cluster. It is chosen when the resource is created and cannot change afterwards.
metricsboolnotrueMetrics controls whether the resource metrics recorder is started. It is read at runtime from _METRICS_ENABLED; the generated ConfigMap seeds that variable from this field.
webhookTopologyWebhooknoWebhook selects which admission webhooks the resource registers. When omitted, both are registered.
applylist of TopologyApplyStepnoApply is the ordered list of reconciliation steps run when the resource is created or updated.
deletelist of TopologyDeleteStepnoDelete is the ordered list of reconciliation steps run when the resource is being deleted.
preReconcileHookslist of TopologyHooknoPreReconcileHooks 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.
cleanupHookslist of TopologyHooknoCleanupHooks 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.
operatorTopologyOperatorConfignoOperator 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 ConfigureOperator function instead.

TopologyWebhook#

TopologyWebhook configures which admission webhooks a resource registers. A nil field means enabled.

FieldTypeRequiredDefaultDescription
validatingboolnotrueValidating controls whether a validating admission webhook is registered and whether the resource appears in ValidatingWebhookConfiguration.
mutatingboolnotrueMutating 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.

FieldTypeRequiredDefaultDescription
namestringyesName is the step name in PascalCase, for example “MountVolume”. It becomes the step’s Go identifier and package.
conditionTypestringyesConditionType 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.

FieldTypeRequiredDefaultDescription
namestringyesName is the step name in PascalCase. It becomes the step’s Go identifier and package.
conditionTypestringyesConditionType 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).

FieldTypeRequiredDefaultDescription
namestringyesName 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.

FieldTypeRequiredDefaultDescription
retryPolicystringnoRetryPolicy is how the operator resumes after a failed step: “resumeAtFailure” (default) restarts from the failed step; “restartAll” re-runs every step from the beginning.
successStatusstringnoSuccessStatus 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).
deletionPolicystringnoDeletionPolicy 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 ConfigureOperator comment).
backoffTopologyBackoffnoBackoff tunes the exponential backoff applied to failed reconciles.
pendingCheckIntervalstringnoPendingCheckInterval 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.
successCheckIntervalstringnoSuccessCheckInterval 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).

FieldTypeRequiredDefaultDescription
baseDelaystringno
maxDelaystringno
factornumberno
jitterRatiointegernoJitterRatio is the jitter percentage, 0-100.