Skip to content

crane apply: banner, phased steps, and summary #272

Description

@stillalearner

Title

feat(apply): phased banner and summary aligned with kubectl kustomize apply path

Proposed Target Output (example)

A) Default — final stage only (illustrative):

$ crane apply -t ./transform -o ./output

crane apply
transform-dir: /path/transform
output-dir:    /path/output
mode:          final stage only → 30_LastPlugin  (example name)

[1/3] kubectl kustomize (stage 30_LastPlugin) … ok
[2/3] Writing bundle … /path/output/output.yaml
[3/3] Splitting multi-doc YAML into resource files … 42 resources

Summary
-------
output:          /path/output/output.yaml
resources dir:   /path/output/resources/  (per-namespace + _cluster as needed)
resources written: 42
duration:        48s
Done.

B) Multi-stage — e.g. --stages or --from-stage / --to-stage (illustrative; wording should match code):

$ crane apply -t ./transform -o ./output --stages 10_Foo,20_Bar

crane apply
transform-dir: /path/transform
output-dir:    /path/output
mode:          multi-stage (2 stage(s))

--- stage 10_Foo ---
[1/2] kubectl kustomize … ok
[2/2] Writing … /path/output/10_Foo.yaml

--- stage 20_Bar ---
[1/2] kubectl kustomize … ok
[2/2] Writing … /path/output/20_Bar.yaml

Summary
-------
stage bundles:   10_Foo.yaml, 20_Bar.yaml
duration:        1m 02s
Done.

Description

Context

crane apply is very quiet on success; users think the process froze. The implementation always runs kubectl kustomize on one or more stage directories under transform-dir, then writes YAML output (and for the default final-stage path, splits multi-doc YAML into per-resource files). It does not iterate merge operations per export file like crane transform. Approach here: opening banner, phased steps that match that pipeline (kustomize → write → split when applicable), and a closing Summary with paths, resource/document counts, and duration—for both default and multi-stage entry points.

User outcome

  • Clear phases so the run does not look hung.
  • Summary lists output location(s), approximate resource count (e.g. documents written in split step), and duration.

Scope

Acceptance criteria

  • Banner: transform-dir, output-dir, stage selection (final vs multi-stage) as applicable.
  • Phase lines for: kustomize build (and per stage if multi-stage), write consolidated output, split to per-resource files if applicable.
  • Summary: key output paths, resource/file count, duration.
  • Default verbosity: no per-document Info spam; details in --debug where appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions