Benoit Tigeot
088959aae9
fix(schema): enable $ref resolution for directory charts
...
Set ChartDir only for directory-based charts to enable $ref resolution in
JSON schemas. Archived charts (.tgz) are loaded into memory without filesystem
extraction, so $ref resolution is not supported for them.
This fixes the original issue where `helm template .` and `helm install .`
failed to validate schemas with relative $ref references.
Fixes #31260
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
dd0b8f40ba
fix(schema): limit $ref resolution to lint command
...
Schema validation with $ref cross-file references only works when charts
are available as directories on the filesystem. The install, template, and
upgrade commands may work with archived charts (.tgz) that are loaded
directly into memory without filesystem extraction.
This change limits ChartDir setting to the lint command only. The lint
command already extracts archived charts to temporary directories before
validation, so $ref resolution works for both directory and archived charts
when linting.
For install/template/upgrade commands:
- Main schema validation continues to work
- Charts without $ref validate successfully
- Charts with $ref will fail .. maybe we could add a warning about $ref not being supported in these commands?
Changes:
- Remove ChartDir assignment from install and upgrade commands
- Update schema validation to use synthetic path when chartDir is empty
- Add test for linting archived chart with $ref
- Remove install/template/upgrade tests for $ref (not supported)
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
690730d3b9
fix(test): Remove symlink
...
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
6a2d9a8695
fix: handle dynamic schema paths in error message trimming
...
The error message trimming logic was hardcoded to remove the prefix
"jsonschema validation failed with 'file:///values.schema.json#'",
which broke when we switched to using absolute paths for $ref resolution.
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
a7884d228d
fix(schema): Add schema $ref resolution for all commands
...
Extends JSON schema validation to support relative $ref imports
across helm lint, install, template, and upgrade commands.
Addresses George's review comments:
- Pass chartDir directly instead of deriving from valuesPath
- Create new functions instead of changing public API signatures
- Use absolute file paths for proper URL-based $ref resolution
Implementation:
- Added ValidateAgainstSchemaWithPath to resolve $ref using
absolute file paths instead of root-relative URLs
- Thread chartDir through Install/Upgrade structs and all
validation functions
- Updated both v2 (public) and v3 (internal) lint rules
Fixes relative $ref resolution when running commands like:
helm lint ../sample-chart
helm install release ../sample-chart
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
30d803283d
Fix error message trimming for dynamic schema paths in JSON validation
...
Previously, the error trimming was hardcoded to remove only:
'jsonschema validation failed with 'file:///values.schema.json#''
After the fix for relative schema references (issue #31260 ), schema URLs
now include the full absolute path, making error messages look like:
'jsonschema validation failed with 'file:///full/absolute/path/values.schema.json#''
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
abf95de91e
Do not remove necessary logs
...
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2 months ago
Benoit Tigeot
7aba8bbfe6
Resolve JSON schema reference paths for relative imports
...
When validating values against JSON schemas, relative file references
in the schema (like "$ref": "./other-schema.json") were failing because
in some cases. The JSON schema validator couldn't resolve the correct
base directory.
This change passes the absolute base directory to the schema validator,
allowing it to properly resolve relative JSON schema references by
constructing the correct file:// URLs with the proper path context.
Tested with:
- `helm lint .`
- `helm lint subfolder`
Fixes #31260
Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
Add test
2 months ago
George Jenkins
1455d12abb
Merge pull request #31796 from mmorel-35/modernize-pkg-2-8b02e3a
...
chore(pkg): fix modernize linter
2 months ago
George Jenkins
3dfc4f3cf6
Merge pull request #31858 from helm/gjenkins/go_fix
...
chore: `go fix` fixes
2 months ago
George Jenkins
3ad9ccdb19
Merge pull request #31563 from Mujib-Ahasan/dry-run-fix
...
fix: --dry-run=server now respect generateName
2 months ago
George Jenkins
b667317422
fixup `strings.Cut` variables
...
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2 months ago
George Jenkins
92b64e87ad
chore: fixes
...
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2 months ago
Evans Mungai
ee018608f6
fix: handle OCI digest algorithm prefix in chart downloader ( #31601 )
...
* fix: strip digest algorithm prefix before hex decoding
OCI references with tag+digest (e.g., chart:1.0@sha256:abc...) failed with "invalid byte" error because the sha256: prefix was passed to hex.DecodeString().
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Add cmd test for OCI references with tag+digest
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Move oci registry push result to a struct
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Review comments from PR review
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
* Fix failing test
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
---------
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2 months ago
Terry Howe
b26ec6b09e
Merge pull request #31566 from TerryHowe/fix-test-concurrency-download-index
...
fix: test concurrency download index
2 months ago
Matt Farina
794372e317
Merge pull request #31816 from mmorel-35/errorlint-pkg-7-6d6a660
...
fix(pkg): errorlint linter
2 months ago
Matt Farina
580d6aecea
Merge pull request #31840 from helm/dependabot/github_actions/main/actions/stale-10.2.0
...
chore(deps): bump actions/stale from 10.1.1 to 10.2.0
2 months ago
Matt Farina
9c08c2554e
Merge pull request #31831 from helm/dependabot/go_modules/main/k8s-io-5943130ff0
...
chore(deps): bump the k8s-io group with 7 updates
2 months ago
dependabot[bot]
304d25ffd3
chore(deps): bump actions/stale from 10.1.1 to 10.2.0
...
Bumps [actions/stale](https://github.com/actions/stale ) from 10.1.1 to 10.2.0.
- [Release notes](https://github.com/actions/stale/releases )
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md )
- [Commits](997185467f...b5d41d4e1d )
---
updated-dependencies:
- dependency-name: actions/stale
dependency-version: 10.2.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
dependabot[bot]
0b134362f4
chore(deps): bump the k8s-io group with 7 updates
...
Bumps the k8s-io group with 7 updates:
| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api ) | `0.35.0` | `0.35.1` |
| [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver ) | `0.35.0` | `0.35.1` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery ) | `0.35.0` | `0.35.1` |
| [k8s.io/apiserver](https://github.com/kubernetes/apiserver ) | `0.35.0` | `0.35.1` |
| [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime ) | `0.35.0` | `0.35.1` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go ) | `0.35.0` | `0.35.1` |
| [k8s.io/kubectl](https://github.com/kubernetes/kubectl ) | `0.35.0` | `0.35.1` |
Updates `k8s.io/api` from 0.35.0 to 0.35.1
- [Commits](https://github.com/kubernetes/api/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/apiextensions-apiserver` from 0.35.0 to 0.35.1
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases )
- [Commits](https://github.com/kubernetes/apiextensions-apiserver/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/apimachinery` from 0.35.0 to 0.35.1
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/apiserver` from 0.35.0 to 0.35.1
- [Commits](https://github.com/kubernetes/apiserver/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/cli-runtime` from 0.35.0 to 0.35.1
- [Commits](https://github.com/kubernetes/cli-runtime/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/client-go` from 0.35.0 to 0.35.1
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md )
- [Commits](https://github.com/kubernetes/client-go/compare/v0.35.0...v0.35.1 )
Updates `k8s.io/kubectl` from 0.35.0 to 0.35.1
- [Commits](https://github.com/kubernetes/kubectl/compare/v0.35.0...v0.35.1 )
---
updated-dependencies:
- dependency-name: k8s.io/api
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/apiextensions-apiserver
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/apimachinery
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/apiserver
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/cli-runtime
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/client-go
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
- dependency-name: k8s.io/kubectl
dependency-version: 0.35.1
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: k8s-io
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Evans Mungai
4a91f3ad5c
feat(release): add internal/release/v2 package for chart v3 support ( #31709 )
...
Introduce release/v2 that mirrors pkg/release/v1 but uses *v3.Chart
from internal/chart/v3. The code is structurally identical to v1 with
only import paths changed to reference internal/chart/v3 instead of
pkg/chart/v2.
- Add internal/release/v2 with Release, Info, Hook types
- Add internal/release/v2/util with filter, sorter, manifest utilities
- Update pkg/release/common.go with v2Accessor and v2HookAccessor
- Copy all test files from pkg/release/v1 and add a v2 test in common_test.go
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2 months ago
Terry Howe
b6fbb68c2b
Merge pull request #31776 from t0rr3sp3dr0/pedrotorres/fix-oci-index-pull
...
fix regression when pulling charts from OCI indices
2 months ago
Joe Julian
2b04c7804f
Merge pull request #31822 from helm/dependabot/go_modules/main/golang.org/x/crypto-0.48.0
...
chore(deps): bump golang.org/x/crypto from 0.47.0 to 0.48.0
2 months ago
Joe Julian
947b429cdd
Merge pull request #31801 from mmorel-35/modernize-pkg-4-062b248
...
chore(pkg): fix modernize linter
2 months ago
Joe Julian
78f5af72be
Merge pull request #31802 from mmorel-35/modernize-pkg-5-a3c8fdb
...
chore(pkg): fix modernize linter
2 months ago
Joe Julian
70899a6b3f
Merge pull request #31578 from manute/main
...
fix(action): crd resources can be empty
2 months ago
Joe Julian
14e0b8f970
Merge pull request #31128 from orgads/win-parallel
...
fix(downloader): prevent concurrent file access errors on Windows
2 months ago
dependabot[bot]
782385397c
chore(deps): bump golang.org/x/crypto from 0.47.0 to 0.48.0
...
Bumps [golang.org/x/crypto](https://github.com/golang/crypto ) from 0.47.0 to 0.48.0.
- [Commits](https://github.com/golang/crypto/compare/v0.47.0...v0.48.0 )
---
updated-dependencies:
- dependency-name: golang.org/x/crypto
dependency-version: 0.48.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Joe Julian
0c31960175
Merge pull request #31819 from helm/dependabot/go_modules/main/golang.org/x/term-0.40.0
...
chore(deps): bump golang.org/x/term from 0.39.0 to 0.40.0
2 months ago
dependabot[bot]
aec7aced38
chore(deps): bump golang.org/x/term from 0.39.0 to 0.40.0
...
Bumps [golang.org/x/term](https://github.com/golang/term ) from 0.39.0 to 0.40.0.
- [Commits](https://github.com/golang/term/compare/v0.39.0...v0.40.0 )
---
updated-dependencies:
- dependency-name: golang.org/x/term
dependency-version: 0.40.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Joe Julian
b8e4c11a65
Merge pull request #31820 from helm/dependabot/go_modules/main/golang.org/x/text-0.34.0
...
chore(deps): bump golang.org/x/text from 0.33.0 to 0.34.0
2 months ago
Joe Julian
83a0bfaa0e
Merge pull request #31817 from helm/dependabot/go_modules/main/sigs.k8s.io/kustomize/kyaml-0.21.1
...
chore(deps): bump sigs.k8s.io/kustomize/kyaml from 0.21.0 to 0.21.1
2 months ago
Joe Julian
41deb1647c
Merge pull request #31826 from helm/dependabot/go_modules/main/github.com/lib/pq-1.11.2
...
chore(deps): bump github.com/lib/pq from 1.11.1 to 1.11.2
2 months ago
dependabot[bot]
a23b6388ac
chore(deps): bump github.com/lib/pq from 1.11.1 to 1.11.2
...
Bumps [github.com/lib/pq](https://github.com/lib/pq ) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/lib/pq/releases )
- [Changelog](https://github.com/lib/pq/blob/master/CHANGELOG.md )
- [Commits](https://github.com/lib/pq/compare/v1.11.1...v1.11.2 )
---
updated-dependencies:
- dependency-name: github.com/lib/pq
dependency-version: 1.11.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Joe Julian
1728ac6b83
Merge pull request #31808 from mmorel-35/errorlint-internal-2-1b31365
...
fix(internal): errorlint linter
2 months ago
Joe Julian
56d0d9374a
Merge pull request #31810 from mmorel-35/errorlint-pkg-5-dda0145
...
fix(pkg): errorlint linter
2 months ago
Joe Julian
7f9703fe22
Merge pull request #31811 from mmorel-35/errorlint-pkg-3-39f7a9f
...
fix(pkg): errorlint linter
2 months ago
Joe Julian
e0b3cc4d4a
Merge pull request #31805 from mmorel-35/errorlint-cmd-1-696d7f0
...
fix(cmd): errorlint linter
2 months ago
Terry Howe
e7b0cadf77
Merge pull request #31809 from mmorel-35/errorlint-pkg-8-6adf4e8
...
fix(pkg): errorlint linter
2 months ago
dependabot[bot]
5cddc95bed
chore(deps): bump golang.org/x/text from 0.33.0 to 0.34.0
...
Bumps [golang.org/x/text](https://github.com/golang/text ) from 0.33.0 to 0.34.0.
- [Release notes](https://github.com/golang/text/releases )
- [Commits](https://github.com/golang/text/compare/v0.33.0...v0.34.0 )
---
updated-dependencies:
- dependency-name: golang.org/x/text
dependency-version: 0.34.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
dependabot[bot]
2e266c3ec9
chore(deps): bump sigs.k8s.io/kustomize/kyaml from 0.21.0 to 0.21.1
...
Bumps [sigs.k8s.io/kustomize/kyaml](https://github.com/kubernetes-sigs/kustomize ) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/kubernetes-sigs/kustomize/releases )
- [Commits](https://github.com/kubernetes-sigs/kustomize/compare/api/v0.21.0...api/v0.21.1 )
---
updated-dependencies:
- dependency-name: sigs.k8s.io/kustomize/kyaml
dependency-version: 0.21.1
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2 months ago
Scott Rigby
d47f38b1a6
Merge pull request #31804 from gjenkins8/gjenkins/pgp_key
...
chore: new KEYS entry for George Jenkins
2 months ago
Matthieu MOREL
259f76a849
fix(pkg): errorlint linter
...
errorlint linter in pkg/cmd
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
025418291a
fix(internal): errorlint linter
...
errorlint linter in internal/third_party/dep/fs
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
6d1490ed1e
fix(pkg): errorlint linter
...
#### Description
errorlint linter in pkg/cmd
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
4330bdea04
fix(pkg): errorlint linter
...
#### Description
errorlint linter in pkg
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
c8989d984f
fix(pkg): errorlint linter
...
#### Description
errorlint linter in pkg
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
Matthieu MOREL
edbd705bd0
fix(cmd): errorlint linter
...
#### Description
errorlint linter in cmd/helm
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2 months ago
George Jenkins
5638c35399
chore: new KEYS entry for George Jenkins
...
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2 months ago
Terry Howe
9b22aa4e05
Merge pull request #31795 from mmorel-35/modernize-internal-1-bbfa1fe
...
chore(internal): fix modernize linter
2 months ago