Skip to content

feat: add support for --set-file flag - #319

Merged
manusa merged 1 commit into
manusa:mainfrom
afalhambra-hivemq:feat/set-file
Feb 7, 2026
Merged

feat: add support for --set-file flag#319
manusa merged 1 commit into
manusa:mainfrom
afalhambra-hivemq:feat/set-file

Conversation

@afalhambra-hivemq

@afalhambra-hivemqafalhambra-hivemq commented Dec 1, 2025

Copy link
Copy Markdown
Contributor

Closes#318

Summary

This PR adds support for Helm's --set-file flag to the Java client, allowing users to set chart values by reading contents from files.

Changes

  • Added setFile(String key, Path file) method to InstallCommand, UpgradeCommand, and TemplateCommand
  • Implemented support across all layers:
    • Go native layer (InstallOptions, UpgradeOptions, TemplateOptions with SetFiles field)
    • C bindings (FFI layer with setFiles field)
    • JNA bridge layer (InstallOptions.java, UpgradeOptions.java, TemplateOptions.java)
    • Java API layer (InstallCommand.java, UpgradeCommand.java, TemplateCommand.java)
  • Refactored URL encoding into a generic method using Function<T, String> mapper
  • Added tests for the new functionality

Usage Example

PathconfigFile = Paths.get("/path/to/config.yaml");
PathscriptFile = Paths.get("/path/to/script.sh");
// Install with file valuesHelm.install("my-chart")
.withName("my-release")
.setFile("config", configFile)
.setFile("script", scriptFile)
.call();
// Upgrade with file valuesHelm.upgrade("my-chart")
.withName("my-release")
.setFile("config", configFile)
.call();
// Template with file valuesStringmanifests = Helm.template("my-chart")
.setFile("config", configFile)
.call();

Testing

  • Added tests in HelmInstallTest, HelmTemplateTest, and HelmKubernetesTest
  • All existing tests pass
  • Native libraries rebuilt with updated struct definitions

@afalhambra-hivemq

Copy link
Copy Markdown
ContributorAuthor

@manusa - would be so kind to have a look at this PR. Thanks!

@manusamanusa left a comment

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.

LGTM, thx!

@manusa
manusa merged commit b21ec86 into manusa:mainFeb 7, 2026
3 checks passed
manusa added a commit that referenced this pull request Feb 7, 2026
Follow-up to #319 addressing code review feedback:
- Revert urlEncode to original non-generic signature
- Add toStringValues helper for Map<String, Path> conversion
- Rename setFiles to fileValues to match Helm SDK naming
- Improve setFile JavaDoc to reference --set-file flag
- Add negative test cases for non-existent file paths
- Document setFile in README for install, template, and upgrade
Signed-off-by: Marc Nuri <marc@marcnuri.com>
manusa added a commit that referenced this pull request Feb 7, 2026
Follow-up to #319 addressing code review feedback:
- Revert urlEncode to original non-generic signature
- Add toStringValues helper for Map<String, Path> conversion
- Rename setFiles to fileValues to match Helm SDK naming
- Improve setFile JavaDoc to reference --set-file flag
- Add negative test cases for non-existent file paths
- Document setFile in README for install, template, and upgrade
Signed-off-by: Marc Nuri <marc@marcnuri.com>
Sign up for freeto 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.

Add support for --set-file flag in install, upgrade, and template commands

2 participants

@afalhambra-hivemq@manusa