Skip to content

Commit a62b7c7

Browse files
committed
Init
0 parents  commit a62b7c7

27 files changed

Lines changed: 1106 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
6+
jobs:
7+
check-version:
8+
runs-on: ubuntu-latest
9+
outputs:
10+
tag_exists: ${{ steps.check.outputs.tag_exists }}
11+
version: ${{ steps.check.outputs.version }}
12+
steps:
13+
- uses: actions/checkout@v6
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Extract and Check
18+
id: check
19+
run: |
20+
VERSION=$(yq '.version' plugin.yaml)
21+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
22+
23+
if git rev-parse "v${VERSION}" >/dev/null 2>&1; then
24+
echo Tag v${VERSION} already exists, skipping release.
25+
echo "tag_exists=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "tag_exists=false" >> $GITHUB_OUTPUT
28+
fi
29+
30+
create-release:
31+
needs: check-version
32+
if: needs.check-version.outputs.tag_exists == 'false'
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v6
36+
37+
- name: Setup Helm
38+
uses: azure/setup-helm@v4
39+
40+
- name: Setup Go
41+
uses: actions/setup-go@v6
42+
with:
43+
go-version-file: 'go.mod'
44+
45+
# TODO: Signing
46+
# - name: Import GPG key
47+
# run: gpg --import <(echo "${PRIVATE_SIGNING_KEY}")
48+
# env:
49+
# PRIVATE_SIGNING_KEY: ${{ secrets.PRIVATE_SIGNING_KEY }}
50+
51+
- name: Package
52+
run: make package
53+
# TODO: Signing
54+
# env:
55+
# HOTPATCH_SIGNING_KEY_EMAIL: ${{ vars.SIGNING_KEY_EMAIL }}
56+
57+
- name: Release
58+
# TODO: Signing
59+
# run: gh release create "v${VERSION}" hotpatch-*.tgz hotpatch-*.tgz.prov --generate-notes
60+
run: gh release create "v${VERSION}" hotpatch-*.tgz --generate-notes
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
VERSION: ${{ needs.check-version.outputs.version }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
hotpatch
2+
hotpatch-*.tgz
3+
package/

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: build clean install package test test-integration uninstall
2+
3+
HOTPATCH_VERSION=$$(yq .version plugin.yaml)
4+
HOTPATCH_PACKAGE=hotpatch-$(HOTPATCH_VERSION).tgz
5+
HOTPATCH_BUILD_OUTPUT=hotpatch
6+
7+
build:
8+
@go build -o $(HOTPATCH_BUILD_OUTPUT) ./cmd/hotpatch
9+
10+
clean:
11+
@rm -rf $(HOTPATCH_BUILD_OUTPUT) ./package $(HOTPATCH_PACKAGE)
12+
13+
package: build
14+
@mkdir -p ./package
15+
@cp ./hotpatch ./package/
16+
@cp ./plugin.yaml ./package/
17+
@helm plugin package ./package --sign=false
18+
# TODO: Signing
19+
# @helm plugin package ./package --sign --key "${HOTPATCH_SIGNING_KEY_EMAIL}"
20+
21+
install: package
22+
@helm plugin install $(HOTPATCH_PACKAGE)
23+
24+
uninstall:
25+
@helm plugin uninstall hotpatch
26+
27+
test-flags=$(if $(TEST_FLAGS),$(TEST_FLAGS))
28+
29+
test:
30+
@go test ./... $(test-flags)
31+
32+
test-integration:
33+
@go test ./integration $(test-flags) -tags integration

cmd/hotpatch/main.go

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"errors"
6+
"flag"
7+
"fmt"
8+
"io"
9+
"log/slog"
10+
"os"
11+
12+
"github.com/elastisys/helm-hotpatch/internal/yamlpatcher"
13+
)
14+
15+
var rootPath string
16+
17+
func init() {
18+
flag.StringVar(&rootPath, "path", "./patches", "path to patches directory")
19+
20+
if val, ok := os.LookupEnv("HELM_HOTPATCH_PATH"); ok {
21+
rootPath = val
22+
}
23+
}
24+
25+
func run(ctx context.Context) error {
26+
// If the patch directory is not found, just pipe.
27+
if _, err := os.Stat(rootPath); errors.Is(err, os.ErrNotExist) {
28+
slog.DebugContext(ctx, "patches directory not found", slog.String("path", rootPath), slog.String("error", err.Error()))
29+
30+
if _, err := io.Copy(os.Stdout, os.Stdin); err != nil {
31+
return fmt.Errorf("copying stdin to stdout: %w", err)
32+
}
33+
return nil
34+
}
35+
36+
patches, err := yamlpatcher.LoadPatchesFromDir(ctx, rootPath)
37+
if err != nil {
38+
return fmt.Errorf("load patches: %w", err)
39+
}
40+
41+
yp := yamlpatcher.NewYAMLPatcher(patches)
42+
43+
if err := yp.Run(ctx, os.Stdin, os.Stdout); err != nil {
44+
return fmt.Errorf("process: %w", err)
45+
}
46+
47+
return nil
48+
}
49+
50+
func main() {
51+
flag.Parse()
52+
53+
slog.SetLogLoggerLevel(slog.LevelDebug)
54+
55+
if err := run(context.Background()); err != nil {
56+
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
57+
os.Exit(1)
58+
}
59+
}

go.mod

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module github.com/elastisys/helm-hotpatch
2+
3+
go 1.25.5
4+
5+
require (
6+
github.com/stretchr/testify v1.11.1
7+
k8s.io/apimachinery v0.35.0
8+
)
9+
10+
require (
11+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
12+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
13+
github.com/go-logr/logr v1.4.3 // indirect
14+
github.com/json-iterator/go v1.1.12 // indirect
15+
github.com/kr/pretty v0.3.1 // indirect
16+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
17+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
18+
github.com/pmezard/go-difflib v1.0.0 // indirect
19+
github.com/x448/float16 v0.8.4 // indirect
20+
go.yaml.in/yaml/v2 v2.4.3 // indirect
21+
golang.org/x/net v0.47.0 // indirect
22+
golang.org/x/text v0.31.0 // indirect
23+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
24+
gopkg.in/inf.v0 v0.9.1 // indirect
25+
gopkg.in/yaml.v3 v3.0.1 // indirect
26+
k8s.io/klog/v2 v2.130.1 // indirect
27+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
28+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
29+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
30+
sigs.k8s.io/randfill v1.0.0 // indirect
31+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
32+
sigs.k8s.io/yaml v1.6.0 // indirect
33+
)

go.sum

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
2+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
5+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6+
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
7+
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
8+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
9+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
10+
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
11+
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
12+
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
13+
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
14+
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
15+
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
16+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
17+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
18+
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
19+
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
20+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
21+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
22+
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
23+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
24+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
25+
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
26+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8=
27+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
28+
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
29+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
30+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
31+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
32+
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
33+
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
34+
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
35+
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
36+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
37+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
38+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
39+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
40+
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
41+
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
42+
go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0=
43+
go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8=
44+
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
45+
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
46+
golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY=
47+
golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU=
48+
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
49+
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
50+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
51+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
52+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
53+
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
54+
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
55+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
56+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
57+
k8s.io/apimachinery v0.35.0 h1:Z2L3IHvPVv/MJ7xRxHEtk6GoJElaAqDCCU0S6ncYok8=
58+
k8s.io/apimachinery v0.35.0/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns=
59+
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
60+
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
61+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZcmKS3g6CthxToOb37KgwE=
62+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ=
63+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
64+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
65+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
66+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730/go.mod h1:mdzfpAEoE6DHQEN0uh9ZbOCuHbLK5wOm7dK4ctXE9Tg=
67+
sigs.k8s.io/randfill v1.0.0 h1:JfjMILfT8A6RbawdsK2JXGBR5AQVfd+9TbzrlneTyrU=
68+
sigs.k8s.io/randfill v1.0.0/go.mod h1:XeLlZ/jmk4i1HRopwe7/aU3H5n1zNUcX6TM94b3QxOY=
69+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 h1:jTijUJbW353oVOd9oTlifJqOGEkUw2jB/fXCbTiQEco=
70+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE=
71+
sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs=
72+
sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4=

integration/integration_test.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
//go:build integration
2+
3+
package tests
4+
5+
import (
6+
"context"
7+
"os"
8+
"os/exec"
9+
"path/filepath"
10+
"testing"
11+
12+
"github.com/stretchr/testify/assert"
13+
"github.com/stretchr/testify/require"
14+
)
15+
16+
const (
17+
testdataPath = "./testdata"
18+
)
19+
20+
var (
21+
chartPath = filepath.Join(testdataPath, "chart")
22+
patchesPath = filepath.Join(testdataPath, "patches")
23+
)
24+
25+
func TestIntegration(t *testing.T) {
26+
helmDataDir, err := os.MkdirTemp(os.TempDir(), "helm-hotpatch-data-dir-******")
27+
require.NoError(t, err)
28+
29+
t.Cleanup(func() {
30+
if err := os.RemoveAll(helmDataDir); err != nil {
31+
t.Logf("error removing temporary Helm data directory: %s", err)
32+
}
33+
34+
runMake(t, context.Background(), "clean")
35+
})
36+
37+
helmPluginsDir := filepath.Join(helmDataDir, "plugins")
38+
require.NoError(t, os.Mkdir(helmPluginsDir, 0o755))
39+
// The local installer / dev mode (used when installing from directory) doesn't care about HELM_PLUGINS:
40+
// https://github.com/helm/helm/blob/4a91f3ad5cc0c1521f6d4dcb5681e2da4baaa157/internal/plugin/installer/local_installer.go#L179
41+
// The person that fixes it upstream gets a cookie! :)
42+
os.Setenv("HELM_DATA_HOME", helmDataDir)
43+
os.Setenv("HELM_PLUGINS", helmPluginsDir)
44+
45+
runMake(t, t.Context(), "install")
46+
47+
expected, err := os.ReadFile("./testdata/expected.yaml")
48+
require.NoError(t, err)
49+
50+
t.Run("flag", func(t *testing.T) {
51+
cmd := exec.CommandContext(
52+
t.Context(),
53+
"helm",
54+
"template",
55+
"--post-renderer",
56+
"hotpatch",
57+
"--post-renderer-args",
58+
"-path",
59+
"--post-renderer-args",
60+
patchesPath,
61+
chartPath,
62+
)
63+
out, err := cmd.CombinedOutput()
64+
require.NoError(t, err, string(out))
65+
assert.Equal(t, string(expected), string(out))
66+
})
67+
68+
t.Run("env", func(t *testing.T) {
69+
cmd := exec.CommandContext(
70+
t.Context(),
71+
"helm",
72+
"template",
73+
"--post-renderer",
74+
"hotpatch",
75+
chartPath,
76+
)
77+
cmd.Env = append(os.Environ(), "HELM_HOTPATCH_PATH="+patchesPath)
78+
out, err := cmd.CombinedOutput()
79+
require.NoError(t, err, string(out))
80+
assert.Equal(t, string(expected), string(out))
81+
})
82+
83+
t.Run("missing-patches-dir", func(t *testing.T) {
84+
withoutPostRendering := exec.CommandContext(
85+
t.Context(),
86+
"helm",
87+
"template",
88+
chartPath,
89+
)
90+
91+
withPostRendering := exec.CommandContext(
92+
t.Context(),
93+
"helm",
94+
"template",
95+
"--post-renderer",
96+
"hotpatch",
97+
chartPath,
98+
)
99+
withPostRendering.Env = append(os.Environ(), "HELM_HOTPATCH_PATH=./testdata/doesnotexist")
100+
101+
outWithoutPostRendering, err := withoutPostRendering.CombinedOutput()
102+
require.NoError(t, err, string(outWithoutPostRendering))
103+
104+
outWithPostRendering, err := withPostRendering.CombinedOutput()
105+
require.NoError(t, err, string(outWithPostRendering))
106+
107+
assert.Equal(t, string(outWithoutPostRendering), string(outWithPostRendering))
108+
})
109+
}
110+
111+
func runMake(t *testing.T, ctx context.Context, target string) {
112+
t.Helper()
113+
114+
cmd := exec.CommandContext(ctx, "make", target)
115+
cmd.Dir = ".."
116+
out, err := cmd.CombinedOutput()
117+
require.NoError(t, err, string(out))
118+
}

0 commit comments

Comments
 (0)