{{ message }}
Repository navigation
Tags: helmfile/chartify
Tags
Bump Go to 1.27.2 and add modernize lint to CI (#218) - Bump go directive from 1.26.0 to 1.27.2 (latest stable); CI picks it up via go-version-file - Bump golangci-lint from v2.7.1 to v2.15.0 in lint workflow - Enable the modernize linter to catch outdated Go idioms, and fix all reported findings: - interface{} -> any (30 occurrences) - mergeEnv: hand-written loop -> maps.Copy - strings.Split -> strings.SplitSeq where only iterated - Exclude goconst in _test.go files (stricter counting in newer golangci-lint flags duplicated test literals only) Verified locally: go build, go vet, gofmt, and golangci-lint v2.15.0 all pass with 0 issues. Signed-off-by: yxxhero <aiopsclub@163.com>
Bump Helm to v4.3.0 and v3.22.0 (#213) * Bump Helm to v4.3.0 and v3.22.0 Signed-off-by: yxxhero <aiopsclub@163.com> * Update kube_version_and_api_versions snapshots for Helm v4.3.0/v3.22.0 Helm v4.3.0 and v3.22.0 (built on k8s.io 0.37) changed the default Capabilities.APIVersions list for --kube-version v1.23.0: - add lifecycle.k8s.io/v1alpha1 - add storagemigration.k8s.io/v1 - scheduling.k8s.io/v1alpha2 -> v1alpha3 Regenerated via: HELM_BIN=<helm v4.3.0> SAVE_SNAPSHOT=1 go test -run 'TestIntegration/kube_version_and_api_versions' . HELM_BIN=<helm v3.22.0> SAVE_SNAPSHOT=1 go test -run 'TestIntegration/kube_version_and_api_versions' . Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com>
Fix crash on empty helm render: treat no-output chart as no-op (#207) * Initial plan * Fix empty render crash: treat no-output helm template as no-op When helm template --output-dir produces an empty directory (e.g. all templates are gated behind a falsy conditional), ReplaceWithRendered now removes the chart's content dirs and returns successfully with an empty file list instead of crashing with an assertion error. Adds test chart testdata/charts/emptychart and integration test 'empty render no op' to cover this scenario. Closes #206 * Complete the empty-render fix: clean deps, skip kustomize, harden tests Addresses the gaps identified in review of the empty-render fix (#206): 1. replace.go: the empty-render branch no longer early-returns. It removes the content dirs and temp output, then falls through so the Chart.yaml `dependencies` field and Chart.lock/requirements.lock cleanup still run. Without this, an empty-rendering chart that declares dependencies would leave Chart.yaml referencing subcharts whose charts/ dir was removed, causing a downstream "found in Chart.yaml, but missing in charts/ directory" error. Also fixes %v -> %w wrapping and adds path context. 2. chartify.go: skip the kustomize Patch step when no resources were rendered (`len(generatedManifestFiles) == 0`). Previously an empty render combined with JsonPatches/StrategicMergePatches/Transformers fed kustomize an empty resource list plus patches, failing with "no resource matches strategic merge patch ...". An empty render is now a no-op success even when patches are configured (there is simply nothing to patch). Tests: - TestEmptyRenderCleansChartDependencies: verifies a chart that declares a dependency and renders nothing still produces a chartifiable output whose Chart.yaml has no dependencies and templates empty. Proven to fail without fix #1. - integration "empty render with patch": exercises the StrategicMergePatches path on the empty chart; proven to fail without fix #2. - testdata/chart_patch/configmap.emptychart.strategic.yaml + empty snapshot. Signed-off-by: yxxhero <aiopsclub@163.com> * Address review: use unversioned `go test` in example commands The SAVE_SNAPSHOT example comments used `go1.25 test`, but this repo's go.mod requires Go 1.26.0+, so `go1.25 test` would fail. Switch to the unversioned `go test` (reviewer's preferred form) on the two empty-render test cases flagged in review. Signed-off-by: yxxhero <aiopsclub@163.com> --------- Signed-off-by: yxxhero <aiopsclub@163.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yxxhero <aiopsclub@163.com>
build(deps): bump github.com/containerd/containerd from 1.7.32 to 1.7… ….33 (#200) Bumps [github.com/containerd/containerd](https://github.com/containerd/containerd) from 1.7.32 to 1.7.33. - [Release notes](https://github.com/containerd/containerd/releases) - [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md) - [Commits](containerd/containerd@v1.7.32...v1.7.33) --- updated-dependencies: - dependency-name: github.com/containerd/containerd dependency-version: 1.7.33 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Prefer `helm dependency build` over `dependency up` when Chart.lock e… …xists (#185) * Prefer `helm dependency build` over `dependency up` when Chart.lock exists When chartify is engaged (e.g. helmfile invokes it for releases that use jsonPatches, strategic-merge patches, or kustomize), it copies the chart to a temp directory and runs `helm dependency up` to flatten dependencies before rendering. `dep up` re-resolves from Chart.yaml's version constraints and rewrites Chart.lock, which silently pulls newer dependency versions whenever constraints permit (e.g. `version: "*"`). This diverges from helmfile's non-chartify code path (pkg/helmexec/exec.go `BuildDeps`), which calls `helm dependency build` and honors the lock. The asymmetry means an unrelated change like adding a `jsonPatches` block to a release can flip a chart from locked-version rendering to "latest matching constraint" rendering, producing surprising image/version drift. Behavior change: - If `Chart.lock` (or legacy `requirements.lock`) exists and no adhoc chart dependencies were injected, run `helm dependency build`. This resolves dependencies from the lock and matches the rest of the helmfile pipeline. - If `dependency build` fails (typically because the lock is out of sync with Chart.yaml), fall back to `dependency up` and log the fallback. This preserves the previous escape hatch for charts whose lock has drifted. - If no lock file exists, or adhoc dependencies are present, behavior is unchanged — still `dependency up`. Adds a unit test for the lock-file detection helper. Signed-off-by: Shane Starcher <shane.starcher@gmail.com> * Address Copilot review: check deprecated deps, restrict fallback, add tests - Also check DeprecatedAdhocChartDependencies (-d flag) when deciding whether to use `helm dependency build`, preventing a guaranteed-failing build attempt followed by fallback. - Restrict the fallback from `build` to `up` to only the lock-out-of-sync error. Other failures (network, auth, missing artifacts) now surface to the caller instead of silently re-resolving dependencies. - Add TestDepCommandSelection covering all code paths: build with lock, up without lock, up with adhoc deps (both styles), fallback on sync error, no fallback on other errors, and requirements.lock support. - Add TestIsLockOutOfSyncErr for the new error classifier. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Shane Starcher <dev.Starcher.Shane@dev.bwater.com> * Trim verbose comment block, remove dead code, document Helm version strings - Condense the 12-line inline rationale to 3 lines (PR description has the full context) - Remove leftover `_ = calls` in TestDepCommandSelection - Add version provenance comment to isLockOutOfSyncErr Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Shane Starcher <dev.Starcher.Shane@dev.bwater.com> --------- Signed-off-by: Shane Starcher <shane.starcher@gmail.com> Signed-off-by: Shane Starcher <dev.Starcher.Shane@dev.bwater.com> Co-authored-by: Shane Starcher <shane.starcher@gmail.com> Co-authored-by: Shane Starcher <dev.Starcher.Shane@dev.bwater.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
build(deps): bump google.golang.org/grpc from 1.78.0 to 1.79.3 (#183) Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.78.0 to 1.79.3. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](grpc/grpc-go@v1.78.0...v1.79.3) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.79.3 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PreviousNext
