You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
helm pull downloads a chart from a repository (HTTP or OCI) to the local filesystem, optionally untarring it. Common uses: offline installs, chart inspection, customization, CI caching. See helm pull docs.
Follow AGENTS.md → "Adding a new Helm command".
Reference impl: ShowCommand + show.go — same shape (chart-keyed, repo + TLS options, uses the shared newRegistryClient helper for OCI).
Go (native/internal/helm/pull.go)
Build config with NewCfg(&CfgOptions{...}) — do not construct action.Configuration{} directly. Every other command in the codebase goes through NewCfg; staying consistent is required for kubeconfig / settings handling.
Build a registry.Client via the existing newRegistryClient(...) helper in registry.go:94.
client.Run(chart) returns (string, error) — the string is helm's CLI output (typically empty for pull). Compute the resulting file/directory path from DestDir + chart filename + version and return it as the first string returned by your helm.Pull(...) function so the Java side can parse it back to Path.
CGO bridge (native/main.go)
Add struct PullOptions { ... } alongside other option structs.
Add //export Pull wrapping helm.Pull(...) via runCommand(func() (string, error) { ... }). There is no result(...) helper — every other export uses runCommand.
JNA + Java
lib/api/.../PullOptions.java: mirror the C struct field order (@Structure.FieldOrder).
Add Result Pull(PullOptions options) to HelmLib.
helm-java/.../PullCommand.java extends HelmCommand<Path>. call() runs the command and returns Paths.get(result.out.trim()).
Add Helm.pull(String chart) static factory. Use HelmLibHolder.INSTANCE directly — it is the HelmLib instance, there is no .helmLib() method.
Background
helm pulldownloads a chart from a repository (HTTP or OCI) to the local filesystem, optionally untarring it. Common uses: offline installs, chart inspection, customization, CI caching. See helm pull docs.Helm SDK action:
action.NewPullWithOpts(upstream).Acceptance criteria
Helm.pull("repo/chart").call()downloads to current directory and returns the resulting filePath.withDestination(Path),.untar(),.withUntarDir(String),.withVersion(String).withRepo(String),.withUsername(String),.withPassword(String),.passCredentials(),.withRepositoryConfig(Path),.withRepositoryCache(Path).withCertFile(Path),.withKeyFile(Path),.withCaFile(Path),.insecureSkipTlsVerify(),.plainHttp().verify(),.withKeyring(Path).devel().debug()oci://...chart referencesProposed Java API
Implementation guide
Follow AGENTS.md → "Adding a new Helm command".
Reference impl:
ShowCommand+show.go— same shape (chart-keyed, repo + TLS options, uses the sharednewRegistryClienthelper for OCI).Go (
native/internal/helm/pull.go)NewCfg(&CfgOptions{...})— do not constructaction.Configuration{}directly. Every other command in the codebase goes throughNewCfg; staying consistent is required for kubeconfig / settings handling.registry.Clientvia the existingnewRegistryClient(...)helper inregistry.go:94.client := action.NewPullWithOpts(action.WithConfig(cfg)), then setSettings,RepoURL,Version,Username,Password,CertFile,KeyFile,CaFile,InsecureSkipTLSverify,PlainHTTP,Verify,Keyring,Devel,DestDir,Untar,UntarDir,PassCredentialsAll.client.Run(chart)returns(string, error)— the string is helm's CLI output (typically empty for pull). Compute the resulting file/directory path fromDestDir+ chart filename + version and return it as the first string returned by yourhelm.Pull(...)function so the Java side can parse it back toPath.CGO bridge (
native/main.go)struct PullOptions { ... }alongside other option structs.//export Pullwrappinghelm.Pull(...)viarunCommand(func() (string, error) { ... }). There is noresult(...)helper — every other export usesrunCommand.JNA + Java
lib/api/.../PullOptions.java: mirror the C struct field order (@Structure.FieldOrder).Result Pull(PullOptions options)toHelmLib.helm-java/.../PullCommand.javaextendsHelmCommand<Path>.call()runs the command and returnsPaths.get(result.out.trim()).Helm.pull(String chart)static factory. UseHelmLibHolder.INSTANCEdirectly — it is theHelmLibinstance, there is no.helmLib()method.Tests
helm-java/src/test/java/com/marcnuri/helm/HelmPullTest.java.HelmTestServerTestfor the pattern:RepoOciServerStartsimilarly.fromRepo,withVersion,withDestination(asserts file exists at expected path),withUntar(asserts directory contents),withRepoUrl,fromOciRegistrynonExistentChart,nonExistentVersionContributor checklist
make license)@authorJavadoc taggit commit -s)make build-native && ./mvnw test -pl helm-java -Dtest=HelmPullTestgreenReferences
ShowCommand.java+native/internal/helm/show.goHelmTestServerTest.java