Skip to content

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

Description

@afalhambra-hivemq

Summary

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

Motivation

The native Helm CLI supports the --set-file flag for install, upgrade, and template commands. This flag is useful when:

  • Chart values are too lengthy for command-line entry
  • Values are dynamically generated and stored in files
  • You need to pass file contents (like configuration files, scripts, or certificates) as chart values

Currently, the Helm Java client does not expose this functionality.

Proposed Changes

Add setFile(String key, Path file) method to:

  • InstallCommand
  • UpgradeCommand
  • TemplateCommand

Usage Example

// Install with file-based valuesPathconfigFile = Paths.get("/path/to/config.txt");
Helm.install("my-chart")
.withName("my-release")
.setFile("configData", configFile)
.call();
// Upgrade with file-based valuesHelm.upgrade("my-chart")
.withName("my-release")
.setFile("script", Paths.get("/path/to/script.sh"))
.call();
// Template with file-based valuesStringmanifests = Helm.template("my-chart")
.setFile("certificate", Paths.get("/path/to/cert.pem"))
.call();

Implementation

Implementation requires changes across all layers:

  • Go native layer (InstallOptions, UpgradeOptions, TemplateOptions)
  • C bindings (FFI layer)
  • JNA bridge layer
  • Java API layer

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions