Skip to content

Conversation

@afalhambra-hivemq
Copy link

@afalhambra-hivemq afalhambra-hivemq commented Dec 1, 2025

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

Path configFile = Paths.get("/path/to/config.yaml");
Path scriptFile = Paths.get("/path/to/script.sh");

// Install with file values
Helm.install("my-chart")
  .withName("my-release")
  .setFile("config", configFile)
  .setFile("script", scriptFile)
  .call();

// Upgrade with file values
Helm.upgrade("my-chart")
  .withName("my-release")
  .setFile("config", configFile)
  .call();

// Template with file values
String manifests = 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

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.

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

1 participant