Skip to content

Adding copy command to Move the binary to .helm plugin folder - #2

Closed
rajivmucheli wants to merge 1 commit into
databus23:masterfrom
rajivmucheli:master
Closed

rajivmucheli wants to merge 1 commit into
databus23:masterfrom
rajivmucheli:master

Conversation

@rajivmucheli

Copy link
Copy Markdown

Moving the binary to .helm plugin folder is a simple and straight forward step.

As a beginner i did not know, helm diff had to be executed in the respective repo, hence added a common error a new user may under "Troubleshooting section"

Comment thread README.md
curl -L $TARBALL_URL | tar -C $(helm home)/plugins -xzv
```

Post Downloading the desired release, do note you will need to move the binary in the helm plugins folder :

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curl -L $TARBALL_URL | tar -C $(helm home)/plugins -xzv is unpacking the tarsal directly in your helm plugins folder so this could be a little confusing. It should be made clear that this is an alternative (manual) installation method.

@rajivmucheli

Copy link
Copy Markdown
Author

Hi,

I tried this command but not sure why it failed in my case, as the intent is same! i wouldnt resubmit the request.

@lachie83

Copy link
Copy Markdown
Contributor

@rajivmucheli @databus23 It's probably easier just to document using helm plugin manager installation in Helm >2.3.x

@databus23 databus23 closed this in #4 Apr 11, 2017
yxxhero added a commit to eagafonov/helm-diff that referenced this pull request Aug 24, 2026
- Temp files renamed old.yaml/new.yaml so they pair up in tool output.
- Each entry is preceded by a '# Resource:'/'# Change:' header comment:
  ADD/REMOVE/OWNERSHIP semantics are otherwise invisible to the tool.
- Entries whose every changed line was removed by
  --suppress-output-line-regex (MODIFY_SUPPRESSED, or ADD/REMOVE with
  empty diffs) now write an identical placeholder on both sides instead
  of vanishing, which previously produced exit code 2 with an empty diff.
- An unclosed quote in the command is now an error instead of being
  silently dropped.
- Completed the constants refactor (outputFormatDiff) and made the
  unknown-format fallback of setupReportFormat explicit.
- Tests no longer depend on POSIX tools (re-run the test binary as the
  external tool, the os/exec TestHelperProcess pattern), so they no
  longer skip on windows-latest; added coverage for the exit-code-1
  contract, failure reporting, unclosed quotes, end-to-end secret
  redaction and --suppress reaching the tool files, the
  MODIFY_SUPPRESSED path, and the old.yaml/new.yaml basenames.

Addresses review feedback on databus23#1048 (main issues databus23#2/databus23#3 and the minor
points).

Signed-off-by: yxxhero <[email protected]>
yxxhero added a commit that referenced this pull request Aug 27, 2026
* feat: add external diff tool support

Add --diff-tool flag and HELM_DIFF_TOOL env var to render diffs
with an external command.

Manifests are written to two temp files whose paths are appended as
the last two arguments.

Secret redaction and line suppression stay in effect since manifests are
reconstructed from the report entries.

Exit code 1 (differences found) is ignored; other failures report to
stderr without aborting helm-diff.

* refactor(diff): extract output format and change type constants

Replace repeated "structured"/"MODIFY" and related string literals in
diff.go, report.go and structured.go with named constants, resolving the
goconst lint failures. No behavior change.

* fix(diff): let explicit flags win over HELM_DIFF_TOOL

HELM_DIFF_TOOL silently overrode an explicitly passed --output, breaking
e.g. CI scripts parsing --output json stdout on machines where the
variable is exported in a shell profile. ProcessDiffOptions now ignores
the environment variable whenever --output or --diff-tool is explicitly
given (explicit flag > environment > default); an explicitly empty
--diff-tool becomes an opt-out of the external tool.

Addresses review feedback on #1048 (main issue #1).

Signed-off-by: yxxhero <[email protected]>

* fix(diff): address external diff tool review findings

- Temp files renamed old.yaml/new.yaml so they pair up in tool output.
- Each entry is preceded by a '# Resource:'/'# Change:' header comment:
  ADD/REMOVE/OWNERSHIP semantics are otherwise invisible to the tool.
- Entries whose every changed line was removed by
  --suppress-output-line-regex (MODIFY_SUPPRESSED, or ADD/REMOVE with
  empty diffs) now write an identical placeholder on both sides instead
  of vanishing, which previously produced exit code 2 with an empty diff.
- An unclosed quote in the command is now an error instead of being
  silently dropped.
- Completed the constants refactor (outputFormatDiff) and made the
  unknown-format fallback of setupReportFormat explicit.
- Tests no longer depend on POSIX tools (re-run the test binary as the
  external tool, the os/exec TestHelperProcess pattern), so they no
  longer skip on windows-latest; added coverage for the exit-code-1
  contract, failure reporting, unclosed quotes, end-to-end secret
  redaction and --suppress reaching the tool files, the
  MODIFY_SUPPRESSED path, and the old.yaml/new.yaml basenames.

Addresses review feedback on #1048 (main issues #2/#3 and the minor
points).

Signed-off-by: yxxhero <[email protected]>

* docs(diff): document diff tool precedence, blocking requirement and notes

- Explicit --output (or an explicitly empty --diff-tool) now wins over
  HELM_DIFF_TOOL; document the precedence chain.
- Document the # Resource:/# Change: header comments.
- Document that GUI tools returning immediately race with the temp
  directory cleanup and must block (e.g. code --wait --diff).
- Document that fully suppressed entries leave a placeholder, that an
  unclosed quote is an error, and that there is no timeout.

Addresses review feedback on #1048 (main issue #4 and README notes).

Signed-off-by: yxxhero <[email protected]>

* polish(diff): follow-up review fixes

- Centralize diff tool command resolution in
  Options.configuredDiffToolCommand(): DiffTool() and the printer both
  derived the effective command independently (three TrimSpace/env
  reads across two functions), leaving the setup/print agreement an
  implicit invariant. Refreshed the stale DiffTool doc comment.
- README: list MODIFY_SUPPRESSED among the # Change: header values.
- writeDiffToolSides: the empty-diffs comment now also covers
  ADD/REMOVE/OWNERSHIP entries, which doSuppress does not rewrite.
- Tests: drop a meaningless NotPanics(empty func) assertion and a
  trivially-true Empty assertion; document the pipe-capacity
  constraint of captureStderr.

Signed-off-by: yxxhero <[email protected]>

* fix(diff): resolve the diff tool command once, at report time

- The printer re-resolved the command via the environment at print
  time, so a Report printed later (ManifestReport defers rendering)
  depended on the process environment of that moment, and the
  setup/print agreement documented on configuredDiffToolCommand was
  not structural after all. The Report now carries the command
  resolved once in generateReport; printing never reads the env.
  New test locks the property in (generates under HELM_DIFF_TOOL,
  prints with it unset).
- README precedence paragraph contradicted itself ('either one
  overrides --output' vs 'an explicit --output wins'); rewritten as a
  single --diff-tool > HELM_DIFF_TOOL > --output ordering statement.
- Test helper: %q-quoted Windows paths were corrupted by the command
  tokenizer (%q escapes backslashes, the tokenizer strips quotes
  without unescaping), which would have failed the now-unskipped
  Windows CI leg. Use forward slashes (accepted everywhere, need no
  escaping) and add a round-trip regression test for the path.

The tokenizer hazard was verified mechanically before the fix.

Signed-off-by: yxxhero <[email protected]>

* test(cmd): merge duplicate --diff-tool '' precedence tests

The last two subtests of TestProcessDiffOptionsDiffTool exercised the
same f.Changed("diff-tool") branch with identical assertions; fold
them into one and also assert the built-in renderer is selected.

Signed-off-by: yxxhero <[email protected]>

---------

Signed-off-by: yxxhero <[email protected]>
Co-authored-by: yxxhero <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants