Skip to content

init --update without --preset: redundant double-message error #179

@lexfrei

Description

@lexfrei

Problem

talm init --update in a project without an explicit --preset flag AND without a preset dependency in Chart.yaml emits a doubly-wrapped error message:

preset is required: use --preset flag or ensure Chart.yaml has a preset dependency: preset not found in Chart.yaml dependencies

The string preset is required essentially says the same thing as preset not found in Chart.yaml dependencies. The duplication makes the error harder to read.

Reproduction

mkdir /tmp/talm-update-test && cd /tmp/talm-update-test
talm init --preset cozystack --name test --endpoints https://192.0.2.1:6443
# Remove the preset dependency from Chart.yaml so `--update` can't pick it up
sed -i 's|- name: cozystack|# - name: cozystack|' Chart.yaml
talm init --update

Output:

preset is required: use --preset flag or ensure Chart.yaml has a preset dependency: preset not found in Chart.yaml dependencies
hint: add a preset chart (e.g. cozystack) to Chart.yaml's dependencies, or pass --preset on the command line

Origin:

  • Inner error at pkg/commands/init.go:768: "preset not found in Chart.yaml dependencies" (already with hint).
  • Outer wrap at pkg/commands/init.go:1094: errors.Wrap(err, "preset is required: use --preset flag or ensure Chart.yaml has a preset dependency").

The outer wrap layers another full sentence on top of the inner error, producing the colon-separated double.

Expected

Either:

  1. Drop the outer wrap entirely (inner error + hint already communicate the same).
  2. Replace the outer wrap with a single-word context tag, e.g. errors.Wrap(err, "init --update").

Option 1 is cleaner and one-line.

Why this matters

The redundant double-statement is a small UX smell, but it's the operator's first impression after a fresh init --update failure. Cleaning it up takes one line.

Surfaced during the dev17 manual test plan exercise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)area/initIssues or PRs related to talm init (project bootstrap, encrypt/decrypt, --update flow)good first issueGood for newcomerskind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debtpriority/backlogGeneral backlog priority. Lower than priority/important-longtermtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions