apply can update live infrastructure. This guide shows how to preview every change before it lands and how to run a safe, GitOps-style loop.
Preview before you write
Two mechanisms let you see exactly what a change will do before committing it.Diff a manifest against live state
datumctl diff -f <file> shows the difference between what is currently deployed and what your manifest would apply — the same server-side comparison the platform uses, rendered as a unified diff.
0 when there are no differences, 1 when there are, and greater than 1 on error — handy for gating an apply in a script:
Validate a write with --dry-run=server
Every write command accepts --dry-run=server, which sends the request to the API server for full validation — including admission checks — without persisting anything.
diff answers “what will change?” and --dry-run=server answers “is this change valid?”. Use both: diff to review the delta, dry-run to confirm the server accepts it.The declarative loop
A repeatable workflow for changing any Datum Cloud resource follows four steps: inspect the schema, preview the change, apply it, then verify the result.Inspect the schema
Confirm the fields a resource type accepts before you author or edit a manifest.See Discovering resources & schemas for finding resource types and reading their fields in depth.
Apply
Once the preview looks right, apply the manifest.
apply creates the resource if it does not exist and updates it to match your manifest if it does.- Store resource definitions alongside the rest of your infrastructure.
- Review changes as diffs in pull requests.
- Apply manifests from CI/CD so deployments are automated and auditable.
Namespaces
Some project-scoped resource types live in a namespace. Where a namespace applies, target it with--namespace:
default namespace is supported, and it is assumed when you omit the flag — so most of the time you can leave --namespace off entirely. Which organization or project a command runs against is a separate concern, covered under contexts and scoping; run datumctl ctx to see your active context.
Related
- Changing resources — the
apply,create,edit, anddeletewrite verbs these previews wrap - Reading resources — verify applied state with
datumctl getanddatumctl describe - Discovering resources & schemas — find resource types and inspect their fields before authoring manifests
- Contexts & scoping — control which organization or project a change targets
- Output formats & scripting — machine-readable output, exit codes, and CI patterns