165 Commits

Author SHA1 Message Date
Scott Rigby
e23bf3af53 build: Clean up Goreleaser change (#32098)
Makefile:
- restore dist target
- remove unused LDFLAGS added to dist target
- remove unused TARGETS var

gh release action:
- restore build-cross to release and canary-release jobs

Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: Terry Howe <terrylhowe@gmail.com>
2026-05-04 19:46:58 -04:00
Terry Howe
f60ab7c31c fix: add -extldflags -static to dist target to match build-cross
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 19:40:24 -06:00
Terry Howe
64aa46f2f1 build: use goreleaser build with manual archive creation
goreleaser v2 has a bug with no_unique_dist_dir where it registers
archive tasks for all sub-arch variants even when constraints limit
builds to one per arch, causing archive collision errors. Switch dist
target to use goreleaser build (binaries only) and create tar.gz/zip
archives manually, copying LICENSE and README.md into each platform
directory to match the existing archive structure.

Add sub-arch constraints (goamd64, goarm64, go386, goriscv64) to ensure
only one variant is built per architecture.

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 19:19:20 -06:00
Terry Howe
d199a1a42c chore: remove build-cross dependency from test-acceptance
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 12:25:35 -06:00
Terry Howe
c075022ce1 fix: address goreleaser build issues flagged in review
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 11:50:15 -06:00
Terry Howe
04885dd905 fix: pass VERSION as GORELEASER_CURRENT_TAG to preserve v-prefix in archive names
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 11:35:35 -06:00
Terry Howe
eaa09100b9 fix: canary build file names
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 10:30:05 -06:00
Terry Howe
37284a9211 fix goreleaser archive
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 10:30:05 -06:00
Terry Howe
e368f170af update configuration to v2
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 10:30:04 -06:00
Terry Howe
e7bea8513c remove GOTOOLCHAIN
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 10:30:04 -06:00
Terry Howe
075c096afe chore: replace mitchellh/gox with goreleaser
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2026-05-02 10:30:04 -06:00
Branch Vincent
c6d9a5bdc2 build: set kube version via debug.BuildInfo
Signed-off-by: Branch Vincent <branchevincent@gmail.com>
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-12-19 21:13:47 -08:00
Benoit Tigeot
faa8912e36 Inform we use a different golangci-lint version than the CI
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-27 08:58:32 +01:00
Benoit Tigeot
b6a8c65216 fix: correct LDFLAGS path for default Kubernetes version
The Makefile LDFLAGS were pointing to an incorrect package path
(helm.sh/helm/v4/pkg/chart/common/util) that doesn't exist, causing
the k8sVersionMajor and k8sVersionMinor variables to silently fail
to be set. This left the hardcoded defaults (1.20) in place.

After this fix, `helm template` now correctly defaults to Kubernetes
v1.34.0 (matching the bundled client-go version) instead of v1.20.0,
ensuring charts render with current stable API versions.

Testing scenario:

```sh
cat > /tmp/test-chart/Chart.yaml << 'EOF'
apiVersion: v2
name: test-chart
version: 1.0.0
kubeVersion: ">= 1.28.0-0"
EOF

./bin/helm template test-release /tmp/test-chart

cat > /tmp/test-chart-fail/Chart.yaml << 'EOF'
apiVersion: v2
name: test-chart-fail
version: 1.0.0
kubeVersion: ">= 1.35.0-0"
EOF

./bin/helm template test-release /tmp/test-chart-fail

Exit code 1
Error: chart requires kubeVersion: >= 1.35.0-0 which is incompatible with Kubernetes v1.34.0
```

Fixes #31508
Closes #31501
Closes #31502

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-11-14 21:18:37 +01:00
Robert Sirchia
f0386b1daa Merge pull request #31338 from yzewei/add-loong64-support
Add loongarch64 support
2025-10-21 15:51:31 -04:00
yzewei
fd3ef2e000 Add loongarch64 support
Signed-off-by: yzewei <yangzewei@loongson.cn>
2025-10-09 09:07:39 +08:00
George Jenkins
b97452d0e7 feat: helm version print Kubernetes (client-go) version
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-10-01 14:15:47 -07:00
Stephanie Hohenberg
1904ef6ad8 Adapt test-coverage command to be able to run for a certain package
Signed-off-by: Stephanie Hohenberg <stephanie.hohenberg@gmail.com>
2025-09-07 11:01:16 -04:00
Matt Farina
9dcc49cbd5 Move lint pkg to be part of each chart version
Linting is specific to the chart versions. A v2 and v3 chart will
lint differently.

To accomplish this, packages like engine need to be able to handle
different chart versions. This was accomplished by some changes:

1. The introduction of a Charter interface for charts
2. The ChartAccessor which is able to accept a chart and then
   provide access to its data via an interface. There is an
   interface, factory, and implementation for each version of
   chart.
3. Common packages were moved to a common and util packages.
   Due to some package loops, there are 2 packages which may
   get some consolidation in the future.

The new interfaces provide the foundation to move the actions
and cmd packages to be able to handle multiple apiVersions of
charts.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-02 12:14:37 -04:00
Evans Mungai
5dabfdfb3f Merge remote-tracking branch 'origin/main' into em/check-go-modules
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-09-01 12:01:11 +01:00
Terry Howe
9eafbc53df fix: make file whitespace
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-08-30 02:00:33 -04:00
Terry Howe
4bc93393bc feature: enable shuffle for unit tests
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-08-18 10:40:23 -06:00
Evans Mungai
064a18ff79 Update Makefile
Co-authored-by: Terry Howe <terrylhowe@gmail.com>
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-08-07 17:50:26 +01:00
Evans Mungai
46c8caa410 Add info target as part of build
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-08-07 19:11:17 +03:00
Evans Mungai
0dae3d6e88 chore: check if go modules are tidy before build
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-08-07 12:34:26 +01:00
Matt Farina
0dffc580b0 Simpligy the JSON Schema checking
A new library was introduced that provides JSON Schema checking for
newer versions of the schema. In Helm v4, there is no need to have
two packages doing the JSON schema validation. The message output
can have breaking changes.

This change moves everything to the newer library. It also uses a
wrapper error to enable a clean Helm only interface for the
public Go API validation functions. This would enable the replacement
of the Schema validation library, if needed, without breaking the
Go API contract.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-04-14 19:32:01 -04:00
Matt Farina
61d3eca55c Move pkg/chart to pkg/chart/v2 to prepare for v3 charts
This change moves the code, updates the import locations, and
adds a doc.go file to document what the v2 package is for.

This is part of HIP 20 for v3 charts

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-25 15:20:44 -05:00
Matt Farina
5c0deec327 Moving chartutil to chart/util
chartutil was originally created to operate on protobufs which are
no longer part of Helm. The util package makes more sense to be
part of the chart package.

This change is part of the HIP 20 to create v3 charts and
explicitly call out v2 charts. The changes for this are in smaller
bite size changes.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-21 15:25:55 -05:00
Matt Farina
2236294119 Updating to helm.sh/helm/v4
Since Helm is going through breaking changes with Helm v4, the version path to
Helm needs to be updated.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-26 16:33:51 -05:00
George Jenkins
4a15cc3385 Cleanup redundant GO11MODULE
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2024-10-20 19:56:14 -07:00
Matt Farina
d45439f2e9 Merge pull request #11923 from Bhargav-InfraCloud/helm-create-deprication-tests
test(create): Add test to check deprecated `apiVersion`s in resource templates created by `helm create`
2024-09-27 21:37:28 +02:00
Asmit De
5cef14370d [mk] Add windows arm64 build targets
Signed-off-by: Asmit De <asmit.de@outlook.com>
2024-05-12 01:54:46 -07:00
Bhargav Ravuri
9c0b4c8121 test(create): Test to check deprecated resource templates
Test to check deprecation warnings on resource templates that are
created by `helm create` against the latest Kubernetes version. This
test is run in a separate Makefile command to avoid failing other unit
tests configured to run with a specific Kubernetes version(s).

For resources that are disabled by default (like hpa and ingress),
to avoid skipping them from the helm linter test, they are enabled in
the test.

Fixes #11495

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2024-04-03 12:25:12 +05:30
weidongkl
57a1bb80e5 Update architecture detection method
```
In some OS, obtaining the processor type from `uname - p` may fail.
For Golang programs, we should use `go env GOARCH` to obtain the architecture

=====================
$ go env GOARCH
amd64
$ uname -m
x86_64
$ uname -p
unknown
```

Signed-off-by: weidongkl <weidong@uniontech.com>
2024-01-11 10:53:29 +08:00
Matt Farina
847369c184 Update to Go 1.21 for builds
Noteis:
1. This moves golangci scanning to a GitHub action. This will
   enable inline pointers to issues in the PR where linting fails.
2. Go 1.21 is specified in the go.mod because Kubernetes libs
   require it.
3. The lint issues were removed. Some were fixed while others
   were handled by skipping linting or using _ as an argument.
   Many of these can be refactored later for better cleanup.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 15:48:36 -05:00
Antony Chazapis
040330592f Pin gox to specific commit
Signed-off-by: Antony Chazapis <chazapis@ics.forth.gr>
2023-09-01 09:47:01 +03:00
Antony Chazapis
786707c065 Add support for RISC-V
Signed-off-by: Antony Chazapis <chazapis@ics.forth.gr>
2023-07-13 11:56:56 +03:00
Joe Julian
6f6c0d831d Allow CGO_ENABLED to be overridden for build
On Mac OS they have some custom dns c library that uses some
configuration files other than resolv.conf to configure dns lookups. The
standard go library does not handle these custom configuration files
which causes dns lookups to fail for some mac users.

This allows the downstream pacakgers to override CGO_ENABLED to build
binaries that use the custom dns library.

Signed-off-by: Joe Julian <me@joejulian.name>
2022-10-05 16:12:17 -07:00
Matthew Fisher
aa6e82bac8 fix: use go install instead of go get
Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
2022-07-06 13:34:15 -07:00
Matt Farina
3490f1e7b6 Updating vcs to latest version
vcs had a release due to a CVE. This updates to the latest version
that mitigates the CVE.

Note, the Makefile was updated so that `make build` would build
without cgo just like gox does in the CI pipeline. They should
both build without cgo so we can catch issues before merging to
master where a canary build would pick up the problem.

Signed-off-by: Matt Farina <matt@mattfarina.com>
2022-04-04 15:52:07 -04:00
Adam Reese
d1da9e757e fix(ci-lint): increase timeout for golangci-lint
Signed-off-by: Adam Reese <adam@reese.io>
2021-07-06 10:37:37 -07:00
Josh Soref
2bf8fdf45d chore: Spelling (#9410)
* spelling: annotate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: asserts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: binary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: copied

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deprecated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inputting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabberwocky

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: length

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mismatch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outputs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: panicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: plugins

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: porthos

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: regular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resource

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strict

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-15 21:11:57 -04:00
Matt Farina
bfb6bb7af9 Merge pull request #9381 from joelanford/darwin-arm64
Add darwin/arm64 (Apple Silicon) support
2021-03-12 11:56:53 -05:00
pallavJha
03eec30907 add flag trimpath in the go build command
Signed-off-by: Pallav Jha <pallav_kumar71@yahoo.com>
Signed-off-by: pallavJha <pallav_kumar71@yahoo.com>
2021-03-06 15:31:36 +05:30
Joe Lanford
ecdc34c5ab Add darwin/arm64 (Apple Silicon) support
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
2021-02-18 10:17:53 -05:00
Marc Khouzam
8d33624520 fix(test): Increase golangci-lint timeout
CircleCI has been failing on 'make test-style' because of a timeout.
This commit increases the timeout.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2021-02-15 21:32:55 -05:00
Adam Reese
b4010b7782 chore(Makefile): add target to generate golden files
Add target to generate golden files used in unit tests

Signed-off-by: Adam Reese <adam@reese.io>
2021-01-11 12:14:45 -08:00
Adam Reese
6760dda91f Merge pull request #9192 from adamreese/fix/rebuild-on-gomod-change
fix(Makefile): rebuild the binary if go.mod has changed
2021-01-06 11:36:44 -08:00
Joe Julian
fdcd22ef58 Reduce linting severity for users of out-of-date kubernetes (#8608)
* Reduce linting severity for users of out-of-date kubernetes

Fixes #8596

Signed-off-by: Joe Julian <me@joejulian.name>

* add more verbose deprecation info

Signed-off-by: Joe Julian <me@joejulian.name>

* use new upstream deprecations

Signed-off-by: Joe Julian <me@joejulian.name>

* do not error for custom resources

Signed-off-by: Joe Julian <me@joejulian.name>

* Define deprecation version in lint rules by LDFLAG

Signed-off-by: Joe Julian <me@joejulian.name>

* make comment clearer

Signed-off-by: Joe Julian <me@joejulian.name>

* Extend the k8s version discovery and constants to chartutil

Signed-off-by: Joe Julian <me@joejulian.name>

* remove awk dependency

Signed-off-by: Joe Julian <me@joejulian.name>

* align k8s version constant names between capabilities.go and deprecations.go

Signed-off-by: Joe Julian <me@joejulian.name>

* show the error if the unexpected happens

Signed-off-by: Joe Julian <me@joejulian.name>

* bump k8sVersionMinor and golden chart templates for k8s 1.20

Signed-off-by: Joe Julian <me@joejulian.name>

* bump for tests to match 1.20.1

Signed-off-by: Joe Julian <me@joejulian.name>
2021-01-05 16:05:33 -07:00
Adam Reese
a58209dfa4 fix(Makefile): rebuild the binary if go.mod has changed
Rebuild the binary when go.mod or go.sum has changed

Signed-off-by: Adam Reese <adam@reese.io>
2021-01-05 13:40:06 -08:00