You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: update documentation for latest CLI changes and review feedback
Update all doc files to reflect 35 commits merged to main since the
original PR: --stage flag replaced with positional arguments, --overwrite
added to export/apply/validate, transform default behavior changed to
create stages for all plugins, --skip-plugins and --instructions-file
flags added, --api-resources mutual exclusion expanded, and
--plugin-priorities/--stage-name/--plugin-name flags removed.
Address reviewer feedback: use verb-first commit/PR titles instead of
conventional commit prefixes (aufi), add community plugin maintenance
note (aufi), fix conditional Required status for transfer-pvc nginx
flags (CodeRabbit), add defensive JSONPatch parent-object checks in
plugin examples (CodeRabbit), add nil check for GetAnnotations
(CodeRabbit), and resolve apply stage-specific flag contradiction
(CodeRabbit).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/commands/apply.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Apply transformations to exported resources and produce final manifests.
5
5
## Synopsis
6
6
7
7
```bash
8
-
crane apply [flags]
8
+
crane apply [stage...] [flags]
9
9
```
10
10
11
11
## Description
@@ -21,9 +21,11 @@ Kustomize is embedded directly in the Crane binary (via the krusty API), so no e
21
21
|`--export-dir`|`-e`|`export`| The path where exported resources are saved (kept for consistency; not used by apply) |
22
22
|`--transform-dir`|`-t`|`transform`| The path where transform stage directories are located |
23
23
|`--output-dir`|`-o`|`output`| The path where final manifests are written |
24
-
|`--stage`||| Apply a specific stage only (e.g., `10_KubernetesPlugin`). If not specified, all stages are applied |
25
24
|`--kustomize-args`||| Additional arguments for kustomize (e.g., `--enable-helm --helm-command=helm3`) |
26
25
|`--skip-cluster-scoped`||`false`| Exclude cluster-scoped resources (ClusterRole, ClusterRoleBinding, CRD, etc.) from output. Useful for non-admin migration scenarios |
26
+
|`--overwrite`||`false`| Overwrite the output directory if it already exists |
27
+
28
+
Stages are specified as positional arguments (e.g., `crane apply 10_KubernetesPlugin`). Stages can be specified by directory name or plugin name. If no stages are specified, all discovered stages are applied sequentially.
|`extras requires specifying a user or group`|`--as-extras` used without `--as`| Add `--as` or `--as-group` flag |
107
+
|`export directory "X" already exists`| Export directory from a previous run | Use `--overwrite` to replace it |
108
+
| Non-zero exit with aggregated error | All namespace list calls returned Forbidden | Ensure service account has list permissions on at least one namespace |
Shell autocompletion is available for plugin and stage names.
156
+
146
157
### Applying Transforms
147
158
148
159
```bash
@@ -176,7 +187,9 @@ output/
176
187
177
188
## Automatic Stage Creation
178
189
179
-
Crane automatically creates new stages when you reference them with `--stage`. The stage name determines whether a plugin will be used or if it's a pass-through stage for manual editing.
190
+
When no stages exist in the transform directory, `crane transform` automatically creates stages for **all available plugins** (not just KubernetesPlugin). Plugins are sorted alphabetically and assigned priorities starting at 10, incrementing by 5. Use `--skip-plugins` to exclude specific plugins from this default behavior.
191
+
192
+
You can also create new stages by specifying them as positional arguments. The stage name determines whether a plugin will be used or if it's a pass-through stage for manual editing.
180
193
181
194
### Stage Naming Convention
182
195
@@ -198,7 +211,7 @@ Stage names ending with `Plugin` **must** have a corresponding plugin installed.
Copy file name to clipboardExpand all lines: docs/commands/validate.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Incompatible resources are written to a `failures/` directory under the validate
18
18
19
19
### Offline Validation
20
20
21
-
Use `--api-resources` to validate offline against a captured API surface JSON file (produced by `scripts/capture-api-surface.sh`) when the target cluster is not directly reachable. This is mutually exclusive with `--context`/`--kubeconfig`.
21
+
Use `--api-resources` to validate offline against a captured API surface JSON file (produced by `scripts/capture-api-surface.sh`) when the target cluster is not directly reachable. This is mutually exclusive with `--context`, `--kubeconfig`, `--server`, `--token`, `--cluster`, and `--user`.
22
22
23
23
## Flags
24
24
@@ -27,7 +27,8 @@ Use `--api-resources` to validate offline against a captured API surface JSON fi
27
27
|`--input-dir`|`-i`|`output`| Path to the apply output directory containing final manifests |
28
28
|`--validate-dir`||`validate`| Path where validation results and failures are saved |
29
29
|`--output`|`-o`|`json`| Report file format: `json` or `yaml`|
30
-
|`--api-resources`||| Path to API surface JSON file for offline validation (mutually exclusive with `--context`/`--kubeconfig`) |
30
+
|`--api-resources`||| Path to API surface JSON file for offline validation (mutually exclusive with `--context`/`--kubeconfig`/`--server`/`--token`/`--cluster`/`--user`) |
31
+
|`--overwrite`||`false`| Overwrite the validate directory if it already exists |
31
32
32
33
Standard kubeconfig flags (`--kubeconfig`, `--context`, `--cluster`, etc.) are also available to specify the target cluster for live validation.
|`input-dir "X" is not a directory`| Path doesn't exist or isn't a directory | Run `crane apply` first to generate output |
96
97
|`loading kubeconfig`| Cannot connect to target cluster | Check kubeconfig and `--context` flag, or use `--api-resources` for offline mode |
97
-
|`--api-resources and --context are mutually exclusive`| Both offline and live flags specified | Use one mode or the other |
98
+
|`--api-resources and --context are mutually exclusive`| Both offline and live flags specified | Use one mode or the other. `--api-resources` is also mutually exclusive with `--kubeconfig`, `--server`, `--token`, `--cluster`, and `--user`|
99
+
|`validate directory "X" already exists`| Validate directory from a previous run | Use `--overwrite` to replace it |
98
100
| Validation failures | GVKs not available on target cluster | Install required CRDs/operators on target, or transform manifests to use supported API versions |
0 commit comments