helmcmd

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package helmcmd contains small helpers for invoking the pinned helm binary.

The main job here is keeping `helmfile sync` working across helm major versions. Helm 4 turned server-side apply on by default; SSA introduces field-ownership conflicts (the apiserver synthesises a "before-first-apply" manager for any field that pre-existed the first SSA call) that helm 4 only takes over when --force-conflicts is passed. Helm 3 used client-side apply, has no SSA and rejects --force-conflicts as an unknown flag, so the flag must only be appended on helm 4+.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MajorVersion

func MajorVersion(helmBinary string) (int, error)

MajorVersion runs `<helmBinary> version --short` and returns the major version integer (3, 4, ...). Returns an error if helm cannot be invoked or the output is unparseable.

func SyncFlagsForVersion

func SyncFlagsForVersion(helmBinary string) []string

SyncFlagsForVersion returns the extra `helmfile sync` flags needed for the detected helm version. On helm 4+ this is --sync-args=--force-conflicts so helm's SSA upgrade can take ownership of fields previously written by other managers (e.g. `kubectl apply`, the `obol model setup` patch on litellm-config.data.config.yaml, or fields recorded under the synthetic "before-first-apply" manager). On helm 3 this returns nil — helm 3 uses client-side apply and rejects --force-conflicts.

Detection failures degrade silently to nil so a missing/old helm binary doesn't block the user; the helmfile sync will still surface the real error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL